ó ™ÙÊKc@sÇddlZddlZddlZddlmZddlmZmZddlm Z ddl m Z dgZ defd„ƒYZ edkrÃe jd ƒe ƒZejƒejƒGHndS( iÿÿÿÿN(t FCompiler(t exec_commandtfind_executable(tmake_temp_file(tlogt IBMFCompilercBsœeZdZdZdZiddgd6dgd6dd gd 6dgd 6d gd 6ddgd6dgd6Zd„Zd„Zd„Zd„Z d„Z RS(tibmsIBM XL Fortran Compilersd(xlf\(1\)\s*|)IBM XL Fortran ((Advanced Edition |)Version |Enterprise Edition V)(?P[^\s*]*)ss -qversiont version_cmdtxlft compiler_f77txlf90s-qfixedt compiler_fixt compiler_f90txlf95t linker_sotars-crtarchivertranlibc Osptj|||Ž}|dkrµtjjdƒrµtdƒ}tdƒ}tjj |ƒrµtjj |ƒrµt |dƒ\}}t j d|ƒ}|r²|j dƒ}q²qµnd} |dkrltjj| ƒrltj| ƒ} | jƒ| jƒg| D]0} tjjtjj| | dƒƒr| ^q} | rld d lm} | | d ƒ|_}qln|S( NtaixtlslppRs -Lc xlfcmps xlfcmp:(?P\d+([.]\d+)+)tversions/etc/opt/ibmcmp/xlfsxlf.cfgiÿÿÿÿ(t LooseVersioni(Rt get_versiontNonetsystplatformt startswithRtostpathtexistsRtretsearchtgrouptisdirtlistdirtsorttreversetisfiletjointdistutils.versionRR( tselftargstkwdsRRRtstotmtxlf_dirtltdR((sA/usr/lib/python2.7/site-packages/numpy/distutils/fcompiler/ibm.pyRs&  $  =cCsdgS(Ns -qextname((R(((sA/usr/lib/python2.7/site-packages/numpy/distutils/fcompiler/ibm.pyt get_flags7scCsdgS(Ns-g((R(((sA/usr/lib/python2.7/site-packages/numpy/distutils/fcompiler/ibm.pytget_flags_debug:sc CsAg}tjdkr%|jdƒn |jdƒ|jdddgƒ}|dk r=tjjdƒrqd}n d |}td d ƒ\}}tjd |ƒt |d ƒ}t j dƒj }xP|j ƒD]B}||ƒ} | r|jd| jdƒƒqÏ|j|ƒqÏW|jƒ|jƒ|jd|ƒn|S(Ntdarwins/-Wl,-bundle,-flat_namespace,-undefined,suppresss-bsharedt ok_statusii(Rs /etc/xlf.cfgs/etc/opt/ibmcmp/xlf/%s/xlf.cfgtsuffixs_xlf.cfgs Creating trs"\s*crt\s*[=]\s*(?P.*)/crt1.oscrt = %s/bundle1.o Rs-F(RRtappendRRRRRtinfotopenRtcompiletmatcht readlinestwriteR tclose( R(toptRtxlf_cfgtfotnew_cfgtfit crt1_matchtlineR-((sA/usr/lib/python2.7/site-packages/numpy/distutils/fcompiler/ibm.pytget_flags_linker_so=s,       cCsdgS(Ns-O5((R(((sA/usr/lib/python2.7/site-packages/numpy/distutils/fcompiler/ibm.pyt get_flags_optXs( t__name__t __module__t compiler_typet descriptiontversion_patternt executablesRR1R2RFRG(((sA/usr/lib/python2.7/site-packages/numpy/distutils/fcompiler/ibm.pyR s            t__main__i(RRRtnumpy.distutils.fcompilerRtnumpy.distutils.exec_commandRRtnumpy.distutils.misc_utilRt distutilsRt compilersRRHt set_verbositytcompilert customizeR(((sA/usr/lib/python2.7/site-packages/numpy/distutils/fcompiler/ibm.pyts    O