[SciPy-user] scipy, f2py and ifort on intel mac

George Nurser agn at noc.soton.ac.uk
Tue Jan 16 17:10:22 CST 2007

I managed to get f2py to work with ifort on a MBP C2D by following  
the hint in  Pearu Petersen's post in
  & included

         if sys.platform=='darwin':
	    opt.extend(['-undefined', 'dynamic_lookup', '-bundle'])

in  /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/ 

In intel.py I also replaced -KPIC by -fPIC as recommended by the  
ifort manual, and removed -shared from the linker_so dictionary list,  
as the manual indicated it's not a valid option.
after that e.g.
f2py --fcompiler=intel -c Wright.f -m Wright
produced a module that imported fine into numpy.

Emboldened by this I had a go at compiling scipy using ifort, with

python setup.py build config_fc --fcompiler=intel

This did *not* work ...
It made blas.so successfully, but the compiler fortcom went into an  
infinite loop when trying to compile lapack.so. The last output (I  
also then changed -O3 to -O2 in case it helped) was:

linalg/flapackmodule.c:11799: warning: passing argument 6 of  
'f2py_func' from incompatible pointer type
compiling Fortran sources
Fortran f77 compiler: /usr/bin/ifort -72 -w90 -w95 -fPIC -cm -O2
Fortran f90 compiler: /usr/bin/ifort -FR -fPIC -cm -O2
Fortran fix compiler: /usr/bin/ifort -FI -fPIC -cm -O2
compile options: '-Ibuild/src.macosx-10.3-fat-2.4 -I/Library/ 
numpy/core/include -I/Library/Frameworks/Python.framework/Versions/ 
2.4/include/python2.4 -c'
ifort:f77: build/src.macosx-10.3-fat-2.4/build/src.macosx-10.3- 
/usr/bin/ifort -nofor_main -undefined dynamic_lookup -bundle build/ 
src.macosx-10.3-fat-2.4/scipy/linalg/flapackmodule.o build/ 
fortranobject.o build/temp.macosx-10.3-fat-2.4/build/src.macosx-10.3- 
f2pywrappers.o -Lbuild/temp.macosx-10.3-fat-2.4 -o build/ 
lib.macosx-10.3-fat-2.4/scipy/linalg/flapack.so -Wl,-framework - 

After this output, terminal hung until the compilation job was killed.

Compilation with gfortran
python setup.py build

seemed to work without any problems.

Anybody have any ideas?

--George Nurser.

More information about the SciPy-user mailing list