[Numpy-discussion] Building NumPy for Python on specified directory

Magician f_magician at mac.com
Tue May 1 20:09:38 EDT 2012


Hi all, 

I'm now installing Python 2.7.3 and NumPy 1.6.1 
on clean-installed CentOS 6.2. 
At first, I installed Python as below: 
> ./configure --prefix=/usr/local --enable-shared 
> make 
> make install 
> vi /etc/ld.so.conf #add /usr/local/lib 
> /sbin/ldconfig 
and successfully installed NumPy. 

But if I install Python as below: 
> ./configure --prefix=/usr/local/python-273 --enable-shared 
> make 
> make install 
> vi /etc/ld.so.conf #add /usr/local/python-273/lib 
> /sbin/ldconfig 
then "setup.py build" dumped these errors: 
> compile options: '-Inumpy/core/include -Ibuild/src.linux-x86_64-2.7/numpy/core/include/numpy -Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/include -I/usr/local/python-273/include/python2.7 -Ibuild/src.linux-x86_64-2.7/numpy/core/src/multiarray -Ibuild/src.linux-x86_64-2.7/numpy/core/src/umath -c' 
> gcc: build/src.linux-x86_64-2.7/numpy/core/src/_sortmodule.c 
> gcc -pthread -shared build/temp.linux-x86_64-2.7/build/src.linux-x86_64-2.7/numpy/core/src/_sortmodule.o -L. -Lbuild/temp.linux-x86_64-2.7 -lnpymath -lm -lpython2.7 -o build/lib.linux-x86_64-2.7/numpy/core/_sort.so 
> /usr/bin/ld: cannot find -lpython2.7 
> collect2: ld returned 1 exit status 
> /usr/bin/ld: cannot find -lpython2.7 
> collect2: ld returned 1 exit status 
> error: Command "gcc -pthread -shared build/temp.linux-x86_64-2.7/build/src.linux-x86_64-2.7/numpy/core/src/_sortmodule.o -L. -Lbuild/temp.linux-x86_64-2.7 -lnpymath -lm -lpython2.7 -o build/lib.linux-x86_64-2.7/numpy/core/_sort.so" failed with exit status 1 

How could I build NumPy for Python on specified directory?



More information about the NumPy-Discussion mailing list