zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
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
U
O±d4ã@sšddlZddlZddlZddlZddlmZddlmZddlm    Z    ddl
m Z dgZ Gdd„deƒZ edkr–dd    lmZe  d
¡eed d  ¡ƒdS) éN)Ú    FCompiler)Úfind_executable)Úmake_temp_file)ÚlogÚ IBMFCompilerc@sheZdZdZdZdZddgdgddgdgd    gd
d gd gd œZdd„Zdd„Zdd„Z    dd„Z
dd„Z dS)rÚibmzIBM XL Fortran Compilerzo(xlf\(1\)\s*|)IBM XL Fortran ((Advanced Edition |)Version |Enterprise Edition V|for AIX, V)(?P<version>[^\s*]*)z<F77>z    -qversionÚxlfZxlf90z-qfixedZxlf95Úarz-crÚranlib)Z version_cmdZ compiler_f77Z compiler_fixZ compiler_f90Ú    linker_soÚarchiverr
c
    sþtj|f|ž|Ž}|dkr˜tj d¡r˜tdƒ}tdƒ}tj |¡r˜tj |¡r˜zt     
|ddg¡}Wnt t    j fk
r|YnXt  d|¡}|r˜| d¡}d‰|dkrútj ˆ¡rútt ˆ¡ƒ}| ¡‡fd    d
„|Dƒ}|rúd d lm}    |    |d ƒ|_}|S) NÚaixÚlslpprz-LcZxlfcmpz xlfcmp:(?P<version>\d+([.]\d+)+)Úversionz/etc/opt/ibmcmp/xlfc    s(g|] }tj tj ˆ|d¡¡r|‘qS)zxlf.cfg)ÚosÚpathÚisfileÚjoin)Ú.0Úd©Zxlf_dir©úTd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\numpy/distutils/fcompiler/ibm.pyÚ
<listcomp>5sz,IBMFCompiler.get_version.<locals>.<listcomp>r)Ú LooseVersion)rÚ get_versionÚsysÚplatformÚ
startswithrrrÚexistsÚ
subprocessÚ check_outputÚOSErrorÚCalledProcessErrorÚreÚsearchÚgroupÚisdirÚsortedÚlistdirÚreverseZdistutils.versionrr)
ÚselfÚargsÚkwdsrrrÚoÚmÚlrrrrrs* 
 zIBMFCompiler.get_versioncCsdgS)Nz    -qextnamer©r+rrrÚ    get_flags;szIBMFCompiler.get_flagscCsdgS)Nz-grr1rrrÚget_flags_debug>szIBMFCompiler.get_flags_debugc
    Csäg}tjdkr| d¡n
| d¡|jddgd}|dk    ràtj d¡rNd}nd    |}td
d \}}t d |¡t|d ƒH}t     
d¡j }|D]0}||ƒ}    |    r´|  d|      d¡¡qŽ|  |¡qŽW5QRX| ¡| d|¡|S)NÚdarwinz/-Wl,-bundle,-flat_namespace,-undefined,suppressz-bsharedré()Z    ok_statusr z /etc/xlf.cfgz/etc/opt/ibmcmp/xlf/%s/xlf.cfgz_xlf.cfg)Úsuffixz    Creating Úrz \s*crt\s*=\s*(?P<path>.*)/crt1.ozcrt = %s/bundle1.o
rz-F)rrÚappendrrrrÚinfoÚopenr$ÚcompileÚmatchÚwriter&Úclose)
r+ÚoptrZxlf_cfgÚfoZnew_cfgÚfiZ
crt1_matchÚliner/rrrÚget_flags_linker_soAs*
 
   z IBMFCompiler.get_flags_linker_socCsdgS)Nz-O3rr1rrrÚ get_flags_opt[szIBMFCompiler.get_flags_optN) Ú__name__Ú
__module__Ú __qualname__Ú compiler_typeÚ descriptionZversion_patternZ executablesrr2r3rCrDrrrrr s ù
Ú__main__)Úcustomized_fcompilerér)Úcompiler)rr$rr Znumpy.distutils.fcompilerrZnumpy.distutils.exec_commandrZnumpy.distutils.misc_utilrÚ    distutilsrZ    compilersrrEZnumpy.distutilsrKÚ set_verbosityÚprintrrrrrÚ<module>s    Q