zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
U
P±dòbã@sdZddlZddlZddlZddlZddlmZddlmZddlm    Z    ddlm
Z
ddlm Z dd    lm Z dd
lm Z dd lmZdd lmZejZejZejjZejZe jZd e›de›dZdd„Zdd„Zdd„Zdd„Zdd„Zd"dd„Zdd„Zdd„Z d d!„Z!dS)#a‡
 
f2py2e - Fortran to Python C/API generator. 2nd Edition.
         See __usage__ below.
 
Copyright 1999--2011 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@cens.ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
 
NO WARRANTY IS EXPRESSED OR IMPLIED.  USE AT YOUR OWN RISK.
$Date: 2005/05/06 08:31:19 $
Pearu Peterson
 
éN)ÚPathé)Ú crackfortran)Úrules)Úcb_rules)Úauxfuncs)Úcfuncs)Ú f90mod_rules)Ú __version__)Ú    capi_mapsa‚Usage:
 
1) To construct extension module sources:
 
      f2py [<options>] <fortran files> [[[only:]||[skip:]] \
                                        <fortran functions> ] \
                                       [: <fortran files> ...]
 
2) To compile fortran files and build extension modules:
 
      f2py -c [<options>, <build_flib options>, <extra options>] <fortran files>
 
3) To generate signature files:
 
      f2py -h <filename.pyf> ...< same options as in (1) >
 
Description: This program generates a Python C/API file (<modulename>module.c)
             that contains wrappers for given fortran functions so that they
             can be called from Python. With the -c option the corresponding
             extension modules are built.
 
Options:
 
  --2d-numpy       Use numpy.f2py tool with NumPy support. [DEFAULT]
  --2d-numeric     Use f2py2e tool with Numeric support.
  --2d-numarray    Use f2py2e tool with Numarray support.
  --g3-numpy       Use 3rd generation f2py from the separate f2py package.
                   [NOT AVAILABLE YET]
 
  -h <filename>    Write signatures of the fortran routines to file <filename>
                   and exit. You can then edit <filename> and use it instead
                   of <fortran files>. If <filename>==stdout then the
                   signatures are printed to stdout.
  <fortran functions>  Names of fortran routines for which Python C/API
                   functions will be generated. Default is all that are found
                   in <fortran files>.
  <fortran files>  Paths to fortran/signature files that will be scanned for
                   <fortran functions> in order to determine their signatures.
  skip:            Ignore fortran functions that follow until `:'.
  only:            Use only fortran functions that follow until `:'.
  :                Get back to <fortran files> mode.
 
  -m <modulename>  Name of the module; f2py generates a Python/C API
                   file <modulename>module.c or extension module <modulename>.
                   Default is 'untitled'.
 
  '-include<header>'  Writes additional headers in the C wrapper, can be passed
                      multiple times, generates #include <header> each time.
 
  --[no-]lower     Do [not] lower the cases in <fortran files>. By default,
                   --lower is assumed with -h key, and --no-lower without -h key.
 
  --build-dir <dirname>  All f2py generated files are created in <dirname>.
                   Default is tempfile.mkdtemp().
 
  --overwrite-signature  Overwrite existing signature file.
 
  --[no-]latex-doc Create (or not) <modulename>module.tex.
                   Default is --no-latex-doc.
  --short-latex    Create 'incomplete' LaTeX document (without commands
                   \documentclass, \tableofcontents, and \begin{document},
                   \end{document}).
 
  --[no-]rest-doc Create (or not) <modulename>module.rst.
                   Default is --no-rest-doc.
 
  --debug-capi     Create C/API code that reports the state of the wrappers
                   during runtime. Useful for debugging.
 
  --[no-]wrap-functions    Create Fortran subroutine wrappers to Fortran 77
                   functions. --wrap-functions is default because it ensures
                   maximum portability/compiler independence.
 
  --include-paths <path1>:<path2>:...   Search include files from the given
                   directories.
 
  --help-link [..] List system resources found by system_info.py. See also
                   --link-<resource> switch below. [..] is optional list
                   of resources names. E.g. try 'f2py --help-link lapack_opt'.
 
  --f2cmap <filename>  Load Fortran-to-Python KIND specification from the given
                   file. Default: .f2py_f2cmap in current directory.
 
  --quiet          Run quietly.
  --verbose        Run with extra verbosity.
  --skip-empty-wrappers   Only generate wrapper files when needed.
  -v               Print f2py version ID and exit.
 
 
