Current File : //usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/gnu.pyc
�
E�`Qc@s�ddlZddlZddlZddlZddlZddlZddlmZmZm	Z	ddl
mZddlm
Z
ddlmZddlmZddlmZdd	gZejd
�Zd�Ze�r�gZngZde
fd��YZd	efd
��YZd�Zedkr�ddlmZejd�e�Z e j!�e j"�GHe#d�y"e�Z e j!�e j"�GHWne$k
r�e�Z%e%GHnXe#d�ndS(i����N(tPopentPIPEtSTDOUT(tcpu(t	FCompiler(texec_command(tmsvc_runtime_library(t
get_exceptiontGnuFCompilertGnu95FCompilersTarget: ([a-zA-Z0-9_\-]*)cCs#tjdko"tj�ddkS(Ntwin32it64bit(tsystplatformtarchitecture(((sC/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/gnu.pytis_win64scBsmeZdZd#ZdZd�Zd�ZddgZid$dgd6d$dd	d
gd6d$d6d$d
6d$dd	gd6ddgd6dgd6d$dd	gd6Z	d$Z
d$Zej
dkr�ejdkr�dgZnejdkrx.ddddgD]Ze	ejd�q�WndZdZd�Zd�Zd�Zd�Zd�Zd �Zd!�Zd"�ZRS(%tgnutg77sGNU Fortran 77 compilercCs�tjd|�}|sd
Stjd|�}|rGd|jd�fStjd|�}|r�|jd�}|jd�s�|jd�s�|jd�r�d	|fSd|fSnd
S(s6Handle the different versions of GNU fortran compilerssGNU FortransGNU Fortran\s+95.*?([0-9-.]+)tgfortranisGNU Fortran.*?([0-9-.]+)t0t2t3RN(tretmatchtNonetgroupt
startswith(tselftversion_stringtmtv((sC/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/gnu.pytgnu_version_match"s-
cCs2|j|�}|s&|ddkr*dS|dS(NiRi(RR(RRR((sC/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/gnu.pyt
version_match5stf77s	--versiontversion_cmds-gs-Walls-fno-second-underscoretcompiler_f77tcompiler_f90tcompiler_fixt	linker_sotars-crtarchivertranlibt
linker_exetnttcygwins-fPICR
s-mno-cygwintg2ctgnu95cCs�|jd}tjdkr�tjjdd�}|s�ddlj}i}|j	�}|j
||�|jdd�}|tjd<|dkr�d}tj|�q�n|j
ddd	g�n
|jd
�tjjd�r�|jd�n|S(
NitdarwintMACOSX_DEPLOYMENT_TARGETi����s10.3s2Env. variable MACOSX_DEPLOYMENT_TARGET set to 10.3s
-undefinedtdynamic_lookups-bundles-sharedtsunoss
-mimpure-text(R&RR
tostenvirontgetRtdistutils.sysconfigt	sysconfigtget_makefile_filenametparse_makefiletwarningstwarntextendtappendR(Rtoptttargettsctgtfilenamets((sC/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/gnu.pytget_flags_linker_sofs$


cCs<t|jdgdd�\}}|s8tjj|�SdS(Ns-print-libgcc-file-nametuse_teei(RR#R3tpathtdirnameR(Rtstatustoutput((sC/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/gnu.pytget_libgcc_dir�s	
cCs�g}tjd dkr�|j�}|r�tjdkr�|jd�r�tjj|�}tjjtjj|d|j	��s�tjj
tjj|d��}tjjtjj|d|j	��r�|j|�q�q�n|j|�q�n|S(NitlinuxR
s/usr/libslib%s.as../../../../lib(RR
RJRR3RFtnormpathtexiststjoinR-tabspathR=(RR>tdtd2((sC/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/gnu.pytget_library_dirs�s((cCsg}|j�}|dk	rq|jd}|j||jf}tjjtjj||��sz|j}qzn	|j}|dk	r�|j	|�n|j
}tjdkr�|r�|j
dkr�|j	d�t�}|r�|j	|�q�ntjdkr|j	d�n|S(Ns-picR
tmsvctgccR/t
cc_dynamic(RJRR-tstatic_lib_formattstatic_lib_extensionR3RFtisfileRNR=t
c_compilerRR
t
compiler_typeR(RR>RPR-tfRYtruntime_lib((sC/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/gnu.pyt
get_libraries�s(
!		
	cCsdgS(Ns-g((R((sC/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/gnu.pytget_flags_debug�scCsD|j�}|r*|dkr*dg}n	dg}|jd�|S(Ns3.3.3s-O2s-O3s-funroll-loops(tget_versionR=(RRR>((sC/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/gnu.pyt
get_flags_opt�s	
cCs|ddlm}y|j�d}Wntk
r8gSXtjd�}g}x'|j|�D]}|d|g7}q^W|S(s( Return detected arch flags from CFLAGS i����(R7tCFLAGSs
-arch\s+(\w+)s-arch(t	distutilsR7tget_config_varstKeyErrorRtcompiletfindall(RR7tcflagstarch_ret
arch_flagstarch((sC/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/gnu.pyt
_c_arch_flags�s
cCsgS(N((R((sC/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/gnu.pytget_flags_arch�s(sg77N(t__name__t
__module__RZtcompiler_aliasestdescriptionRR tpossible_executablesRtexecutablestmodule_dir_switchtmodule_include_switchR3tnameRR
t	pic_flagstkeyR=R-tsuggested_f90_compilerRDRJRRR]R^R`RkRl(((sC/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/gnu.pyRs@		


		'						
cBseZdZdZdZd�ZddgZiddgd6ddd	d
ged6ddd
ged6ddd	d
ged
6ddgd6ddgd6dgd6ddgd6Z	dZ
dZdZd�Z
d�Zd�Zd�Zd�Zd�Zd�ZRS(R.RsGNU Fortran 95 compilercCs�|j|�}|s&|ddkr*dS|d}|dkrCnItjdkr�x7dddd	d
dgD]}|j|jd�qkWn|S(
NiRis4.R
R"R#R$R%R&R*s-mno-cygwin(RRRR
RrR=(RRRRw((sC/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/gnu.pyR �s
tf95s<F90>s	--versionR"s-Walls-ffixed-forms-fno-second-underscoreR#R$R%R&R's-crR(R)R*s-Js-IcCs�tjdksgSg}|j�}d|krGd||jd�<nxKddddgD]7}t||�rZ||krZ|jd|g�qZqZW|S(s>Return a list of -arch flags for every supported architecture.R/ti386ti686tppctx86_64tppc64s-arch(RR
Rktindext_can_targetR<(RtcmdRitc_archsRj((sC/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/gnu.pyt_universal_flags
scCs8tj|�}|j|j�}|r4||d*n|S(Ni(Rt	get_flagsR�R$(RtflagsRi((sC/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/gnu.pyR�s

cCs8tj|�}|j|j�}|r4||d*n|S(Ni(RRDR�R&(RR�Ri((sC/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/gnu.pyRD$s

cCs�tj|�}tjdkr�|j}|r�|jdkr�|j�}|r�tjj	|j
��}tjj|tjtjtjtj�}tjj	tjj||d��}tjj|d�}tjj
|�r�|j|�q�q�q�n|S(NR
RStlibslibmingwex.a(RRRRR
RYRZt
get_targetR3RFRLRJRNtpardirRMR=(RR>RYR?RPtroottmingwdirtfull((sC/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/gnu.pyRR+s	*$cCs�tj|�}tjdkr.|jd�ntjdkr�|j}|r�|jdkr�d|kr�|jd�}|j|dd�|j|dd�q�nt	�r�|j}|r�|jdkr�gSt
d	��q�n|S(
NR/RUR
RSRTitmingwextmingw32s1Only MS compiler supported with gfortran on win64(RR]RR
tremoveRYRZRtinsertRtNotImplementedError(RR>RYti((sC/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/gnu.pyR]:s 			cCsQt|jdgdd�\}}|sMtj|�}|rM|jd�SndS(Ns-vREiit(RR#tTARGET_RtsearchR(RRHRIR((sC/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/gnu.pyR�Ns	
cCs!t�rdgStj|�SdS(Ns-O0(RRR`(R((sC/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/gnu.pyR`Xs	(sgfortranN(RmRnRZRoRpR RqRt_EXTRAFLAGSRrRsRtR-R�R�RDRRR]R�R`(((sC/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/gnu.pyR	�s4	
		


						
cCs�|}tjdd�\}}z�tjj|�}tjj|�dd}zR|jd|d|g�t|dtdt	d	|�}|j
�|jdkSWd
tjj|�r�tj
|�nXWd
tj
|�XtS(sRReturn true is the command supports the -arch flag for the given
    architecture.tsuffixs.fis.os-archs-ctstderrtstdouttcwdN(ttempfiletmkstempR3RFRGtsplitextR<RRRtcommunicatet
returncodeRMR�tFalse(R�RjtnewcmdtfidRBRPRItp((sC/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/gnu.pyR�^s
t__main__(tlogisPress ENTER to continue...(&RR3RR:R
R�t
subprocessRRRtnumpy.distutils.cpuinfoRtnumpy.distutils.fcompilerRtnumpy.distutils.exec_commandRtnumpy.distutils.misc_utilRtnumpy.distutils.compatRt	compilersReR�RR�RR	R�RmRbR�t
set_verbositytcompilert	customizeR_t	raw_inputt	Exceptiontmsg(((sC/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/gnu.pyt<module>sF			��