setup.py does not use the correct library
I use the following command to build numpy-1.3.0rc2. But it seems not able to find the appropriate library files. Can somebody let me know how to make it use the correct ones? #####command export LD_LBRARY_PATH= export CPPFLAGS="-I$HOME/utility/linux/opt/Python-2.6.2/include/python2.6" export LDFLAGS="-L$HOME/utility/linux/opt/Python-2.6.2/lib -lpython2.6" export PATH=$HOME/utility/linux/opt/Python-2.6.2/bin:/usr/local/bin:/usr/bin:/bin python setup.py build --fcompiler=gnu95 #######error /home/pengy/download/linux/python/numpy-1.3.0rc2/build/src.linux-x86_64-2.6/numpy/core/include/numpy/__multiarray_api.h:996: undefined reference to `PyErr_Format' build/temp.linux-x86_64-2.6/numpy/linalg/lapack_litemodule.o: In function `initlapack_lite': /home/pengy/download/linux/python/numpy-1.3.0rc2/numpy/linalg/lapack_litemodule.c:833: undefined reference to `PyDict_SetItemString' /home/pengy/download/linux/python/numpy-1.3.0rc2/numpy/linalg/lapack_litemodule.c:830: undefined reference to `PyErr_SetString' build/temp.linux-x86_64-2.6/numpy/linalg/python_xerbla.o: In function `xerbla_': /home/pengy/download/linux/python/numpy-1.3.0rc2/numpy/linalg/python_xerbla.c:35: undefined reference to `PyExc_ValueError' /home/pengy/download/linux/python/numpy-1.3.0rc2/numpy/linalg/python_xerbla.c:35: undefined reference to `PyErr_SetString' /usr/lib/gcc/x86_64-redhat-linux/4.1.2/libgfortranbegin.a(fmain.o): In function `main': (.text+0xa): undefined reference to `MAIN__' collect2: ld returned 1 exit status
On Mon, Sep 28, 2009 at 14:31, Peng Yu <pengyu.ut@gmail.com> wrote:
I use the following command to build numpy-1.3.0rc2. But it seems not able to find the appropriate library files. Can somebody let me know how to make it use the correct ones?
#####command export LD_LBRARY_PATH= export CPPFLAGS="-I$HOME/utility/linux/opt/Python-2.6.2/include/python2.6" export LDFLAGS="-L$HOME/utility/linux/opt/Python-2.6.2/lib -lpython2.6"
When compiling Fortran extensions, $LDFLAGS replaces every linker flag, including things like -shared. Be sure you know what you are doing when using this. But you really shouldn't have to be using $LDFLAGS or $CPPFLAGS like this. Python should know where its libraries and include directories are. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
On Mon, Sep 28, 2009 at 2:53 PM, Robert Kern <robert.kern@gmail.com> wrote:
On Mon, Sep 28, 2009 at 14:31, Peng Yu <pengyu.ut@gmail.com> wrote:
I use the following command to build numpy-1.3.0rc2. But it seems not able to find the appropriate library files. Can somebody let me know how to make it use the correct ones?
#####command export LD_LBRARY_PATH= export CPPFLAGS="-I$HOME/utility/linux/opt/Python-2.6.2/include/python2.6" export LDFLAGS="-L$HOME/utility/linux/opt/Python-2.6.2/lib -lpython2.6"
When compiling Fortran extensions, $LDFLAGS replaces every linker flag, including things like -shared. Be sure you know what you are doing when using this.
But you really shouldn't have to be using $LDFLAGS or $CPPFLAGS like this. Python should know where its libraries and include directories are.
My python is compiled with gcc-3.4.4. I used gcc-4.1.2 which generate the error in my previous email. Do I have to use the same compiler to compile numpy? Regards, Peng
On Mon, Sep 28, 2009 at 16:27, Peng Yu <pengyu.ut@gmail.com> wrote:
On Mon, Sep 28, 2009 at 2:53 PM, Robert Kern <robert.kern@gmail.com> wrote:
On Mon, Sep 28, 2009 at 14:31, Peng Yu <pengyu.ut@gmail.com> wrote:
I use the following command to build numpy-1.3.0rc2. But it seems not able to find the appropriate library files. Can somebody let me know how to make it use the correct ones?
#####command export LD_LBRARY_PATH= export CPPFLAGS="-I$HOME/utility/linux/opt/Python-2.6.2/include/python2.6" export LDFLAGS="-L$HOME/utility/linux/opt/Python-2.6.2/lib -lpython2.6"
When compiling Fortran extensions, $LDFLAGS replaces every linker flag, including things like -shared. Be sure you know what you are doing when using this.
But you really shouldn't have to be using $LDFLAGS or $CPPFLAGS like this. Python should know where its libraries and include directories are.
My python is compiled with gcc-3.4.4. I used gcc-4.1.2 which generate the error in my previous email. Do I have to use the same compiler to compile numpy?
It's a good idea, particularly with the jump from 3.4 to 4.1. However, the source of the error you saw is that you have defined $LDFLAGS. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
participants (2)
-
Peng Yu -
Robert Kern