numpy.distutils options (only effective with -c):
 
  --fcompiler=         Specify Fortran compiler type by vendor
  --compiler=          Specify C compiler type (as defined by distutils)
 
  --help-fcompiler     List available Fortran compilers and exit
  --f77exec=           Specify the path to F77 compiler
  --f90exec=           Specify the path to F90 compiler
  --f77flags=          Specify F77 compiler flags
  --f90flags=          Specify F90 compiler flags
  --opt=               Specify optimization flags
  --arch=              Specify architecture specific optimization flags
  --noopt              Compile without optimization
  --noarch             Compile without arch-dependent optimization
  --debug              Compile with debugging information
 
Extra options (only effective with -c):
 
  --link-<resource>    Link extension module with <resource> as defined
                       by numpy.distutils/system_info.py. E.g. to link
                       with optimized LAPACK libraries (vecLib on MacOSX,
                       ATLAS elsewhere), use --link-lapack_opt.
                       See also --help-link switch.
 
  -L/path/to/lib/ -l<libname>
  -D<define> -U<name>
  -I/path/to/include/
  <filename>.o <filename>.so <filename>.a
 
  Using the following macros may be required with non-gcc Fortran
  compilers:
    -DPREPEND_FORTRAN -DNO_APPEND_FORTRAN -DUPPERCASE_FORTRAN
    -DUNDERSCORE_G77
 
  When using -DF2PY_REPORT_ATEXIT, a performance report of F2PY
  interface is printed out at exit (platforms: Linux).
 
  When using -DF2PY_REPORT_ON_ARRAY_COPY=<int>, a message is
  sent to stderr whenever F2PY interface makes a copy of an
  array. Integer <int> sets the threshold for array sizes when
  a message should be shown.
 
Version:     z
numpy Version: zñ
Requires:    Python 3.5 or higher.
License:     NumPy license (see LICENSE.txt in the NumPy source code)
Copyright 1999 - 2011 Pearu Peterson all rights reserved.
https://web.archive.org/web/20140822061353/http://cens.ioc.ee/projects/f2py2ec Cs2ggggf\}}}}d\    }}}}}    }
} } } d}d}d}d}d}d}d}g}d\}}|dddœ}|D]Œ}|d    krrqb|d
kr€d}qb|d krŽd}qb|d krœd}qb|dd …dkrÀ| |d d…¡qb|dkrÎd}qb|dkrÜd}    qb|dkrêd}qb|dkrúd}qb|dkr|d7}qb|dkrd}qb|dkr.d}qb|dkr>d}qb|dkrNd}qb|dkr^d}qb|dkrnd}qb|dkr‚d|d<qb|dkr’d} qb|dkr¢d} qb|dkr²d} qb|dkrÆd|d <qb|d!krÖd}qb|d"kræd}qb|dd#…d$kr
ttƒt ¡qb|d%krd}qb|dd …d&krdtjd' |d(d…¡d)|d d…tj|d(d…<qb|dd*…d+kr„td,ƒd}
qb|dd*…d-krœd}
qb|d.kr¬d/}qb|dd0krÔt    d1t
|ƒƒt ¡qb|räd}|}qb|rôd}|}qb|    rd}    |}qb|
r"d}
|  |  t j¡¡qb| r6d} ||d2<qb| rJd} ||d3<qb| r^d} ||d4<qb|dkrÈz"t|ƒW5QRX| |¡Wn:tk
rÄ}zt    d5|›d6|›d7ƒW5d}~XYnXqb|dkrÞ| |¡qb|dkrb| |¡qb|s|s|sttƒt ¡t j |¡s>|s4td8|ƒt  |¡|rRt j ||¡}|r„t j |¡r„d |kr„t    d9|ƒt ¡||d:<||d;<||d<<|dkr¶|s¶d|d=<n||d=<|rÌ||d><|rÚ||d?<|rè||d@<|rö||dA<||dB<||dC<||dD<||dE<||dF<| d4d¡||fS)GN)    rrrrrrrrrrTéÿÿÿÿrÚ.)NN)Ú    buildpathÚcoutputÚf2py_wrapper_outputÚúonly:úskip:ú:éz--debug-z--lowerú --build-dirz
--no-lowerú--quietz    --verbosez --latex-docz--no-latex-docz
--rest-docz --no-rest-docz--wrap-functionsz--no-wrap-functionsz --short-latexZ
shortlatexz    --coutputz--f2py-wrapper-outputú--f2cmapz--overwrite-signaturez h-overwritez-hú-méz-vz--show-compilersz-includeÚ userincludesé    z    #include éú--include_pathszHf2py option --include_paths is deprecated, use --include-paths instead.
ú--include-pathsz--skip-empty-wrappersFú-zUnknown option %s
rrÚ f2cmap_filez    OSError: z. Skipping file "z".
zCreating build directory %s
zFSignature file "%s" exists!!! Use --overwrite-signature to overwrite.
ÚemptygenÚdebugÚverboseúdo-lowerÚmoduleÚ    signsfileÚ    onlyfuncsÚ    skipfuncsÚ
dolatexdocÚ    dorestdocÚ    wrapfuncsrÚ include_paths)ÚappendÚprintÚ f2py_versionÚsysÚexitrZoutneedsrÚoutmessÚerrmessÚreprÚextendÚsplitÚosÚpathsepÚopenÚOSErrorÚ    __usage__ÚpathÚisdirÚmkdirÚjoinÚisfileÚ
setdefault)Z    inputlineÚfilesr)r(r#ÚfÚf2Zf3Zf5Zf6Zf7Zf8Zf9Zf10r$r"Zdolcr*r+r,rr-r'Ú
modulenameÚoptionsÚlZdetail©rIúHd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\numpy/f2py/f2py2e.pyÚ scaninputline³s*þ
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 ÿ
 
 
 
 
 
 
 
*
 
ÿ
 rKc    Csh|t_|dt_|dt_d|kr,|dt_d|kr>|dt_d|krP|dt_|dtjdd…<|dt_    t |¡}d|krÞt
