[Numpy-discussion] f2py : NotImplementedError: Only MS compiler supported with gfortran on win64

Jim Vickroy Jim.Vickroy@noaa....
Fri Sep 9 10:14:28 CDT 2011





On 9/8/2011 5:56 AM, Jim Vickroy wrote:
> Hello All, I'm attempting to create a python wrapper, for a Fortran
> subroutine, using f2py.
>
> My system details are:
>
>   >>>  sys.version '2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500
> 32 bit (Intel)]'
>   >>>  sys.getwindowsversion() (5, 1, 2600, 2, 'Service Pack 3')
>   >>>  scipy.__version__ '0.7.1'
>   >>>  numpy.__version__ '1.4.0'
> C:\>gfortran -dumpversion
> 4.7.0
>
>
> C:\Python26\Lib\site-packages\numpy\f2py>f2py.py -c --help-fcompiler
> Traceback (most recent call last):
>     File "C:\Python26\Scripts\f2py.py", line 24, in<module>
>       main()
>     File "C:\Python26\lib\site-packages\numpy\f2py\f2py2e.py", line 557,
> in main
>       run_compile()
>     File "C:\Python26\lib\site-packages\numpy\f2py\f2py2e.py", line 543,
> in run_compile
>       setup(ext_modules = [ext])
>     File "C:\Python26\lib\site-packages\numpy\distutils\core.py", line
> 186, in setup
>       return old_setup(**new_attr)
>     File "C:\Python26\lib\distutils\core.py", line 138, in setup
>       ok = dist.parse_command_line()
>     File "C:\Python26\lib\distutils\dist.py", line 460, in parse_command_line
>       args = self._parse_command_opts(parser, args)
>     File "C:\Python26\lib\distutils\dist.py", line 574, in
> _parse_command_opts
>       func()
>     File
> "C:\Python26\lib\site-packages\numpy\distutils\command\config_compiler.py",
> line 13, in show_fortran_compilers
>       show_fcompilers(dist)
>     File
> "C:\Python26\lib\site-packages\numpy\distutils\fcompiler\__init__.py",
> line 855, in show_fcompilers
>       c.customize(dist)
>     File
> "C:\Python26\lib\site-packages\numpy\distutils\fcompiler\__init__.py",
> line 525, in customize
>       self.set_libraries(self.get_libraries())
>     File
> "C:\Python26\lib\site-packages\numpy\distutils\fcompiler\gnu.py", line
> 306, in get_libraries
>       raise NotImplementedError("Only MS compiler supported with gfortran
> on win64")
> NotImplementedError: Only MS compiler supported with gfortran on win64
>
>
> Could someone help me to resolve this?
>
> Thanks, -- jv

I eliminated the above NotImplementedError by replacing this raise 
exception line with a pass statement.  Now, gfortran is being found and 
used by f2py but subsequently fails as follows:

gfortran.exe: error: unrecognized command line option '-mno-cygwin'


Why is f2py invoking gfortran with a cygwin option on a Windows XP 
machine?  I supposedly installed the stand-alone version of gfortran and 
my take on the f2py documentation was that cygwin was not required.  
Note, gfortran can be used from a Windows commandline to successfully 
compile the code.

Is anyone successfully using f2py and gfortran on a Windows machine 
without relying on cygwin?

I'm not committed to gfortran; I also have the Intel Visual Fortran 
compiler (ifort) installed, but so far, I have been unable to get f2py 
to acknowledge that it exists.








> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion



More information about the NumPy-Discussion mailing list