Robert Kern wrote:
> Robert Kern wrote:
>> Christopher Barker wrote:
>>
>>> So does that mean we can build Universal binaries of Scipy now?
>> With some fiddling, probably.
> 
> Namely,
> 
>   $ LDFLAGS="-undefined dynamic_lookup -bundle -arch i386 -arch ppc" python
> setup.py config_fc --fcompiler=gnu95 --arch="-arch i386 -arch ppc" build

And, if you copy the libgfortran.a file to somewhere else, say ~/staticlibs/,
you can force the linker to use it instead of the .dylib such that your users
don't need to install gfortran.

  $ export LDFLAGS="-undefined dynamic_lookup -bundle -arch i386 -arch ppc
-Wl,-search_paths_first"
  $ python setup.py config_fc --fcompiler=gnu95 --arch="-arch i386 -arch ppc"
build_ext -L ~/staticlibs/ build
  ...
  $ file build/lib.macosx-10.3-fat-2.5/scipy/odr/__odrpack.so
  build/lib.macosx-10.3-fat-2.5/scipy/odr/__odrpack.so: Mach-O universal binary
with 2 architectures
  build/lib.macosx-10.3-fat-2.5/scipy/odr/__odrpack.so (for architecture i386):
  Mach-O bundle i386
  build/lib.macosx-10.3-fat-2.5/scipy/odr/__odrpack.so (for architecture ppc):
  Mach-O bundle ppc
  $ otool -L build/lib.macosx-10.3-fat-2.5/scipy/odr/__odrpack.so

  build/lib.macosx-10.3-fat-2.5/scipy/odr/__odrpack.so:
        /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate
(compatibility version 1.0.0, current version 4.0.0)
        /usr/local/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current
version 1.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
88.3.7)

The pointer to /usr/local/lib/libgcc_s.1.dylib is innocuous. That's just the
first place it will look for that library at runtime. There's one in /usr/lib
that appears to be picked up and used just fine.

Problem solved. Finally.

-- 
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

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to