@@ -31,6 +31,9 @@ To scan Fortran sources and generate a signature file, use
31
31
either specify which routines should be wrapped (in the ``only: .. : `` part)
32
32
or which routines F2PY should ignore (in the ``skip: .. : `` part).
33
33
34
+ F2PY has no concept of a "per-file" ``skip `` or ``only `` list, so if functions
35
+ are listed in ``only ``, no other functions will be taken from any other files.
36
+
34
37
If ``<filename.pyf> `` is specified as ``stdout ``, then signatures are written to
35
38
standard output instead of a file.
36
39
@@ -115,36 +118,31 @@ finally all object and library files are linked to the extension module
115
118
If ``<fortran files> `` does not contain a signature file, then an extension
116
119
module is constructed by scanning all Fortran source codes for routine
117
120
signatures, before proceeding to build the extension module.
118
-
119
- Among other options (see below) and options described for previous modes, the
120
- following options can be used in this mode:
121
-
122
- ``--help-fcompiler ``
123
-
8000
List the available Fortran compilers.
124
- ``--help-compiler `` **[depreciated] **
125
- List the available Fortran compilers.
126
- ``--fcompiler=<Vendor> ``
127
- Specify a Fortran compiler type by vendor.
128
- ``--f77exec=<path> ``
129
- Specify the path to a F77 compiler
130
- ``--fcompiler-exec=<path> `` **[depreciated] **
131
- Specify the path to a F77 compiler
132
- ``--f90exec=<path> ``
133
- Specify the path to a F90 compiler
134
- ``--f90compiler-exec=<path> `` **[depreciated] **
135
- Specify the path to a F90 compiler
121
+
122
+ .. warning ::
123
+ From Python 3.12 onwards, ``distutils `` has been removed. Use
124
+ environment variables to interact with ``meson `` instead. See its
125
+ `FAQ <https://mesonbuild.com/howtox.html >`__ for more information.
126
+
127
+ Among other options (see below) and options described for previous modes, the following can be used.
128
+
129
+ .. note ::
130
+
131
+ .. versionchanged :: 1.26.0
132
+ There are now two separate build backends which can be used, ``distutils ``
133
+ and ``meson ``. Users are **strongly ** recommended to switch to ``meson ``
134
+ since it is the default above Python ``3.12 ``.
135
+
136
+ Common build flags:
137
+
138
+ ``--backend <backend_type> ``
139
+ Specify the build backend for the compilation process. The supported backends
140
+ are ``meson `` and ``distutils ``. If not specified, defaults to ``distutils ``.
141
+ On Python 3.12 or higher, the default is ``meson ``.
136
142
``--f77flags=<string> ``
137
143
Specify F77 compiler flags
138
144
``--f90flags=<string> ``
139
145
Specify F90 compiler flags
140
- ``--opt=<string> ``
141
- Specify optimization flags
142
- ``--arch=<string> ``
143
- Specify architecture specific optimization flags
144
- ``--noopt ``
145
- Compile without optimization flags
146
- ``--noarch ``
147
- Compile without arch-dependent optimization flags
148
146
``--debug ``
149
147
Compile with debugging information
150
148
``-l<libname> ``
@@ -159,13 +157,41 @@ following options can be used in this mode:
159
157
``-L<dir> ``
160
158
Add directory ``<dir> `` to the list of directories to be searched for
161
159
``-l ``.
162
- ``link-<resource> ``
160
+
161
+ The ``meson `` specific flags are:
162
+
163
+ ``--dep <dependency> `` **meson only **
164
+ Specify a meson dependency for the module. This may be passed multiple times
165
+ for multiple dependencies. Dependencies are stored in a list for further
166
+ processing. Example: ``--dep lapack --dep scalapack `` This will identify
167
+ "lapack" and "scalapack" as dependencies and remove them from argv, leaving a
168
+ dependencies list containing ["lapack", "scalapack"].
169
+
170
+ The older ``distutils `` flags are:
171
+
172
+ ``--help-fcompiler `` **no meson **
173
+ List the available Fortran compilers.
174
+ ``--fcompiler=<Vendor> `` **no meson **
175
+ Specify a Fortran compiler type by vendor.
176
+ ``--f77exec=<path> `` **no meson **
177
+ Specify the path to a F77 compiler
178
+ ``--f90exec=<path> `` **no meson **
179
+ Specify the path to a F90 compiler
180
+ ``--opt=<string> `` **no meson **
181
+ Specify optimization flags
182
+ ``--arch=<string> `` **no meson **
183
+ Specify architecture specific optimization flags
184
+ ``--noopt `` **no meson **
185
+ Compile without optimization flags
186
+ ``--noarch `` **no meson **
187
+ Compile without arch-dependent optimization flags
188
+ ``link-<resource> `` **no meson **
163
189
Link the extension module with <resource> as defined by
164
190
``numpy_distutils/system_info.py ``. E.g. to link with optimized LAPACK
165
191
libraries (vecLib on MacOSX, ATLAS elsewhere), use ``--link-lapack_opt ``.
166
192
See also ``--help-link `` switch.
167
193
168
- .. note ::
194
+ .. note ::
169
195
170
196
The ``f2py -c `` option must be applied either to an existing ``.pyf `` file
171
197
(plus the source/object/library files) or one must specify the
@@ -215,6 +241,9 @@ Other options
215
241
216
242
.. warning :: Don't use this option if a signature file (``*.pyf``) is used.
217
243
244
+ .. versionchanged :: 2.0.0
245
+ Will ignore ``-m `` if a ``pyf `` file is provided.
246
+
218
247
``--[no-]lower ``
219
248
Do [not] lower the cases in ``<fortran files> ``. By default, ``--lower `` is
220
249
assumed with ``-h `` switch, and ``--no-lower `` without the ``-h `` switch.
0 commit comments