[SciPy-Dev] Scipy build errors - undefined reference to `Py* - CentOS6

sidharth kashyap sidharth.n.kashyap at gmail.com
Mon Apr 28 12:48:10 EDT 2014


Hi,

I am getting the below errors when I try to build Scipy.

build/temp.linux-x86_64-2.7/build/src.linux-x86_64-2.7/_fftpackmodule.o:
In function `f2py_rout__fftpack_destroy_dst1_cache':
scipy-0.13.3/scipy/fftpack/build/src.linux-x86_64-2.7/_fftpackmodule.c:3458:
undefined reference to `PyArg_ParseTupleAndKeywords'
scipy-0.13.3/scipy/fftpack/build/src.linux-x86_64-2.7/_fftpackmodule.c:3469:
undefined reference to `PyErr_Occurred'
scipy-0.13.3/scipy/fftpack/build/src.linux-x86_64-2.7/_fftpackmodule.c:3479:
undefined reference to `Py_BuildValue'
build/temp.linux-x86_64-2.7/build/src.linux-x86_64-2.7/_fftpackmodule.o:
In function `f2py_rout__fftpack_destroy_dst2_cache':
scipy-0.13.3/scipy/fftpack/build/src.linux-x86_64-2.7/_fftpackmodule.c:3397:
undefined reference to `PyArg_ParseTupleAndKeywords'
scipy-0.13.3/scipy/fftpack/build/src.linux-x86_64-2.7/_fftpackmodule.c:3408:
undefined reference to `PyErr_Occurred'
scipy-0.13.3/scipy/fftpack/build/src.linux-x86_64-2.7/_fftpackmodule.c:3418:
undefined reference to `Py_BuildValue'
build/temp.linux-x86_64-2.7/build/src.linux-x86_64-2.7/_fftpackmodule.o:
In function `f2py_rout__fftpack_destroy_ddst1_cache':
scipy-0.13.3/scipy/fftpack/build/src.linux-x86_64-2.7/_fftpackmodule.c:3336:
undefined reference to `PyArg_ParseTupleAndKeywords'
scipy-0.13.3/scipy/fftpack/build/src.linux-x86_64-2.7/_fftpackmodule.c:3347:
undefined reference to `PyErr_Occurred'
scipy-0.13.3/scipy/fftpack/build/src.linux-x86_64-2.7/_fftpackmodule.c:3357:
undefined reference to `Py_BuildValue'
build/temp.linux-x86_64-2.7/build/src.linux-x86_64-2.7/_fftpackmodule.o:
In function `f2py_rout__fftpack_destroy_ddst2_cache':
scipy-0.13.3/scipy/fftpack/build/src.linux-x86_64-2.7/_fftpackmodule.c:3275:
undefined reference to `PyArg_ParseTupleAndKeywords'
scipy-0.13.3/scipy/fftpack/build/src.linux-x86_64-2.7/_fftpackmodule.c:3286:
undefined reference to `PyErr_Occurred'
scipy-0.13.3/scipy/fftpack/build/src.linux-x86_64-2.7/_fftpackmodule.c:3296:
undefined reference to `Py_BuildValue'
build/temp.linux-x86_64-2.7/build/src.linux-x86_64-2.7/_fftpackmodule.o:
In function `f2py_rout__fftpack_destroy_dct1_cache':
scipy-0.13.3/scipy/fftpack/build/src.linux-x86_64-2.7/_fftpackmodule.c:2542:
undefined reference to `PyArg_ParseTupleAndKeywords'
scipy-0.13.3/scipy/fftpack/build/src.linux-x86_64-2.7/_fftpackmodule.c:2553:
undefined reference to `PyErr_Occurred'
scipy-0.13.3/scipy/fftpack/build/src.linux-x86_64-2.7/_fftpackmodule.c:2563:
undefined reference to `Py_BuildValue'
build/temp.linux-x86_64-2.7/build/src.linux-x86_64-2.7/_fftpackmodule.o:
In function `f2py_rout__fftpack_destroy_dct2_cache':
scipy-0.13.3/scipy/fftpack/build/src.linux-x86_64-2.7/_fftpackmodule.c:2481:
undefined reference to `PyArg_ParseTupleAndKeywords'
scipy-0.13.3/scipy/fftpack/build/src.linux-x86_64-2.7/_fftpackmodule.c:2492:
undefined reference to `PyErr_Occurred'
scipy-0.13.3/scipy/fftpack/build/src.linux-x86_64-2.7/_fftpackmodule.c:2502:
undefined reference to `Py_BuildValue'


The build progresses well till fftpack

Here is the command used to build

 python setup.py build --fcompiler=gnu95 --force --verbose --debug

Python Version:
python --version
Python 2.7.3


Numpy version:
>>> import numpy
>>> numpy.__version__
'1.6.2'


All the sources: python, numpy and atlas have been compiled using the
same version of gcc (4.6.2)

LD_LIBRARY_PATH has the path for the objects  located at
./python/2.7.3/gnu-4.6.2/lib

I have also put in INCLUDE, INCLUDE_PATH, C_INCLUDE_PATH have the path
to the header files (Python.h)

The command at which it fails:

gfortran -Wall -L/app/libraries/expat/2.0.1/gnu-4.6.2/lib -lexpat -g
build/temp.linux-x86_64-2.7/build/src.linux-x86_64-2.7/_fftpackmodule.o
build/temp.linux-x86_64-2.7/src/zfft.o
build/temp.linux-x86_64-2.7/src/drfft.o
build/temp.linux-x86_64-2.7/src/zrfft.o
build/temp.linux-x86_64-2.7/src/zfftnd.o
build/temp.linux-x86_64-2.7/build/src.linux-x86_64-2.7/src/dct.o
build/temp.linux-x86_64-2.7/build/src.linux-x86_64-2.7/src/dst.o
build/temp.linux-x86_64-2.7/build/src.linux-x86_64-2.7/fortranobject.o
-Lbuild/temp.linux-x86_64-2.7 -ldfftpack -lfftpack -lgfortran -o
build/lib.linux-x86_64-2.7/fftpack/_fftpack.so

The error:

scipy-0.13.3/scipy/fftpack/build/src.linux-x86_64-2.7/fortranobject.c:959:
undefined reference to `PyCObject_AsVoidPtr'
collect2: ld returned 1 exit status


I have tried to put in -l and -L options to include the library paths.

Any help on this is highly appreciated

Should I include any other build parameters?

Thanks,
Sid



More information about the SciPy-Dev mailing list