d    |dƒt  |¡}|dd
d…d krºt j  |¡n$t|dd ƒ}| |¡W5QRX|d dkr|D]}d|d|d <qðn|D]}|d |d <q |ddkrL|D]}d|d|d<q2n|D]}|d|d<qP|S)Nr#r$r&r)r(r-r%r'zSaving signatures to file "%s"
iúÿÿÿÚstdoutÚwrz
%smodule.cÚnamerz%s-f2pywrappers.f)rrGrr#r$Z f77modulenamer)r(r-Z dolowercaser3Z crack2fortranr1rLÚwriter:)rCrGÚpostlistZpyfrDÚmodrIrIrJÚcallcrackfortranJs<
 
 
 
 
 
 
 
rRc
    Cs^t ¡tdƒggi}}}|D]p}d|dkr@t |¡q$d|kr||d ¡D]&}||krhg||<|| |d¡qT| |¡| |d¡q$i}t||ƒD]´\}}||krÚtd|d dd„||Dƒ¡fƒq¤g}    d|kr:|d ¡D]D}||kr"||kr"|     ||     |¡¡qôtd    |›d
|›d ƒqôi||<t
||t   ||    ¡ƒq¤|S) NzBuilding modules...
Ú__user__rNÚusez+    Skipping module "%s" which is used by %s.
ú,css|]}d|VqdS)z"%s"NrI©Ú.0ÚsrIrIrJÚ    <genexpr>szbuildmodules.<locals>.<genexpr>z        Module "z" uses nonexisting "z" which will be ignored.
) rZ buildcfuncsr3rZbuildcallbacksÚkeysr.Úzipr@ÚindexÚ dict_appendrZ buildmodule)
ÚlstÚmodulesZmnamesÚisusedbyÚitemÚuÚretr&rNZumrIrIrJÚ buildmodulesns>  
ÿ
 
ÿrdcCsP| ¡D]B\}}||kr g||<t|tƒr<|||||<q|| |¡qdS©N)ÚitemsÚ
isinstanceÚlistr.)Zd_outZd_inÚkÚvrIrIrJr]‘s 
r]c
Csât ¡tj tj tj¡¡}tj |dd¡}tj |dd¡}t    |ƒ\}}|t
_ t   |d¡t||ƒ}i}|D]@}d|krp|d ¡D]&}    |    |krœg||    <||     |d¡qˆqp|D]Z}|ddkr¶d    |dkr¶|d|kr¶td
|d›d  d  d d„||dDƒ¡¡ƒq¶d|krX|ddkrTtdƒtdtj tjd¡|dfƒdS|D]:}|ddkr\d|kr€tdƒtdt|dƒƒ‚q\|dt
_|t_ |dt
_t|ƒ}
|
 ¡D]} t|
| ||dœƒqÂ|
S)au
    Equivalent to running::
 
        f2py <args>
 
    where ``<args>=string.join(<list>,' ')``, but in Python.  Unless
    ``-h`` is used, this function returns a dictionary containing
    information on generated modules and their dependencies on source
    files.
 
    You cannot build extension modules with this function, that is,
    using ``-c`` is not allowed. Use the ``compile`` command instead.
 
    Examples
    --------
    The command ``f2py -m scalar scalar.f`` can be executed from Python as
    follows.
 
    .. literalinclude:: ../../source/f2py/code/results/run_main_session.dat
        :language: python
 
    Úsrczfortranobject.hzfortranobject.cr!rTrNÚblockz python modulerSz$Skipping Makefile build for module "z" which is used by {}
