exaloop / codon

A high-performance, zero-overhead, extensible Python compiler using LLVM
https://docs.exaloop.io/codon
Other
13.96k stars 498 forks source link

invalid ELF header - raised from dlopen #427

Closed aresper closed 11 months ago

aresper commented 11 months ago

When running my codon compile application I get the following error:

me@desktop:~/Python-sandbox/$ ./main_0_0 0 0
CError: /usr/local/lib/libpython3.6m.a: invalid ELF header

Raised from: std.internal.dlopen.dlopen.2:0
/home/alexandre/.codon/lib/codon/stdlib/internal/dlopen.codon:31:9
Abortado (imagem do núcleo gravada)

Any ideas?

aresper commented 11 months ago

Hi, I am using Codon with Ubuntu 16.04. Ubuntu 16.04 by default comes with Python 3.5. I have upgraded to Python 3.6, but I still get the error above. All environment variables seem ok. I also tried to reinstall Codon after installing Python3.6 using; /bin/bash -c "$(curl -fsSL https://exaloop.io/install.sh)" Still didn't work. How can I check with version of Python Codon is using? Could Codon still be configured to use the wrong Python version, i.e., 3.5?

inumanag commented 11 months ago

Hi @aresper

You need to set CODON_PYTHON to point to a .so. (dynamic) library, not .a (static) library. Look for /usr/local/lib/libpython3.6m.so and that should solve the problem.

aresper commented 11 months ago

Hi @inumanag, Thank you for this hint. Actually I was not able to locate the dynamic libraries in my installation. I had to reconfigure Python3.6 with shared library support and rebuild it:

./configure --enable-shared
make
sudo make install

My application is now running. But I have to debug the executable, as it is issuing an error.