bg2`0dZddlZddlZddlZddlZddlmZddlmZddlm Z ddlm Z ddlm Z dd lm Z dd lm Z dd lmZdd lmZejZejZejjZejZe jZd ededZdZdZdZdZdZddZdZdZ dZ!dS)a f2py2e - Fortran to Python C/API generator. 2nd Edition. See __usage__ below. Copyright 1999--2011 Pearu Peterson all rights reserved, Pearu Peterson 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_mapsaUsage: 1) To construct extension module sources: f2py [] [[[only:]||[skip:]] \ ] \ [: ...] 2) To compile fortran files and build extension modules: f2py -c [, , ] 3) To generate signature files: f2py -h ...< same options as in (1) > Description: This program generates a Python C/API file (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 Write signatures of the fortran routines to file and exit. You can then edit and use it instead of . If ==stdout then the signatures are printed to stdout. Names of fortran routines for which Python C/API functions will be generated. Default is all that are found in . Paths to fortran/signature files that will be scanned for in order to determine their signatures. skip: Ignore fortran functions that follow until `:'. only: Use only fortran functions that follow until `:'. : Get back to mode. -m Name of the module; f2py generates a Python/C API file module.c or extension module . Default is 'untitled'. '-include
' Writes additional headers in the C wrapper, can be passed multiple times, generates #include
each time. --[no-]lower Do [not] lower the cases in . By default, --lower is assumed with -h key, and --no-lower without -h key. --build-dir All f2py generated files are created in . Default is tempfile.mkdtemp(). --overwrite-signature Overwrite existing signature file. --[no-]latex-doc Create (or not) 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) 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 ::... Search include files from the given directories. --help-link [..] List system resources found by system_info.py. See also --link- switch below. [..] is optional list of resources names. E.g. try 'f2py --help-link lapack_opt'. --f2cmap 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- Link extension module with 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 -D -U -I/path/to/include/ .o .so .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=, a message is sent to stderr whenever F2PY interface makes a copy of an array. Integer 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 t ggggf\}}}}d\ }}}}} } } } } d}d}d}d}d}d}d}g}d\}}|ddd}|D]2}|d kr |d krd}|d krd}|d krd}%|dd dkr||d dQ|dkrd}Z|dkrd} c|dkrd}l|dkrd}u|dkr|dz }|dkrd}|dkrd}|dkrd}|dkrd}|dkrd}|dkrd}|dkrd|d<|dkrd} |dkrd} |dkrd} |dkrd|d <|d!krd}|d"krd}|dd#d$kr)tttj3|d%krd}=|dd d&krQt jd'|d(dd)|d dzt j|d(d<|dd*d+vrtd,d} |dd*d-vrd} |d.krd/}|dd0kr4td1t|ztj|rd}|}|rd}|}%| rd} |}-| r6d} | | tje| r d} ||d2<p| r d} ||d3<{| r d} ||d4<|dkrn t|5 dddn #1swxYwY||#t $r!}td5|d6|d7Yd}~d}~wwxYw|dkr|||dkr||4|s+|s)|s'tt"tjtj|s(|std8|ztj||r tj||}|rHtj|r)d |vr%td9|ztj||d:<||d;<||d<<|dkr|sd|d=<n||d=<|r||d><|r||d?<|r||d@<|r||dA<||dB<||dC<||dD<||dE<||dF<|d4d||fS)GN) rrrrrrrrrrTr.)NN) buildpathcoutputf2py_wrapper_outputonly: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-latex shortlatexz --coutputz--f2py-wrapper-output--f2cmapz--overwrite-signaturez h-overwritez-h-mz-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. emptygendebugverbosedo-lowermodule signsfile onlyfuncs skipfuncs dolatexdoc dorestdoc wrapfuncsr include_paths)appendprint f2py_versionsysexitr outneedsroutmesserrmessreprextendsplitospathsepopenOSError __usage__pathisdirmkdirjoinisfile setdefault) inputlinefilesr,r+r&ff2f3f5f6f7f8f9f10r'r%dolcr-r.r/rr0r* modulenameoptionsldetails d/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib64/python3.11/site-packages/numpy/f2py/f2py2e.py scaninputlinerXs)+RR&E9i)B&Ar2r2r2r3GH DJIIIM&Iz%&*,,Ga a  77  '\\AA '\\AA #XXAA rrUj LL122     )^^DD -  BB ,  DD )^^GG +   qLGG -  JJ " " "JJ ,  II / ! !II $ $ $II ' ' 'II / ! !$%GL ! ! +  BB ) ) )BB *__CC ) ) )%&GM " " $YYBB $YYBB rrUd]] ,    HJJJJ $ $ $BB rrUj ON + 2 21QrT7 ; ; ;+6122+>F !B$ ( ( ssV( ( ( [ ] ] ]BB ssV( ( (BB ) ) )HH qTS[[ )DGG3 4 4 4 HJJJJ  BII  BJJ  BII  B  !4!4 5 5 5 5  B!"GI    B-.G) * *  C%&GM " " !VV J!WW Q J J JHFHHqHHHIIIIIIII J "WW   Q     !VV   Q    eJ i  7== # # C 3yA B B B 7GLLI66 RW^^I..=3O3O UYb c e e e  "GJGG GI rzz)z " '&)( )( )( &GL$GK$GK$GK,GO }d+++ '>s<LK LK# #L&K# 'L L, L''L,cb|t_|dt_|dt_d|vr|dt_d|vr|dt_d|vr|dt_|dtjdd<|dt_ tj|}d|vrtd |dztj |}|dd dd kr tj |nCt|dd 5}||dddn #1swxYwY|d |D]}d|dz|d <n|D] }|d |d <|d|D]}d|dz|d<n|D] }|d|d<|S)Nr&r'r)r,r+r0r(r*zSaving signatures to file "%s" istdoutwrz %smodule.cnamerz%s-f2pywrappers.f)rrTrr&r' f77modulenamer,r+r0 dolowercaser7 crack2fortranr4rZwriter>)rHrTpostlistpyfrImods rWcallcrackfortranrdJs4EM )L"9-L7%,X%6 "g!(!5 g!(!5 $+O$zbuildmodules..s&BBavzBBBBBBz. z Module "z" uses nonexisting "z" which will be ignored. ) r buildcfuncsr7rbuildcallbackskeysr1ziprDindex dict_appendr buildmodule) lstmodulesmnamesisusedbyitemuretr)r\ums rW buildmodulesrns6  #$$$ "BXVG ( ( f % %  #D ) ) ) )}}e))++55A((&( QK&&tF|4444 NN4 MM$v, ' ' ' ' CGV,,BB  8   GchhBB8D>BBBBBBBD E E E EB++--88AH}}f '&,,q//":;;;;77717778888CI D 5#4VR#@#@ A A A A Jroc|D]M\}}||vrg||<t|tr|||z||<2|||NdSN)items isinstancelistr1)d_outd_inkvs rWrurusw**,,A E>>E!H a   Qx!|E!HH !HOOA     roc tjtjtjt j}tj|dd}tj|dd}t|\}}|t_ tj |dt||}i}|D]M}d|vrG|dD],} | |vrg|| <|| |d-N|D]w}|ddkrid |dvr_|d|vrUt#d |dd d d ||dDxd|vre|ddkrWt#dt#tjt(jdd|dddS|D]F}|ddkr8d|vrt-dt/dt1|dzG|dt_|t4_ |dt_t9|} | D]} t;| | ||d| S)au Equivalent to running:: f2py where ``=string.join(,' ')``, 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$rgr\blockz python modulerfz$Skipping Makefile build for module "z" which is used by {} rhc3"K|] }d|dV dS)"Nrjrks rWrnzrun_main..s* K KaQ K K K K K Kror*r'rzKStopping. Edit the signature file and then run f2py on the signature file: r  NzJTip: If your original code is Fortran source then you must use -m option. z2All blocks must be python module blocks but got %sr&r/)csrch)rreset_global_f2py_varsr<rAdirnameabspathr __file__rDrXrrTr load_f2cmap_filerdrrr1r7formatbasenamer4argvr8 TypeErrorr9 debugoptionsr r/rru) comline_listf2pydirfobjhsrcfobjcsrcrHrTrarzplistr|r}mns rWrun_mainrs.')))goobgoofo>>??Gw||GU,=>>Hw||GU,=>>H"<00NE7H w}5666w//HH22 E>>5\&&(( 2 2H$$"$HQK ""5=1111NN >_ , ,uV}1L1LV}((,5=,,,,2F K K8E&M3J K K KKK-M-MNNNg 9  ! ! ] _ _ _ W%%chqk2222GK4H4H4HJ K K K'' >_ , ,g--acccPU7^$$&'' ' - $G,H"L -H x Chhjj@@CGhX>>???? Jrocgg}}tj|dz|zdzj}|rt|}nd}d|DD]@}||r|||d+||A||fS)z, Filter files by prefix and suffix. z.*z\Zrc6g|]}|Srj)strip)rlxs rW z filter_files..s ***q***roN)recompilematchlenr1) prefixsuffixrH remove_prefixfilteredrestrindfiles rW filter_filesrsdH Jv~.6 7 7 =E&kk**E*** 5;;  OODJ ' ' ' ' KK     T>roctjtj|j}|Sr)r<rArr)r)ps rW get_prefixrs* 8899A Hroc $%&'()*+,-.ddl}tjd}tj|=d} tjd}n#t$rd}YnwxYw|3tj|dz}tj|dz=tj|=nd}|}t jd$$fdtjddD..fdtjDt_.r d .D.t jd %%fd tjddD))fd tjDt_g*d}tjddD].}|d vrd}n|dkrd}|s|dkr*|/*r!*ddkr*d) **fdtjDt_t jd&&fdtjddD,,fdtjDt_t jd''fdtjddD++fdtjDt_g},D] }d}|dt||krddl m } | t| j} |t|dx} } | | vr[i} | | } nM#t$$r@| | vr't)d|t|dzYnwxYw| } ,|}d| z,|<  |D]},|},|=t,dksJt+,t jd((fdtjddD--fdtjDt_d)vr-dd}tjdd}d D]}|tjvrztj|}) tj||dztj|dz=tj|=tjdd}d!tjvrftjd!}tj|dz}tj|dz=tj|=tjdd}n3dd"lm}t1d#d$|\}}||z}|D]}||}|rnt1d#d%|\}}t1d&d#|d'\}}t1d(d#|d'\}}t1d)d#|d'\}}t1d*d#|d'\}}t1d+d#|d'\}}t3t|D]|}||d,d}t|dkr|dt|dkrt7|||<lt)d-|}dd.lm}i}|r)| |d/gdd0lm }m!}||||||||)d1 }.r@dd2l"m#} .D]7}!||!}|stId3t+|!z| |fi|8|d>i|}"tjdg-zt_tj d4d5|d6|d7d8d9g+r#tj d:g+z,r#tj d;g,z||"g<|rLtJj&'|r/ddl(}#tId=|z|#)|dSdSdS)?z Do it all in one call! rN-crrz--link-c>g|]}||Srjr)rl_m_reg1s rWrzrun_compile..s(BBBB%++b//BRBBBrocg|]}|v| Srjrj)rlr sysinfo_flagss rWrzrun_compile..s#AAAr=)@)@)@)@)@roc"g|] }|dd S)Nrj)rlrIs rWrzrun_compile..s 6661122666rozN--((no-|)(wrap-functions|lower)|debug-capi|quiet|skip-empty-wrappers)|-includec>g|]}||Srjr)rlr_reg2s rWrzrun_compile..(???u{{2?"???rocg|]}|v| Srjrj)rlr f2py_flagss rWrzrun_compile..#>>>r:)=)=)=)=)=ro)rrrrcg|]}|v| Srjrj)rlr f2py_flags2s rWrzrun_compile..&#???r;)>)>)>)>)>roz4--((f(90)?compiler(-exec|)|compiler)=|help-compiler)c>g|]}||Srjr)rlr_reg3s rWrzrun_compile..)rrocg|]}|v| Srjrj)rlr flib_flagss rWrzrun_compile..*rrozH--((f(77|90)(flags|exec)|opt|arch)=|(debug|noopt|noarch|help-fcompiler))c>g|]}||Srjr)rlr_reg4s rWrzrun_compile..-s(===rU[[__====rocg|]}|v| Srjrj)rlrfc_flagss rWrzrun_compile...s#<<g|]}||Srjr)rlr_reg5s rWrzrun_compile..Is(@@@" B@2@@@rocg|]}|v| Srjrj)rlr setup_flagss rWrzrun_compile..Jrroruntitled)r!r"rr)get_f2py_modulenamerz[.]pyf([.]src|)z[.](o|a|so|dylib)z-I)rz-Lz-lz-Uz-D=zInvalid use of -D:)get_info include_dirs)setup Extension) r\sourcesr library_dirs libraries define_macros undef_macros extra_objects f2py_options)ruz9No %s resources found in system (try `f2py --help-link`) buildz --build-tempz --build-basez--build-platlibrz--disable-optimization config_fc build_ext) ext_moduleszRemoving build directory %s rj)*tempfiler4rrt ValueErrormkdtemprrr1r:rnumpy.distutilsrload_all_fcompiler_classesrfcompiler_classrrlowerKeyErrorvaluesr2r9!numpy.distutils.command.build_srcrrranger;tuplenumpy.distutils.system_inforgetnumpy.distutils.corerrnumpy.distutils.misc_utilrur7r<rAexistsshutilrmtree)/riremove_build_dir build_dirfladel_listrmrr allowed_keysnvovvmaprSroptnamer pyf_filesrIrrrrrr name_valuernum_inforrext_argsrunextrrrrrrrrrrrrs/ @@@@@@@@@@@rW run_compiler s OOO tA   HNN= ) )  }HQUO HQUO HQKK$$&& Jz " "EBBBB#(122,BBBMAAAASXAAACH766 666 JY [ [E????sx|???J>>>>SX>>>CHK B Xabb\"" " " "BB #XXB  "c   q ! ! ! {2#--3k"""????SX???CH J? A AE????sx|???J>>>>SX>>>CH JS U UE====SXabb\===H<<< > @ @AALAj&&(( (B%%EbBBEEE..4#a&&'' CDDDE  ##A*R/JqM      Q   qMM z??a   j!1!1    J~ & &E@@@@ @@@K????SX???CHJ9%%%JhqrrlGE## ch  w''A   chqQw/ 0 0 0Q!hqrrlG sx HNN4 Xa!e_ HQUOSXa[(122,IIIIII)".?II 7g%  A,,Q//J  *".A7KKM7(r7!LLLL'(r7!LLLL'%dBqIIIIw(r7!LLLL')$G1MMMM7 3}%% & &44"1%++C33 z??a     d # # # z??a  $Z00M!   & 3 3 3 3444444H>HLL<<===55555555"w , ,&!. ,!. *H'999999 ' 'A A C69=aBCCC K & &A & & & & )  h  C }{*CHHOOW#Y#Y&- /000 2  01114  2333 Ese!BGNN955! /9=>>> i     !!!!s$A A.-A.M""AN,+N,c:dtjddvr1tjdddlm}|dSdtjddvr4tjdtjdndtjddvr tjdndtjddvr?tjd tjdn7d tjddvr tjd n d tjddvrtdSttjdddS) Nz --help-linkrrshow_allz --g3-numpyz*G3 f2py support is not implemented, yet.\nz --2e-numericz --2e-numarrayz -DNUMARRAYz --2e-numpyr) r4rremoverrstderrr`r5r1r rrs rWmainrsg $$  &&&888888 sx|## FGGG  38ABB< ' ' '''' CHQRRL ( (  %%% (((( !"" % %  %%%%  sx| !""ror)"__doc__r4r<pprintrpathlibrrrrrrr r r r versionr3 numpy_versionrr`r8showr7r@rXrdrrurrrr rrjrorWrs " # *  }  HQFGHQHQHIHQHQHQ XTTTn!!!H   FDDDN$   i!i!i!Xro