Re: Errors running script

new topic     » goto parent     » topic index » view thread      » older message » newer message

After fixing the minor errors:

-- Euphoria Code    
atom t0    
t0 = time()  
   
integer n  
n = 10  
 
sequence b_lst  
b_lst = repeat( 1, n )    
 
sequence prime_lst  
prime_lst = {}    
    
for prime = 2 to n do    
	if b_lst[prime] then    
		prime_lst = append(prime_lst, prime )    
		for i = prime * 2  to n by prime do    
			b_lst[i] = 0    
		end for    
	end if    
end for    
    
? prime_lst    
? time() - t0   

The original error you got was from ld.so, not Euphoria.

libgtk3-nocsd.so.0 was a hack added to prevent the GTK developers from messing with the native look and feel of the window managers on various platforms. It's no longer included in modern linux distros.

Running the corrected source code above with Euphoria 3.1.1 works fine, but compiling it on modern 64-bit Linux (Mint) results in the following error:

init-.c linking /usr/bin/ld: i386 architecture of input file `/home/irv/euphoria/bin/ecu.a(be_machine.o)' is incompatible with i386:x86-64 output

While there might be some kind of work-around to prevent this compile failure, just compiling the program using Euphoria 4.2 is a much better solution. It compiles and runs correctly.

You really should update to Eu 4.1 or 4.2, it has lots of improvements.

https://openeuphoria.org/wiki/view/DownloadEuphoria.wc

BTW, when I run this with n = 10, I get:

{2,3,5,7} 
0 

The linux time command for n = 10 gives:

{2,3,5,7} 
0 
 
real	0m0.004s 
user	0m0.001s 
sys	0m0.003s 
 

I had to change the line n = 10 to n = 20000 to get a non-0 sec runtime.

0.009999999776 
 
real	0m0.011s 
user	0m0.005s 
sys	0m0.006s 
 

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu