summaryrefslogtreecommitdiff
path: root/doc/source/f2py/distutils.rst
diff options
context:
space:
mode:
Diffstat (limited to 'doc/source/f2py/distutils.rst')
-rw-r--r--doc/source/f2py/distutils.rst39
1 files changed, 21 insertions, 18 deletions
diff --git a/doc/source/f2py/distutils.rst b/doc/source/f2py/distutils.rst
index 4cf30045e..2c3c2184f 100644
--- a/doc/source/f2py/distutils.rst
+++ b/doc/source/f2py/distutils.rst
@@ -4,16 +4,17 @@ Using via `numpy.distutils`
.. currentmodule:: numpy.distutils.core
-:mod:`numpy.distutils` is part of NumPy extending standard Python ``distutils``
-to deal with Fortran sources and F2PY signature files, e.g. compile Fortran
-sources, call F2PY to construct extension modules, etc.
+:mod:`numpy.distutils` is part of NumPy, and extends the standard Python
+``distutils`` module to deal with Fortran sources and F2PY signature files, e.g.
+compile Fortran sources, call F2PY to construct extension modules, etc.
.. topic:: Example
- Consider the following `setup file`__:
+ Consider the following `setup file`__ for the ``fib`` examples in the previous
+ section:
- .. include:: setup_example.py
- :literal:
+ .. literalinclude:: ./code/setup_example.py
+ :language: python
Running
@@ -26,30 +27,32 @@ sources, call F2PY to construct extension modules, etc.
__ setup_example.py
+Extensions to ``distutils``
+===========================
+
:mod:`numpy.distutils` extends ``distutils`` with the following features:
* :class:`Extension` class argument ``sources`` may contain Fortran source
files. In addition, the list ``sources`` may contain at most one
- F2PY signature file, and then the name of an Extension module must
- match with the ``<modulename>`` used in signature file. It is
+ F2PY signature file, and in this case, the name of an Extension module must
+ match with the ``<modulename>`` used in signature file. It is
assumed that an F2PY signature file contains exactly one ``python
module`` block.
- If ``sources`` does not contain a signature files, then F2PY is used
- to scan Fortran source files for routine signatures to construct the
- wrappers to Fortran codes.
+ If ``sources`` do not contain a signature file, then F2PY is used to scan
+ Fortran source files to construct wrappers to the Fortran codes.
- Additional options to F2PY process can be given using :class:`Extension`
- class argument ``f2py_options``.
+ Additional options to the F2PY executable can be given using the
+ :class:`Extension` class argument ``f2py_options``.
* The following new ``distutils`` commands are defined:
``build_src``
to construct Fortran wrapper extension modules, among many other things.
``config_fc``
- to change Fortran compiler options
+ to change Fortran compiler options.
- as well as ``build_ext`` and ``build_clib`` commands are enhanced
+ Additionally, the ``build_ext`` and ``build_clib`` commands are also enhanced
to support Fortran sources.
Run
@@ -60,14 +63,14 @@ sources, call F2PY to construct extension modules, etc.
to see available options for these commands.
-* When building Python packages containing Fortran sources, then one
- can choose different Fortran compilers by using ``build_ext``
+* When building Python packages containing Fortran sources, one
+ can choose different Fortran compilers by using the ``build_ext``
command option ``--fcompiler=<Vendor>``. Here ``<Vendor>`` can be one of the
following names::
absoft sun mips intel intelv intele intelev nag compaq compaqv gnu vast pg hpux
- See ``numpy_distutils/fcompiler.py`` for up-to-date list of
+ See ``numpy_distutils/fcompiler.py`` for an up-to-date list of
supported compilers or run
::