f2py problem under MacOsX: "g95: unrecognized option '-shared'"
Hello, I'm running into trouble with f2py (numpy 1.0.3 on my intel MacOsX) f2py or actually f95 is complaining that -share option is not recognized: "g95: unrecognized option '-shared'" Which is actually true on an OsX platform. It should be something like -dynamic or so that should be used (but I'm not skilled enough to trouble shot this myself :-( )... Does somebody know how to solve the problem? David
David Tremouilles wrote:
Hello,
I'm running into trouble with f2py (numpy 1.0.3 on my intel MacOsX) f2py or actually f95 is complaining that -share option is not recognized: "g95: unrecognized option '-shared'" Which is actually true on an OsX platform. It should be something like -dynamic or so that should be used (but I'm not skilled enough to trouble shot this myself :-( )...
Does somebody know how to solve the problem?
Exactly which FORTRAN compiler are you using and what --fcompiler setting did you use? We've made the appropriate settings for gfortran (--fcompiler=gnu95), but we haven't done anything with g95 (--fcompiler=g95), which is what I assume you are using here. I think you may be the first person to try to use g95 on OS X with f2py; at least, the first to tell us about it. Consequently, we'll need your help in order to figure out what to do. Presumably, the necessary settings should be similar to those for gfortran. Please take a look at numpy/distutils/fcompiler/gnu.py:GnuFCompiler.get_flags_linker_so(). Most likely, that method can be simply copied over to numpy/distutils/fcompiler/g95.py . Let us know if that works for you. Thanks. -- 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
ok, I was using G95 (GCC 4.0.3 (g95 0.90!) ... using f2py -fcompiler=g95 ... But I realize gfortran was available on my computer but not recognize by numpy because the executable was "gfortran-mp-4.2". Creating a "gfortran" symbolic link to gfortran-mp-4.2 did the trick and now I can use successfully "f2py -fcompiler=gnu95 ..." So, somehow, my problem is solved... but still f2py did not to work with g95 due to the -share directive so I dig in as you suggested: I was not succesfull just copying the "get_flags_linker_so()" function but in g95.py I have succesfully modified: executables = { 'version_cmd' : ["g95", "--version"], 'compiler_f77' : ["g95", "-ffixed-form"], 'compiler_fix' : ["g95", "-ffixed-form"], 'compiler_f90' : ["g95"], 'linker_so' : ["g95", '-undefined', 'dynamic_lookup', '-bundle'], # ["g95", "-shared"] #here is the mod 'archiver' : ["ar", "-cr"], 'ranlib' : ["ranlib"] } To make g95 work on my intel macosx computer. Thanks for your help. David David 2007/6/12, Robert Kern <robert.kern@gmail.com>:
David Tremouilles wrote:
Hello,
I'm running into trouble with f2py (numpy 1.0.3 on my intel MacOsX) f2py or actually f95 is complaining that -share option is not recognized: "g95: unrecognized option '-shared'" Which is actually true on an OsX platform. It should be something like -dynamic or so that should be used (but I'm not skilled enough to trouble shot this myself :-( )...
Does somebody know how to solve the problem?
Exactly which FORTRAN compiler are you using and what --fcompiler setting did you use? We've made the appropriate settings for gfortran (--fcompiler=gnu95), but we haven't done anything with g95 (--fcompiler=g95), which is what I assume you are using here.
I think you may be the first person to try to use g95 on OS X with f2py; at least, the first to tell us about it. Consequently, we'll need your help in order to figure out what to do. Presumably, the necessary settings should be similar to those for gfortran. Please take a look at numpy/distutils/fcompiler/gnu.py:GnuFCompiler.get_flags_linker_so(). Most likely, that method can be simply copied over to numpy/distutils/fcompiler/g95.py .
Let us know if that works for you. Thanks.
-- 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 _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
participants (2)
-
David Tremouilles
-
Robert Kern