rUcss|]}d|›dVqdS)ú"NrIrVrIrIrJrYÈszrun_main.<locals>.<genexpr>r'r$rzKStopping. Edit the signature file and then run f2py on the signature file: z%s %s
rNzJTip: If your original code is Fortran source then you must use -m option.
z2All blocks must be python module blocks but got %sr#r,)ZcsrcÚh)rZreset_global_f2py_varsr8r=ÚdirnameÚabspathrÚ__file__r@rKrrGr Zload_f2cmap_filerRrZr.r3ÚformatÚbasenamer1Úargvr4Ú    TypeErrorr5Z debugoptionsr    r,rdr]) Z comline_listZf2pydirZfobjhsrcZfobjcsrcrCrGrPr`ÚplistrbrcÚmnrIrIrJÚrun_main›s` 
 þÿ
ÿÿ
ÿ
ÿ
 
 
 rxc    Csvgg}}t |d|d¡j}|r0t|ƒ}nd}dd„|DƒD]*}||ƒrb| ||d…¡qB| |¡qB||fS)z,
    Filter files by prefix and suffix.
    z.*z\ZrcSsg|] }| ¡‘qSrI)Ústrip)rWÚxrIrIrJÚ
<listcomp>ìsz filter_files.<locals>.<listcomp>N)ÚreÚcompileÚmatchÚlenr.)    ÚprefixÚsuffixrCÚ remove_prefixÚfilteredÚrestr~ÚindÚfilerIrIrJÚ filter_filesâs
 
 r‡cCstj tj |j¡¡}|Sre)r8r=rorq)r&ÚprIrIrJÚ
