[SciPy-user] Building scipy 0.5.1 on Mac OS 10.4.7

Tom Bridgman cygnusx1 at mac.com
Sat Oct 7 22:31:11 CDT 2006


I've finally achieved a successful build of scipy 0.5.1 &  
numpy-1.0rc1 on Mac OS 10.4.7 PPC.  I was guided by the instructions at

http://www.scipy.org/Installing_SciPy/Mac_OS_X

However, there were some confusing parts in the description, for  
example:

- I switched to gcc 3.3 to build fftw but had to switch back to gcc  
4.0 to build numpy and later.
- I had to set the link to libgcc.a just prior to the actual scipy  
build.
- All numpy tests passed, but two scipy tests failed.

Everything built okay, but when I tried to run a program that called  
scipy.integrate, it failed with:

     import scipy.integrate
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/site-packages/scipy/integrate/__init__.py", line 9, in ?
     from quadrature import *
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/site-packages/scipy/integrate/quadrature.py", line 8, in ?
     from scipy.special.orthogonal import p_roots
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/site-packages/scipy/special/__init__.py", line 8, in ?
     from basic import *
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/site-packages/scipy/special/basic.py", line 8, in ?
     from _cephes import *
ImportError: Failure linking new module: /Library/Frameworks/ 
Python.framework/Versions/2.4/lib/python2.4/site-packages/scipy/ 
special/_cephes.so: Symbol not found: _printf$LDBLStub
   Referenced from: /Library/Frameworks/Python.framework/Versions/2.4/ 
lib/python2.4/site-packages/scipy/special/_cephes.so
   Expected in: dynamic lookup

Suggestions?

Tom
========
GCC/G77
% sudo tar -xvf g77v3.4-bin.tar -C /
% sudo gcc_select 3.3

FFTW Libraries
% gnutar -xvzf fftw-3.1.2.tar.gz
% cd fftw-3.1.2
% ./configure
% make
% sudo make install
% sudo ln -s /usr/local/lib/libfftw3.a /usr/local/lib/libfftw.a
% sudo     ln -s /usr/local/lib/libfftw3.la /usr/local/lib/libfftw.la
% sudo    ln -s /usr/local/include/fftw3.h /usr/local/include/fftw.h

numpy
% sudo gcc_select 4.0
% gnutar xzf numpy-1.0rc1.tar.gz
% sudo python setup.py install
% python
import numpy
numpy.test(1,1)
(ALL PASSED)

% gnutar xzf scipy-0.5.1.tar.gz
% cd scipy-0.5.1
sudo ln -s /usr/lib/gcc/powerpc-apple-darwin8/4.0.1/libgcc.a /usr/ 
local/lib/libcc_dynamic.a

Some may encounter a linking error when building fftpack, which  
mentions something about undefined symbols from /usr/lib/ld. If so,  
you need to edit 'Lib/fftpack/setup.py' by changing:

     config.add_extension('_fftpack',
       sources=sources,
       libraries=['dfftpack'],
       extra_info = extra_info
     )

     config.add_extension('convolve',
       sources = ['convolve.pyf','src/convolve.c'],
       libraries = ['dfftpack'],
       extra_info = extra_info
     )

to:

     config.add_extension('_fftpack',
       sources=sources,
       libraries=['dfftpack'],
       extra_info = extra_info,
       extra_link_args = ['-lSystemStubs']
     )

     config.add_extension('convolve',
       sources = ['convolve.pyf','src/convolve.c'],
       libraries = ['dfftpack'],
       extra_info = extra_info,
       extra_link_args = ['-lSystemStubs']
     )


% python setup.py build
% sudo python setup.py install
% python
 >>> import scipy
 >>> scipy.test(level=1)
ERROR: check_integer (scipy.io.tests.test_array_import.test_read_array)
ERROR: check_simple_todense  
(scipy.io.tests.test_mmio.test_mmio_coordinate)


--
W.T. Bridgman, Ph.D.
Physics & Astronomy



More information about the SciPy-user mailing list