[SciPy-user] Plea: Installing SciPy on Mac 10.4.9: _fftpack.so problems?

Robert Kern robert.kern@gmail....
Fri Mar 16 15:31:35 CDT 2007


Nick Fotopoulos wrote:
>> Message: 5
>> Date: Thu, 15 Mar 2007 15:07:26 -0400
>> From: Lawrence David <ldavid@MIT.EDU>
>> Subject: Re: [SciPy-user] Plea: Installing SciPy on Mac 10.4.9:
>>         _fftpack.so     problems?
>> To: SciPy Users List <scipy-user@scipy.org>
>> Message-ID: <77114BB9-AB85-4BB2-85F5-DE324676EC3C@mit.edu>
>> Content-Type: text/plain; charset="us-ascii"
>>
>> Hot darn Batman - you nailed it!!
>>
>> Much thanks,
>> - lawrence
>>
>> http://www.stinkpot.org
>>
>>
>> On Mar 15, 2007, at 12:58 PM, Robert Kern wrote:
>>
>>> Lawrence David wrote:
>>>> Hi there,
>>>>
>>>> I'm pulling the little hair I have out trying to install SciPy on
>>>> my G4
>>>> PPC running OS 10.4.9.
>>>>
>>>> I've followed the instructions on the SciPy.org
>>>> website: http://www.scipy.org/Installing_SciPy/Mac_OS_X.  I've got
>>>> gcc
>>>> 4.0.1 and gfortran (gnu95 -> 4.3).
>>>>
>>>> Running build: "python setup.py build_src build_clib --
>>>> fcompiler=gnu95
>>>> build_ext --fcompiler=gnu95 build", yields a long error message that
>>>> terminates with a litany of "Undefined symbols" and this last
>>>> message:
>>>>
>>>> collect2: ld returned 1 exit status
>>>> error: Command "/usr/local/bin/gfortran -L/sw/lib
>>>> build/temp.macosx-10.3-fat-2.5/build/src.macosx-10.3-fat-2.5/Lib/
>>>> fftpack/_fftpackmodule.o
>>>> build/temp.macosx-10.3-fat-2.5/Lib/fftpack/src/zfft.o
>>>> build/temp.macosx-10.3-fat-2.5/Lib/fftpack/src/drfft.o
>>>> build/temp.macosx-10.3-fat-2.5/Lib/fftpack/src/zrfft.o
>>>> build/temp.macosx-10.3-fat-2.5/Lib/fftpack/src/zfftnd.o
>>>> build/temp.macosx-10.3-fat-2.5/build/src.macosx-10.3-fat-2.5/
>>>> fortranobject.o
>>>> -L/usr/local/lib -L/usr/local/lib/gcc/powerpc-apple-darwin8.8.0/4.3.0
>>>> -Lbuild/temp.macosx-10.3-fat-2.5 -ldfftpack -lfftw3 -lgfortran -o
>>>> build/lib.macosx-10.3-fat-2.5/scipy/fftpack/_fftpack.so" failed with
>>>> exit status 1
>>>>
>>>> I've noticed several other folks have had similar error messages
>>>> on this
>>>> board, but none of the posted solutions worked for me.  If anyone
>>>> could
>>>> offer any suggestions on what to try, I'd love to hear them!
>>> It looks like you have LDFLAGS defined (thus, the -L/sw/lib). That
>>> *replaces*
>>> all of the Python-specific linker flags that distutils provides.
> 
> The symptoms sound exactly like mine, except that in my case LDFLAGS
> is definitely not defined, so the solution does not apply to me.  The
> big thread http://groups.google.com/group/comp.lang.python/browse_thread/thread/1fadaffda3a768a7/9a76e6cb3482d4a7?lnk=st&q=distutils+build+flags+problems&rnum=14&hl=en#9a76e6cb3482d4a7
> says more or less the same thing.

Except in that case, LDFLAGS was the problem.

> nvf@dirac:~$ echo $LD<tab><tab>
> $LDG_DIRECTORY          $LDG_LOCATION           $LD_LIBRARY_PATH
> $LDG_INSTALL_LOG        $LDG_SOFTWARE_LOCATION
> 
> Is there anything else that could cause missing flags?  Scipy builds for the
> Apple-supplied Python 2.3, but does not build for MacPython 2.4 or
> 2.5.
> 
> I eventually got it to build using "python setup.py build_src
> build_clib --fcompiler=gnu95 build_ext -lpython --fcompiler=gnu95
> build", but unsurprisingly, it doesn't work.  I think it's picking up
> the system python's libpython:

Yes, because you added -lpython which is not how you need to link against the
Python libraries for framework builds of Python.

> nvf@dirac:~$ python -c "import scipy; scipy.test(10,10)"
> Fatal Python error: Interpreter not initialized (version mismatch?)
> Abort trap
> nvf@dirac:~$ locate libpython
> /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/libpython.dylib
> /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/libpython2.3.dylib
> /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/libpython2.dylib
> /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/config/libpython2.4.a
> /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/config/libpython2.5.a
> /usr/lib/libpython.dylib
> /usr/lib/libpython2.3.dylib
> /usr/lib/libpython2.dylib
> 
> Those libpython.dylibs just simlink to the libpython2.3.dylib.  I
> would have thought that the MacPython installer would provide dynamic
> libraries in addition to the static libraries.

No, everything should be contained in /Library/Frameworks/Python.framework . In
such a case, the "shared library" is actually the file
/Library/Frameworks/Python.framework/Python . It gets linked when "-framework
Python" is part of the link command, as distutils does provided it is not
interfered with.

> I would appreciate any help on this, as my previous pleas have gone
> unanswered.  If there's any other information I can provide, just let
> me know.

Can you supply the output from an unsuccessful build again? Don't do -lpython
this time.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco


More information about the SciPy-user mailing list