get_prefixôsr‰c$
sŽddl}tj d¡}tj|=d}ztj d¡}Wntk
rHd}YnX|dk    rvtj|d}tj|d=tj|=n d}| ¡}t d¡‰‡fdd„tjdd…Dƒ‰
‡
fd    d„tjDƒt_ˆ
rÐd
d„ˆ
Dƒ‰
t d ¡‰‡fd d„tjdd…Dƒ‰‡fd d„tjDƒt_g‰d}tjdd…D]>}|dkr6d}n|dkrDd}|sT|dkr"ˆ |¡q"ˆr€ˆddkr€ˆ d¡ˆ     ˆ¡‡fdd„tjDƒt_t d¡‰‡fdd„tjdd…Dƒ‰‡fdd„tjDƒt_t d¡‰‡fdd„tjdd…Dƒ‰‡fdd„tjDƒt_g}ˆD]Ð}d}|dt
|ƒ…|kr ddl m }    |      ¡t|    j ¡ƒ}
|t
|ƒd… ¡} } | |
krÔi} z | | } Wn<tk
rÎ| |  ¡krÊtd|t
|ƒd…ƒYnX| } ˆ |¡}d| ˆ|<q q |D]}ˆ |¡}ˆ|=qöt
ˆƒdks(ttˆƒƒ‚t d¡‰‡fdd„tjdd…Dƒ‰    ‡    fdd„tjDƒt_dˆkrxˆ     d¡d }tjdd…}d!D]X}|tjkrŽtj |¡}ˆ     tj||d…¡tj|d=tj|=tjdd…}qŽd"tjkr2tj d"¡}tj|d}tj|d=tj|=tjdd…}nDdd#lm}td$d%|ƒ\}}||}|D]}||ƒ}|rZqvqZtd$d&|ƒ\}}td'd$|dd(\}}td)d$|dd(\}}td*d$|dd(\}}td+d$|dd(\}}td,d$|dd(\}}tt
|ƒƒD]T}|| d-d¡}t
|ƒdkr"| d¡t
|ƒdkr>t|ƒ||<n
td.|ƒqödd/lm}i}|rt|     | d0g¡¡dd1l m!}m"}||||||||ˆd2œ    }ˆ
rädd3l#m$} ˆ
D]0}!||!ƒ}|sÔt%d4t|!ƒƒ| |f|ސq²|f|Ž}"tjdgˆ    t_tj     d5d6|d7|d8d9d:g¡ˆr4tj     d;gˆ¡ˆrLtj     d<gˆ¡||"gd=|rŠt&j' (|¡rŠddl)}#t%d>|ƒ|# *|¡dS)?z 
    Do it all in one call!
    rNú-crrz--link-csg|]}ˆ |¡r|‘qSrI©r~©rWÚ_m)Ú_reg1rIrJr{s
zrun_compile.<locals>.<listcomp>csg|]}|ˆkr|‘qSrIrIrŒ)Ú sysinfo_flagsrIrJr{scSsg|]}|dd…‘qS)éNrI)rWrDrIrIrJr{szN--((no-|)(wrap-functions|lower)|debug-capi|quiet|skip-empty-wrappers)|-includecsg|]}ˆ |¡r|‘qSrIr‹rŒ)Ú_reg2rIrJr{s
csg|]}|ˆkr|‘qSrIrIrŒ)Ú
f2py_flagsrIrJr{s)rrrr csg|]}|ˆkr|‘qSrIrIrŒ)Ú f2py_flags2rIrJr{&sz4--((f(90)?compiler(-exec|)|compiler)=|help-compiler)csg|]}ˆ |¡r|‘qSrIr‹rŒ)Ú_reg3rIrJr{)s
csg|]}|ˆkr|‘qSrIrIrŒ)Ú
flib_flagsrIrJr{*szH--((f(77|90)(flags|exec)|opt|arch)=|(debug|noopt|noarch|help-fcompiler))csg|]}ˆ |¡r|‘qSrIr‹rŒ)Ú_reg4rIrJr{-s
csg|]}|ˆkr|‘qSrIrIrŒ)Úfc_flagsrIrJr{.sz --fcompiler=)Ú    fcompilerzUnknown vendor: "%s"rz --(verbose)csg|]}ˆ |¡r|‘qSrIr‹rŒ)Ú_reg5rIrJr{Is
csg|]}|ˆkr|‘qSrIrIrŒ)Ú setup_flagsrIrJr{JsrZuntitled)rrrr)Úget_f2py_modulenamerz[.]pyf([.]src|)z[.](o|a|so|dylib)z-I)r‚z-Lz-lz-Uz-Dú=zInvalid use of -D:)Úget_infoÚ include_dirs)ÚsetupÚ    Extension)    rNÚsourcesržÚ library_dirsÚ    librariesÚ define_macrosÚ undef_macrosÚ extra_objectsZ f2py_options)r]z9No %s resources found in system (try `f2py --help-link`)
Úbuildz --build-tempz --build-basez--build-platlibr z--disable-optimizationZ    config_fcÚ    build_ext)Ú ext_moduleszRemoving build directory %s
)+Útempfiler1rtr\Ú
ValueErrorÚmkdtempr|r}r.r6rZnumpy.distutilsr˜Zload_all_fcompiler_classesrhZfcompiler_classrZÚlowerÚKeyErrorÚvaluesr/ÚAssertionErrorr5Z!numpy.distutils.command.build_srcr›r‡Úranger7ÚtupleÚnumpy.distutils.system_inforÚgetZnumpy.distutils.corerŸr Znumpy.distutils.misc_utilr]r3r8r=ÚexistsÚshutilÚrmtree)$rªÚiZremove_build_dirÚ    build_dirÚflÚaZdel_listrXrjr˜Z allowed_keysÚnvÚovZvmaprFr¡Úoptnamer›Z    pyf_filesrDr¦ržr¢r£r¥r¤Ú
name_valuerZnum_inforŸr Zext_argsr]ÚnÚextr¶rI) rŽr‘r”r–r™r’r“r—r•ršrrJÚ run_compileùs. 
 
 
ÿ
 
 
 
ÿÿ 
 
 
 
 
 
 
 
 
 ù
 ÿ
û  rÂcCsúdtjdd…kr4tj d¡ddlm}|ƒdSdtjdd…kr^tj d¡t d¡nldtjdd…kr~tj d¡nLdtjdd…krªtj d    ¡tj d¡n d
tjdd…krÊtj d
¡nd tjdd…krät    ƒnt
tjdd…ƒdS) Nz --help-linkrr©Úshow_allz
--g3-numpyz*G3 f2py support is not implemented, yet.\nz --2e-numericz --2e-numarrayz
-DNUMARRAYz
--2e-numpyrŠ) r1rtÚremover³rÄÚstderrrOr2r.rÂrxrÃrIrIrJÚmain¥s$     rÇ)N)"Ú__doc__r1r8Úpprintr|Úpathlibrrrrrrrr    r
r Úversionr0Z numpy_versionrÆrOr4Úshowr3r<rKrRrdr]rxr‡r‰rÂrÇrIrIrIrJÚ<module>sP         €ý€üÿ $#
G
-