[SciPy-user] Building SciPy with IBM XL Fortran compiler on Mac OS X

Neil Martinsen-Burrell nmb at unc.edu
Fri Apr 14 15:23:23 CDT 2006


I am having a problem build SciPy (svn r1854) with the IBM XL 8.1 
fortran compiler on Mac OS X 10.4.6.  Starting from a clean checkout, it 
builds a number of libraries successfully, but fails one the final one. 
  Here's the log (elided, full results at 
http://braeburn.amath.unc.edu/~nburrell/scipy.build.log)

[...]
building 'scipy.fftpack._fftpack' extension
compiling C sources
gcc options: '-fno-strict-aliasing -Wno-long-double -no-cpp-precomp 
-mno-fused-madd -DNDEBUG -g -O3 -Wall -Wstrict-prototypes'
creating build/temp.darwin-8.5.0-Power_Macintosh-2.4/build
creating build/temp.darwin-8.5.0-Power_Macintosh-2.4/build/src
creating build/temp.darwin-8.5.0-Power_Macintosh-2.4/build/src/Lib
creating build/temp.darwin-8.5.0-Power_Macintosh-2.4/build/src/Lib/fftpack
creating build/temp.darwin-8.5.0-Power_Macintosh-2.4/Lib/fftpack/src
compile options: '-Ibuild/src 
-I/Network/Servers/core.amath.unc.edu/Volumes/data/home/nburrell/usr/lib/python2.4/site-packages/numpy/core/include 
-I/Network/Servers/core.amath.unc.edu/Volumes/data/home/nburrell/usr/include/python2.4 
-c'
gcc: Lib/fftpack/src/drfft.c
gcc: Lib/fftpack/src/zfftnd.c
gcc: build/src/fortranobject.c
In file included from 
/Network/Servers/core.amath.unc.edu/Volumes/data/home/nburrell/usr/include/python2.4/Python.h:55,
                  from build/src/fortranobject.h:7,
                  from build/src/fortranobject.c:2:
/Network/Servers/core.amath.unc.edu/Volumes/data/home/nburrell/usr/include/python2.4/pyport.h:396: 
warning: 'struct winsize' declared inside parameter list
/Network/Servers/core.amath.unc.edu/Volumes/data/home/nburrell/usr/include/python2.4/pyport.h:397: 
warning: 'struct winsize' declared inside parameter list
gcc: build/src/Lib/fftpack/_fftpackmodule.c
In file included from 
/Network/Servers/core.amath.unc.edu/Volumes/data/home/nburrell/usr/include/python2.4/Python.h:55,
                  from build/src/Lib/fftpack/_fftpackmodule.c:16:
/Network/Servers/core.amath.unc.edu/Volumes/data/home/nburrell/usr/include/python2.4/pyport.h:396: 
warning: 'struct winsize' declared inside parameter list
/Network/Servers/core.amath.unc.edu/Volumes/data/home/nburrell/usr/include/python2.4/pyport.h:397: 
warning: 'struct winsize' declared inside parameter list
gcc: Lib/fftpack/src/zfft.c
gcc: Lib/fftpack/src/zrfft.c
Traceback (most recent call last):
   File "setup.py", line 50, in ?
     setup_package()
   File "setup.py", line 42, in setup_package
     configuration=configuration )
   File 
"/Network/Servers/core.amath.unc.edu/Volumes/data/home/nburrell/usr/lib/python2.4/site-packages/numpy/distutils/core.py", 
line 153, in setup
     return old_setup(**new_attr)
   File 
"/Network/Servers/core.amath.unc.edu/Volumes/data/home/nburrell/usr/lib/python2.4/distutils/core.py", 
line 149, in setup
     dist.run_commands()
   File 
"/Network/Servers/core.amath.unc.edu/Volumes/data/home/nburrell/usr/lib/python2.4/distutils/dist.py", 
line 946, in run_commands
     self.run_command(cmd)
   File 
"/Network/Servers/core.amath.unc.edu/Volumes/data/home/nburrell/usr/lib/python2.4/distutils/dist.py", 
line 966, in run_command
     cmd_obj.run()
   File 
"/Network/Servers/core.amath.unc.edu/Volumes/data/home/nburrell/usr/lib/python2.4/site-packages/numpy/distutils/command/install.py", 
line 11, in run
     r = old_install.run(self)
   File 
"/Network/Servers/core.amath.unc.edu/Volumes/data/home/nburrell/usr/lib/python2.4/distutils/command/install.py", 
line 506, in run
     self.run_command('build')
   File 
"/Network/Servers/core.amath.unc.edu/Volumes/data/home/nburrell/usr/lib/python2.4/distutils/cmd.py", 
line 333, in run_command
     self.distribution.run_command(command)
   File 
"/Network/Servers/core.amath.unc.edu/Volumes/data/home/nburrell/usr/lib/python2.4/distutils/dist.py", 
line 966, in run_command
     cmd_obj.run()
   File 
"/Network/Servers/core.amath.unc.edu/Volumes/data/home/nburrell/usr/lib/python2.4/distutils/command/build.py", 
line 112, in run
     self.run_command(cmd_name)
   File 
"/Network/Servers/core.amath.unc.edu/Volumes/data/home/nburrell/usr/lib/python2.4/distutils/cmd.py", 
line 333, in run_command
     self.distribution.run_command(command)
   File 
"/Network/Servers/core.amath.unc.edu/Volumes/data/home/nburrell/usr/lib/python2.4/distutils/dist.py", 
line 966, in run_command
     cmd_obj.run()
   File 
"/Network/Servers/core.amath.unc.edu/Volumes/data/home/nburrell/usr/lib/python2.4/site-packages/numpy/distutils/command/build_ext.py", 
line 109, in run
     self.build_extensions()
   File 
"/Network/Servers/core.amath.unc.edu/Volumes/data/home/nburrell/usr/lib/python2.4/distutils/command/build_ext.py", 
line 405, in build_extensions
     self.build_extension(ext)
   File 
"/Network/Servers/core.amath.unc.edu/Volumes/data/home/nburrell/usr/lib/python2.4/site-packages/numpy/distutils/command/build_ext.py", 
line 301, in build_extension
     link = self.fcompiler.link_shared_object
AttributeError: 'NoneType' object has no attribute 'link_shared_object'


It appears that self.fcompiler is None in build_ext.py because 
IBMFCompiler.get_version() returns None even when there is a valid IBM 
fortran compiler installed.  Digging into 
numpy/distutils/fcompiler/ibm.py, in get_version(), the version 
discovery code contains:

	    [...]
             if not l:
                 from distutils.version import LooseVersion
                 self.version = version = LooseVersion(l[0])
         return version


I believe that this should be "if l".

Making that change shows the IBM compiler as available in

python setup.py config_fc --help-fcompiler

and scipy builds correctly.  Can someone make this change to 
numpy/distutils/fcompiler/ibm.py?  Thanks.  Peace,

-Neil

-- 
Neil Martinsen-Burrell
nmb at unc.edu



More information about the SciPy-user mailing list