[Numpy-discussion] setup.py does not use the correct library

Peng Yu pengyu.ut@gmail....
Mon Sep 28 19:35:39 CDT 2009


On Mon, Sep 28, 2009 at 4:44 PM, Robert Kern <robert.kern@gmail.com> wrote:
> On Mon, Sep 28, 2009 at 16:40, Peng Yu <pengyu.ut@gmail.com> wrote:
>> I attached the script that I run for build and the build output. I
>> think that setup.py doesn't use the correct python library. But I'm
>> not sure why. Would you please help me figure out what the problem is?
>
> Setting $LDFLAGS to be empty is also incorrect. Simply do not set
> $LDFLAGS or $CPPFLAGS at all.
>
> [And please do not Cc: me. I read the list.]

Even if I don't set $LDFLAGS in my build script, I still have LDFLAGS
set in my ~/.bash_profile.

Here is the my build script and the build output. It
still gives me errors. What is wrong with it?

$ cat ~/notes/install/numpy/build
#!/usr/bin/env bash

#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 CPPFLAGS=
#export LDFLAGS=

export PATH=$HOME/.bin/misc:$HOME/utility/linux/opt/Python-2.6.2/bin:$HOME/utility/linux/opt/gcc-4.3.4/bin:/usr/local/bin:/usr/bin:/bin
#echo $PATH
gcc --version
python --version

python setup.py build --fcompiler=gnu95 | tee build_output ;
sendmail.sh build_output

$ tail -20 build_output
/home/pengy/download/linux/python/numpy-1.3.0rc2/build/src.linux-x86_64-2.6/numpy/core/include/numpy/__multiarray_api.h:1007:
undefined reference to `PyExc_RuntimeError'
/home/pengy/download/linux/python/numpy-1.3.0rc2/build/src.linux-x86_64-2.6/numpy/core/include/numpy/__multiarray_api.h:1007:
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:830:
undefined reference to `PyErr_Print'
/home/pengy/download/linux/python/numpy-1.3.0rc2/numpy/linalg/lapack_litemodule.c:830:
undefined reference to `PyExc_ImportError'
build/temp.linux-x86_64-2.6/numpy/linalg/lapack_litemodule.o: In
function `_import_array':
/home/pengy/download/linux/python/numpy-1.3.0rc2/build/src.linux-x86_64-2.6/numpy/core/include/numpy/__multiarray_api.h:977:
undefined reference to `PyCObject_AsVoidPtr'
/home/pengy/download/linux/python/numpy-1.3.0rc2/build/src.linux-x86_64-2.6/numpy/core/include/numpy/__multiarray_api.h:984:
undefined reference to `PyExc_RuntimeError'
/home/pengy/download/linux/python/numpy-1.3.0rc2/build/src.linux-x86_64-2.6/numpy/core/include/numpy/__multiarray_api.h:984:
undefined reference to `PyErr_Format'
/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 `PyExc_RuntimeError'
/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'
/home/pengy/utility/linux/opt/gcc-4.3.4/lib/gcc/x86_64-unknown-linux-gnu/4.3.4/libgfortranbegin.a(fmain.o):
In function `main':
/home/pengy/download/linux/gcc-4.3.4-build-20090905-220719/x86_64-unknown-linux-gnu/libgfortran/../../../gcc-4.3.4/libgfortran/fmain.c:21:
undefined reference to `MAIN__'
collect2: ld returned 1 exit status



Regards,
Peng


More information about the NumPy-Discussion mailing list