diff options
-rw-r--r-- | doc/source/f2py/getting-started.rst | 10 | ||||
-rw-r--r-- | doc/source/f2py/usage.rst | 14 |
2 files changed, 18 insertions, 6 deletions
diff --git a/doc/source/f2py/getting-started.rst b/doc/source/f2py/getting-started.rst index fffd61c45..0eee494cb 100644 --- a/doc/source/f2py/getting-started.rst +++ b/doc/source/f2py/getting-started.rst @@ -45,9 +45,9 @@ to run :: - f2py -c fib1.f -m fib1 + python -mnumpy.f2py -c fib1.f -m fib1 -This command builds (see ``-c`` flag, execute ``f2py`` without +This command builds (see ``-c`` flag, execute ``python -mnumpy.f2py`` without arguments to see the explanation of command line options) an extension module ``fib1.so`` (see ``-m`` flag) to the current directory. Now, in Python the Fortran subroutine ``FIB`` is accessible via ``fib1.fib``:: @@ -162,7 +162,7 @@ one. :: - f2py fib1.f -m fib2 -h fib1.pyf + python -mnumpy.f2py fib1.f -m fib2 -h fib1.pyf The signature file is saved to ``fib1.pyf`` (see ``-h`` flag) and its contents is shown below. @@ -188,7 +188,7 @@ one. :: - f2py -c fib2.pyf fib1.f + python -mnumpy.f2py -c fib2.pyf fib1.f In Python:: @@ -243,7 +243,7 @@ __ fib3.f Building the extension module can be now carried out in one command:: - f2py -c -m fib3 fib3.f + python -mnumpy.f2py -c -m fib3 fib3.f Notice that the resulting wrapper to ``FIB`` is as "smart" as in previous case:: diff --git a/doc/source/f2py/usage.rst b/doc/source/f2py/usage.rst index a6f093154..3f8a6a063 100644 --- a/doc/source/f2py/usage.rst +++ b/doc/source/f2py/usage.rst @@ -3,7 +3,19 @@ Using F2PY =========== F2PY can be used either as a command line tool ``f2py`` or as a Python -module ``f2py2e``. +module ``f2py2e``. While we try to install the command line tool as part +of the numpy setup, some platforms like Windows make it difficult to +reliably put the executable on the ``PATH``. We will refer to ``f2py`` +in this document but you may have to run it as + +``` +python -mnumpy.f2py +``` + +If you run ``f2py`` with no arguments, and the line ``numpy Version`` at the +end matches the NumPy version printed from ``python -mnumpy.f2py``, then you +can use the shorter version. If not, or if you cannot run ``f2py``, you should +replace all calls to ``f2py`` here with the longer version. Command ``f2py`` ================= |