[SciPy-user] Compiling scipy with ifort on an intel Mac

Rob Hetland hetland at tamu.edu
Tue Mar 7 15:13:28 CST 2006


I have had a hard time getting g77 compiled on my intel Mac, but I do  
have a beta version of the intel fortran compiler for the Mac...  So,  
I am trying to get scipy compiled with ifort.

I get an error like that shown below.  I get a similar error when  
trying to use f2py.  I should note that numpy (other than f2py)  
compiles fine.  I am such a hack when it comes to these things -- I'm  
sure I am doing something stupid.  I have tried a number of things --  
I have the regular Mac python, and a fresh install in /usr/local, but  
both fail in the same way.   I have tried including/excluding some of  
the obvious compiler flags such as -nofor_main.  It seems that the  
linker can't find the python libraries.  Including -lpython reduces  
the list of undefined symbols, but _MAIN__ still remains.

Can someone point me to the truth?

-Rob


EXAMPLE:

mire:~/src/python/scipy$ python setup.py config_fc --fcompiler=intel  
build

[...snip...]

f2py options: []
   adding 'build/src/fortranobject.c' to sources.
   adding 'build/src' to include_dirs.
building extension "scipy.special._cephes" sources
building extension "scipy.special.specfun" sources
f2py options: ['--no-wrap-functions']
   adding 'build/src/fortranobject.c' to sources.
   adding 'build/src' to include_dirs.
building extension "scipy.stats.statlib" sources
f2py options: ['--no-wrap-functions']
   adding 'build/src/fortranobject.c' to sources.
   adding 'build/src' to include_dirs.
building extension "scipy.stats.futil" sources
f2py options: []
   adding 'build/src/fortranobject.c' to sources.
   adding 'build/src' to include_dirs.
building extension "scipy.stats.mvn" sources
f2py options: []
   adding 'build/src/fortranobject.c' to sources.
   adding 'build/src' to include_dirs.
   adding 'build/src/Lib/stats/mvn-f2pywrappers.f' to sources.
building data_files sources
running build_py
copying Lib/__svn_version__.py -> build/lib.darwin-8.5.2-i386-2.4/scipy
copying build/src/scipy/__config__.py -> build/lib.darwin-8.5.2- 
i386-2.4/scipy
running build_clib
customize UnixCCompiler
customize UnixCCompiler using build_clib
Could not locate executable efort
Could not locate executable efc
customize IntelFCompiler
customize IntelFCompiler using build_clib
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize IntelFCompiler
customize IntelFCompiler using build_ext
building 'scipy.interpolate._fitpack' extension
compiling C sources
gcc options: '-fno-strict-aliasing -Wno-long-double -no-cpp-precomp - 
mno-fused-madd -DNDEBUG -g -O3 -Wall -Wstrict-prototypes'
compile options: '-I/usr/local/lib/python2.4/site-packages/numpy/core/ 
include -I/usr/local/include/python2.4 -c'
/opt/intel/fc/9.1.017/bin/ifort -shared -nofor_main build/ 
temp.darwin-8.5.2-i386-2.4/Lib/interpolate/_fitpackmodule.o -Lbuild/ 
temp.darwin-8.5.2-i386-2.4 -lfitpack -o build/lib.darwin-8.5.2- 
i386-2.4/scipy/interpolate/_fitpack.so
ifort: Command line warning: ignoring unknown option '-shared'
ld: Undefined symbols:
_PyArg_ParseTuple
_PyCObject_AsVoidPtr
_PyCObject_Type
_PyDict_SetItemString
_PyErr_Format
_PyErr_NewException
_PyErr_NoMemory
_PyErr_Occurred
_PyExc_RuntimeError
_PyImport_ImportModule
_PyModule_GetDict
_PyObject_GetAttrString
_PyString_FromString
_Py_BuildValue
_Py_FatalError
_Py_InitModule4
_MAIN__
ifort: Command line warning: ignoring unknown option '-shared'
ld: Undefined symbols:
_PyArg_ParseTuple
_PyCObject_AsVoidPtr
_PyCObject_Type
_PyDict_SetItemString
_PyErr_Format
_PyErr_NewException
_PyErr_NoMemory
_PyErr_Occurred
_PyExc_RuntimeError
_PyImport_ImportModule
_PyModule_GetDict
_PyObject_GetAttrString
_PyString_FromString
_Py_BuildValue
_Py_FatalError
_Py_InitModule4
_MAIN__
error: Command "/opt/intel/fc/9.1.017/bin/ifort -shared -nofor_main  
build/temp.darwin-8.5.2-i386-2.4/Lib/interpolate/_fitpackmodule.o - 
Lbuild/temp.darwin-8.5.2-i386-2.4 -lfitpack -o build/lib.darwin-8.5.2- 
i386-2.4/scipy/interpolate/_fitpack.so" failed with exit status 1
mire:~/src/python/scipy$ python setup.py config_fc --fcompiler=intel  
build







More information about the SciPy-user mailing list