[f2py] link options with f2py (gfortran on mac)

Brian Toby <[email protected]> Fri, 4 Mar 2011 14:31:16 -0600
Newsgroups gmane.comp.python.f2py.user
Message-ID <[email protected]>
After multiple attempts reading the f2py documentation, I have found no way to supply link-time options for f2py; is there a method?

For example, I am using 

	f2py -c pack_f.for -m pack_f --fcompiler=gnu95 --f77exec=/sw/bin/gfortran --f77flags="-fno-range-check"

(aside, I am not sure why I need to use --f77... options, but --f90flags does not get used.) 

I would like to specify the options -static-libgfortran and -static-libgcc in the final run of gfortran, so that the resulting .so file does not require libgfortran and libgcc, but I have not found a way to make this happen. I gather that I need to append to variable linker.so, but short of editing the python scripts, I don't see a way. Is there something I am missing?

Brian