Re: [f2py] add link option (Mac OS X)

Brian Toby <[email protected]> Wed, 22 Jun 2011 12:35:20 -0500
Newsgroups gmane.comp.python.f2py.user
Message-ID <[email protected]>
On Jun 21, 2011, at 4:02 PM, Brian Toby wrote:

> I would like to add some extra options to the link step for an "f2py -c ..." execution. I note that, when I use "f2py -c --help-fcompiler" I can see that 
> 
>  linker_so       = ['/sw/bin/gfortran', '-Wall', '-m32', '-Wall', '-undefined', 'dynamic_lookup', '-bundle']
> 
> In specific, I want to add -static-libgfortran and -static-libgcc to these options. 

The folks at Enthought gave me the missing bit in this. The environment variable LDFLAGS overrides distutils:

LDFLAGS='-undefined dynamic_lookup -bundle -static-libgfortran -static-libgcc'  f2py -c ...

does what I want. 

Brian