andyvand / gmpy

Automatically exported from code.google.com/p/gmpy
GNU Lesser General Public License v3.0
0 stars 0 forks source link

libmpc.so.3: cannot open shared object file #64

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. I'm running ubuntu 12.10
uname -a
Linux mintvm 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012 x86_64 
x86_64 x86_64 GNU/Linux

2. Have installed gmp, mpfr and mpc:
gmp-5.0.5.tar.bz2
mpfr-3.1.1.tar.gz
mpc-1.0.1.tar.gz

3. Then trying to install:
gmpy2-2.0.0b2.zip

$ python setup.py build
running build
running build_ext
building 'gmpy2' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall 
-Wstrict-prototypes -fPIC -DWITHMPFR=1 -DWITHMPC=1 -I/usr/local/include 
-I/usr/include/python2.7 -c src/gmpy2.c -o 
build/temp.linux-x86_64-2.7/src/gmpy2.o
creating build/lib.linux-x86_64-2.7
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions 
-Wl,-z,relro build/temp.linux-x86_64-2.7/src/gmpy2.o -L/usr/local/lib -lgmp 
-lmpfr -lmpc -o build/lib.linux-x86_64-2.7/gmpy2.so

$ sudo python setup.py install
running install
running build
running build_ext
running install_lib
copying build/lib.linux-x86_64-2.7/gmpy2.so -> 
/usr/local/lib/python2.7/dist-packages
running install_egg_info
Removing /usr/local/lib/python2.7/dist-packages/gmpy2-2.0.0b2.egg-info
Writing /usr/local/lib/python2.7/dist-packages/gmpy2-2.0.0b2.egg-info

4. However cannot import gmpy2:

$ python
Python 2.7.3 (default, Sep 26 2012, 21:51:14) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import gmpy2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: libmpc.so.3: cannot open shared object file: No such file or 
directory

$ ll /usr/local/lib/libmpc.*
-rw-r--r-- 1 root root 239228 Dec 11 06:41 /usr/local/lib/libmpc.a
-rwxr-xr-x 1 root root    944 Dec 11 06:41 /usr/local/lib/libmpc.la*
lrwxrwxrwx 1 root root     15 Dec 11 06:41 /usr/local/lib/libmpc.so -> 
libmpc.so.3.0.0*
lrwxrwxrwx 1 root root     15 Dec 11 06:41 /usr/local/lib/libmpc.so.3 -> 
libmpc.so.3.0.0*
-rwxr-xr-x 1 root root 111742 Dec 11 06:41 /usr/local/lib/libmpc.so.3.0.0*

Original issue reported on code.google.com by alexande...@gmail.com on 10 Dec 2012 at 9:06

GoogleCodeExporter commented 9 years ago
ok, it works if /usr/local/lib added to LD_LIBRARY_PATH

Original comment by alexande...@gmail.com on 10 Dec 2012 at 9:33

GoogleCodeExporter commented 9 years ago
Please close the issue

Original comment by alexande...@gmail.com on 10 Dec 2012 at 9:34

GoogleCodeExporter commented 9 years ago
You can also compile gmpy2 using these options:

python setup.py build_ext -f -Ddir=/usr/local install -f

The "-Ddir=/usr/local" instructs setup.py to include the runtime path 
information into the gmpy2 library. With this option, you won't need to modify 
LD_LIBRARY_PATH.

The "-f" options forces a recompile. IIRC, if just include the -D option 
immediately after building gmpy2, it believes nothing has changed so it won't 
actually recompile. I include it out of habit.

Original comment by casevh on 11 Dec 2012 at 3:02

GoogleCodeExporter commented 9 years ago
That's a good option, thank you!

Original comment by alexande...@gmail.com on 11 Dec 2012 at 8:52