ó 2ÄÈ[c@`sêddlmZmZmZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl m Z mZmZddlmZddlmZddlmZddlmZddlmZd d gZejd ƒZd „ZeƒrgZngZd efd „ƒYZd efd„ƒYZd„Z e!dkræddl"m#Z#ddl$m%Z%e#j&dƒe'e%dƒj(ƒƒye'e%dƒj(ƒƒWqæe)k râe'eƒƒqæXndS(i(tdivisiontabsolute_importtprint_functionN(tPopentPIPEtSTDOUT(tcopy(t FCompiler(t exec_command(t get_exception(t system_infot GnuFCompilertGnu95FCompilersTarget: ([a-zA-Z0-9_\-]*)cC`s#tjdko"tjƒddkS(Ntwin32it64bit(tsystplatformt architecture(((s</tmp/pip-build-fiC0ax/numpy/numpy/distutils/fcompiler/gnu.pytis_win64scB`seZdZd%ZdZd„Zd„ZddgZid&dgd6d&dd d gd 6d&d 6d&d 6d&dd gd6ddgd6dgd6d&dd gd6Z d&Z d&Z e j dkr×ejdkr×dgZnejdkrx.dd ddgD]Ze ejdƒqùWndZdZd„Zd„Zd„Zd„Zd„Zd „Zd!„Zd"„Zd#„Zd$„ZRS('tgnutg77sGNU Fortran 77 compilercC`sTx*|jdƒr,||jdƒd}qWt|ƒdkr¤tjd|ƒ}|r:|jdƒryd|jdƒfS|jƒdkr¡d |jdƒfSq:n–tjd |ƒ}|rÏd |jdƒfStjd |ƒ}|r:|jdƒ}|jd ƒs#|jd ƒs#|jdƒr-d|fSd |fSnd}t||ƒ‚dS(s6Handle the different versions of GNU fortran compilerssgfortran: warnings iis ([0-9.]+)s GNU FortranRitgfortransGNU Fortran\s+95.*?([0-9-.]+)s%GNU Fortran.*?\-?([0-9-.]+\.[0-9-.]+)t0t2t3s6A valid Fortran version was not found in this string: N(t startswithtfindtlentretsearchtgrouptstartt ValueError(tselftversion_stringtmtvterr((s</tmp/pip-build-fiC0ax/numpy/numpy/distutils/fcompiler/gnu.pytgnu_version_match)s* -  cC`s2|j|ƒ}| s&|ddkr*dS|dS(NiRi(R&tNone(R!R"R$((s</tmp/pip-build-fiC0ax/numpy/numpy/distutils/fcompiler/gnu.pyt version_matchUstf77s -dumpversiont version_cmds-gs-Walls-fno-second-underscoret compiler_f77t compiler_f90t compiler_fixt linker_sotars-crtarchivertranlibt linker_exetnttcygwins-fPICR s -mno-cygwintg2ctgnu95cC`s|jd}tjdkrétjjddƒ}|sÐddlj}i}y |j }Wnt k rlnX|ƒ}|j ||ƒ|jddƒ}|tjd<|dkrÐd}t j |ddƒqÐn|jd d d gƒn |jd ƒtjjd ƒr|jdƒn|S(NitdarwintMACOSX_DEPLOYMENT_TARGETis10.3s2Env. variable MACOSX_DEPLOYMENT_TARGET set to 10.3t stacklevelis -undefinedtdynamic_lookups-bundles-sharedtsunoss -mimpure-text(R.RRtostenvirontgetR'tdistutils.sysconfigt sysconfigtget_makefile_filenametAttributeErrortparse_makefiletwarningstwarntextendtappendR(R!toptttargettsctgRAtfilenamets((s</tmp/pip-build-fiC0ax/numpy/numpy/distutils/fcompiler/gnu.pytget_flags_linker_sovs,       cC`s<t|jdgddƒ\}}|s8tjj|ƒSdS(Ns-print-libgcc-file-nametuse_teei(RR+R<tpathtdirnameR'(R!tstatustoutput((s</tmp/pip-build-fiC0ax/numpy/numpy/distutils/fcompiler/gnu.pytget_libgcc_dir¢s cC`s™tjd dkrd}ntjdkr4d}nd}d}|r•dj|ƒg}t|j|ddƒ\}}|s•tjj|ƒ}q•n|S( Nitlinuxslibgfortran.soR7slibgfortran.dylibs-print-file-name={0}ROi( RRR'tformatRR+R<RPRQ(R!tlibgfortran_nametlibgfortran_dirt find_lib_argRRRS((s</tmp/pip-build-fiC0ax/numpy/numpy/distutils/fcompiler/gnu.pytget_libgfortran_dir©s  cC`sGg}tjd dkr!|jƒ}|r!tjdkr|jdƒ rtjj|ƒ}tjj|d|jƒ}tjj |ƒstjj|tj fdŒ}tjj tjj|dƒƒ}tjj|d|jƒ}tjj |ƒr |j |ƒq qn|j |ƒq!n|j ƒ}|rC|j |ƒn|S(NiRUR s/usr/libslib%s.aitlib(RRRTRR<RPtnormpathtjoinR5texiststpardirtabspathRGRZ(R!RHtdRPtroottd2tlib_gfortran_dir((s</tmp/pip-build-fiC0ax/numpy/numpy/distutils/fcompiler/gnu.pytget_library_dirsºs$ ! cC`sög}|jƒ}|dk rq|jd}|j||jf}tjjtjj||ƒƒsz|j}qzn |j}|dk r–|j |ƒn|j }t j dkrÓ|rÓ|j dkrÓ|j dƒnt j dkrò|j dƒn|S(Ns-picR tmsvctgccR7t cc_dynamic(RTR'R5tstatic_lib_formattstatic_lib_extensionR<RPtisfileR]RGt c_compilerRRt compiler_type(R!RHRaR5tfRl((s</tmp/pip-build-fiC0ax/numpy/numpy/distutils/fcompiler/gnu.pyt get_librariesÐs"   !   cC`sdgS(Ns-g((R!((s</tmp/pip-build-fiC0ax/numpy/numpy/distutils/fcompiler/gnu.pytget_flags_debugåscC`sD|jƒ}|r*|dkr*dg}n dg}|jdƒ|S(Ns3.3.3s-O2s-O3s-funroll-loops(t get_versionRG(R!R$RH((s</tmp/pip-build-fiC0ax/numpy/numpy/distutils/fcompiler/gnu.pyt get_flags_optès     cC`s|ddlm}y|jƒd}Wntk r8gSXtjdƒ}g}x'|j|ƒD]}|d|g7}q^W|S(s( Return detected arch flags from CFLAGS i(R@tCFLAGSs -arch\s+(\w+)s-arch(t distutilsR@tget_config_varstKeyErrorRtcompiletfindall(R!R@tcflagstarch_ret arch_flagstarch((s</tmp/pip-build-fiC0ax/numpy/numpy/distutils/fcompiler/gnu.pyt _c_arch_flagsós cC`sgS(N((R!((s</tmp/pip-build-fiC0ax/numpy/numpy/distutils/fcompiler/gnu.pytget_flags_archscC`s)tjdkrdnd}d||fS(NR7t,t=s-Wl,-rpath%s"%s"(RR(R!tdirtsep((s</tmp/pip-build-fiC0ax/numpy/numpy/distutils/fcompiler/gnu.pytruntime_library_dir_options(RN(t__name__t __module__Rmtcompiler_aliasest descriptionR&R(tpossible_executablesR't executablestmodule_dir_switchtmodule_include_switchR<tnameRRt pic_flagstkeyRGR5tsuggested_f90_compilerRNRTRZReRoRpRrR}R~Rƒ(((s</tmp/pip-build-fiC0ax/numpy/numpy/distutils/fcompiler/gnu.pyR $sD ,       ,      cB`s-eZdZd!ZdZd„ZddgZiddgd6d"dd d d ged 6d"dd d ged 6d"dd d d ged6ddd gd6ddgd6dgd6d"dgd6Z dZ dZ dZ d„Z d„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd „ZRS(#R6RsGNU Fortran 95 compilercC`s|j|ƒ}| s&|ddkr*dS|d}|dkrCnItjdkrŒx7dddd d d gD]}|j|jd ƒqkWn|S( NiRis4.R R*R+R,R-R.R2s -mno-cygwin(R&R'RRR‰RG(R!R"R$RŽ((s</tmp/pip-build-fiC0ax/numpy/numpy/distutils/fcompiler/gnu.pyR( s   tf95ss -dumpversionR*s-Walls-gs -ffixed-forms-fno-second-underscoreR+R,R-R.R/s-crR0R1R2s-Js-IcC`s™tjdksgSg}|jƒ}d|krGd||jdƒReturn a list of -arch flags for every supported architecture.R7ti386ti686tppctx86_64tppc64s-arch(RRR}tindext _can_targetRF(R!tcmdR{tc_archsR|((s</tmp/pip-build-fiC0ax/numpy/numpy/distutils/fcompiler/gnu.pyt_universal_flags4s  cC`s8tj|ƒ}|j|jƒ}|r4||d*n|S(Ni(R t get_flagsRšR,(R!tflagsR{((s</tmp/pip-build-fiC0ax/numpy/numpy/distutils/fcompiler/gnu.pyR›Ds  cC`s8tj|ƒ}|j|jƒ}|r4||d*n|S(Ni(R RNRšR.(R!RœR{((s</tmp/pip-build-fiC0ax/numpy/numpy/distutils/fcompiler/gnu.pyRNKs  c C`s tj|ƒ}tjdkræ|j}|ræ|jdkræ|jƒ}|rãtjj |j ƒƒ}tjj |tj fdŒ}tjj |dƒ}tjj |ƒ}tjj tjj |dƒƒrà|j|ƒqàqãqæn|jƒ}|r|j|ƒn|S(NR RfiR[s libmingwex.a(R ReRRRlRmt get_targetR<RPR\RTR]R_R^RGRZ( R!RHRlRIRaRbRPtmingwdirRd((s</tmp/pip-build-fiC0ax/numpy/numpy/distutils/fcompiler/gnu.pyReRs   ! cC`sÍtj|ƒ}tjdkr.|jdƒntjdkrÉ|j}|r¤|jdkr¤d|kr¤|jdƒ}|j|ddƒ|j|ddƒq¤n|j}|rÉ|jdkrÉgSn|S( NR7RhR RfRgitmingwextmingw32( R RoRRtremoveRlRmR–tinsert(R!RHRlti((s</tmp/pip-build-fiC0ax/numpy/numpy/distutils/fcompiler/gnu.pyRoes   cC`sQt|jdgddƒ\}}|sMtj|ƒ}|rM|jdƒSndS(Ns-vROiit(RR+tTARGET_RRR(R!RRRSR#((s</tmp/pip-build-fiC0ax/numpy/numpy/distutils/fcompiler/gnu.pyRws "cC`s¯tjƒ}xY|D]Q}t|dƒ:}x0tr]|jdƒ}|sMPn|j|ƒq.WWdQXqWtj|jƒƒ}t j ddkr¢|j dƒ}n|j dƒS(NtrbiiitasciiR€( thashlibtsha1topentTruetreadtupdatetbase64t b32encodetdigestRt version_infotdecodetrstrip(R!t filenamesthtfnRntblockttext((s</tmp/pip-build-fiC0ax/numpy/numpy/distutils/fcompiler/gnu.pyt _hash_filess   c C`sà|j}|jdkr'tdƒ‚n|jt|ƒt|ƒƒ}tƒrXd}nd}dtjjtjj |dƒƒdd } | d|d |} | d } | d } | d } tjj || ƒ}tjj || ƒ}tjj || ƒ}tjj |ƒr||fS|r>d gt|ƒdg}n|j || d|dt|ƒdd|ddddgƒtƒrŒd}nd}d|d||g}|j s¿|jƒn|j|jg|ƒ||fS(seCreate a wrapper shared library for the given objects Return an MSVC-compatible lib RfsThis method only supports MSVCt win_amd64R R[iit.s .gfortran-s.dlls.defs.libs-Wl,--whole-archives-Wl,--no-whole-archivet output_dirtextra_postargss-Wl,--allow-multiple-definitions-Wl,--output-def,s-Wl,--export-all-symbolss-Wl,--enable-auto-imports-statics-mlong-double-64s /MACHINE:X64s /MACHINE:X86s/def:s/OUT:(RlRmR R¹tlistRR<RPtsplitexttbasenameR]Rktlink_shared_objectt initializedt initializetspawnR[(R!tobjectsR¼t extra_dll_dirt chained_dllst is_archiveRlt object_hashttagRÀt root_nametdll_nametdef_nametlib_nametdll_pathtdef_pathtlib_patht specifiertlib_args((s</tmp/pip-build-fiC0ax/numpy/numpy/distutils/fcompiler/gnu.pyt_link_wrapper_libsP    "           cC`s |jdkS(NRf(Rf(Rm(R!tcompiler((s</tmp/pip-build-fiC0ax/numpy/numpy/distutils/fcompiler/gnu.pytcan_ccompiler_linkËsc C`s!|jjdkrg}g}x@|D]8}|jƒjdƒrP|j|ƒq%|j|ƒq%Wg}g}xe|ddd…D]P} |j| g||d|dtƒ\} } |jd| ƒ|jd| ƒqW|sß|S|j|||d|dtƒ\} } | g|St dƒ‚dS( s† Convert a set of object files that are not compatible with the default linker, to a file that is compatible. Rfs.aNiÿÿÿÿRÇRÈisUnsupported C compiler( RlRmtlowertendswithRGRÔR«R¢tFalseR ( R!RÅR¼RÆtarchivest plain_objectstobjt chained_libsRÇtarchiveR[tdll((s</tmp/pip-build-fiC0ax/numpy/numpy/distutils/fcompiler/gnu.pytwrap_unlinkable_objectsÏs8  (RN(R„R…RmR†R‡R(RˆR't _EXTRAFLAGSR‰RŠR‹R5RšR›RNReRoRR¹RÔRÖRà(((s</tmp/pip-build-fiC0ax/numpy/numpy/distutils/fcompiler/gnu.pyR s<                > cC`sé|}tjddƒ\}}tj|ƒz¨tjj|ƒ}tjj|ƒdd}zR|jd|d|gƒt|dt dt d |ƒ}|j ƒ|j dkSWd tjj |ƒrÒtj|ƒnXWd tj|ƒXtS( s7Return true if the architecture supports the -arch flagtsuffixs.fis.os-archs-ctstderrtstdouttcwdN(ttempfiletmkstempR<tcloseRPRQR¿RFRRRt communicatet returncodeR^R¡RÙ(R˜R|tnewcmdtfidRLRaRStp((s</tmp/pip-build-fiC0ax/numpy/numpy/distutils/fcompiler/gnu.pyR—ýs  t__main__(tlog(tcustomized_fcompileriRtg95(*t __future__RRRRR<RRDRRæR¨R®t subprocessRRRRtnumpy.distutils.fcompilerRtnumpy.distutils.exec_commandRtnumpy.distutils.compatR tnumpy.distutils.system_infoR t compilersRwR¥RRáR R R—R„RtRïtnumpy.distutilsRðt set_verbositytprintRqt Exception(((s</tmp/pip-build-fiC0ax/numpy/numpy/distutils/fcompiler/gnu.pyts@            äõ