0

I have been trying out the F2PY tool of NumPy, which enables interfacing between Python and Fortran. I have been getting results with F2PY which are contrary to the documentation (https://docs.scipy.org/doc/numpy-dev/f2py/).

Specifically, running

f2py -c --help-fcompiler

should give list all compatible Fortran compilers that are installed. Instead, it gives the error:

NameError: name 'c' is not defined.

According to the documentation, -c is one of the key switches within F2PY and so it seems aberrant that the command is not working.

I've tried this using Python 2.7 and the Ipython shell on two separate computers, and am getting the same results.

Rob M
  • 11
  • 2

1 Answers1

3

That command is for the terminal, not for the python interpreter. In gnome-terminal using bash in Ubuntu, i get the expected result:

$ f2py -c --help-fcompiler
Gnu95FCompiler instance properties:
  archiver        = ['/usr/bin/gfortran', '-cr']
  compile_switch  = '-c'
  ... etc
Jonatan Öström
  • 2,428
  • 1
  • 16
  • 27