[SciPy-User] Does scipy binary install libgfortran.dylib?

Ralf Gommers ralf.gommers at googlemail.com
Tue Feb 28 02:28:20 EST 2012


On Mon, Feb 27, 2012 at 1:28 PM, Mark Bakker <markbak at gmail.com> wrote:

> Excellent, so it can be done.
> The next question is: How?
>

For scipy, first the wrappers are generated with f2py, then the extension
is built with gfortran with these flags:
    /usr/local/bin/gfortran -Wall -undefined dynamic_lookup -bundle -arch
i386 -arch ppc -Wl,-search_paths_first -Lbuild build/f2pywrapper.o
-lgfortran -o build/XXX.so -Wl,-framework -Wl,Accelerate

Hope that helps,
Ralf


> I found a suggestion from Brian Toby on the web from this summer, but that
> didn't work form me. This is what I did:
>
> On my Mac Terminal I type:
>
> LDFLAGS='-undefined dynamic_lookup -bundle -static-libgfortran -static-libgcc'
>
> f2py -c -m besselaes besselaes.f95
>
> This nicely creates the extension, which I can run on the machine I created it on, but if I move it to a
> machine that doesn't have the libgfortran.3.dylib file, it doesn't run and complains about that, so I
>
>
> conclude that the dynamic link failed (the size of the extension doesn't change when I set the LDFLAGS,
> which I thought was a bad omen). Any thoughts? Am I doing something wrong?
>
> Thanks for any help,
>
>
> Mark
>
>
>
>
> Date: Sun, 26 Feb 2012 17:38:19 +0100
>> From: Ralf Gommers <ralf.gommers at googlemail.com>
>> Subject: Re: [SciPy-User] Does scipy binary install libgfortran.dylib?
>> To: SciPy Users List <scipy-user at scipy.org>
>> Message-ID:
>>        <CABL7CQiUm8SaJCvCz=b=
>> yGca2tuxXmnkSTQXNTeVwTA1C_igwA at mail.gmail.com>
>> Content-Type: text/plain; charset="iso-8859-1"
>>
>>
>> On Sun, Feb 26, 2012 at 11:49 AM, Mark Bakker <markbak at gmail.com> wrote:
>>
>> > Hello List,
>> >
>> > Does Scipy install the correct version of libgfortran.dylib? Does it
>> > simply put it in /usr/local/lib/ ?
>> >
>> > I am trying to distribute my own package which includes FORTRAN
>> extensions
>> > and when installing on a brand new machine it complains that
>> > libgfortran.3.dylib cannot be found. I was wondering how Scipy handles
>> this
>> > (and thanks to Ralf Gommers for helping me so far, but I haven't been
>> able
>> > to solve this).
>> >
>>
>> Sorry for not being clearer before - I only knew that this worked for
>> scipy, not exactly how it worked. After some digging I found this in the
>> 0.7.1 release notes: "Mac OS X binary installer is now a proper universal
>> build, and does not depend on gfortran anymore (libgfortran is statically
>> linked)."
>>
>> Ralf
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20120228/09844c71/attachment.html>


More information about the SciPy-User mailing list