videlec / pypolymake

Python wrappers for polymake
https://pypi.python.org/pypi/pypolymake
3 stars 5 forks source link

compilation fails on archlinux #13

Closed videlec closed 7 years ago

videlec commented 7 years ago

Compilation fails on archlinux with

g++ [...]  -lperl [...] -o build/lib.linux-x86_64-2.7/polymake/number.so
/usr/bin/ld : ne peut trouver -lperl
collect2: erreur : ld a retourné 1 code d'état d'exécution
error: command 'g++' failed with exit status 1

Indeed libperl is in a strange location

$ find /usr/lib -name "libperl.so"
/usr/lib/perl5/core_perl/CORE/libperl.so

Also discussed on archlinux forum.

videlec commented 7 years ago

One solution

$ sage -sh
$ LIBRARY_PATH=$LIBRARY_PATH:/usr/lib/perl5/core_perl/CORE/
$ pip install git+https://github.com/videlec/pypolymake.git

then

$ export LD_LIBRARY_PATH=/usr/lib/perl5/core_perl/CORE/
$ sage
<... snip ...>
sage: import polymake  # does work !!
videlec commented 7 years ago

Same kind of problem on fedora described on stackoverflow.

videlec commented 7 years ago

To avoid setting manually LD_LIBRARY_PATH, one can permanently configure the run-time binding with ldconfig as follows

1) create a file /etc/ld.so.conf.d/perl.conf with the line /usr/lib/perl5/core_perl/CORE/ 2) run $ sudo ldconfig

You can check whether it succeeded by doing

$ ldconfig -p | grep libperl
    libperl.so (libc6,x86-64) => /usr/lib/perl5/core_perl/CORE/libperl.so

(no output = trouble)

videlec commented 7 years ago

fixed with 041cd67