Current File : //usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pyc
�
E�`Qc@s�dZddddgZddlZddlZddlZddlZyeWn!ek
rsddlm	ZnXddl
mZdd	lm
Z
dd
lmZddlmZmZmZmZmZddlmZmZdd
lmZmZddlmZddlmZm Z m!Z!m"Z"m#Z#ddl$m%Z%ddl&m'Z'ddl(m)Z)e*Z+de,fd��YZ-d�Z.d�Z/d�Z0defd��YZ1dddddddd d!d"f	fd#ddddddd ffd$dd%d&d'dd(d)d*d+d"dd d,f
fd-dd(dd.d%dd d'ffd/d0ddd ffd1d2ddffd3d.ddffd4ddffd5ddffd6ddd'fff
Z2e3a4e3a5d7�Z6e3e3e7e3d8�Z8e3e3d9�Z9e3e3e7e3d:�Z:e7a;e3e3d;d;d;e7e3d<�Z<e3d=�Z=d>�Z>ej?d?ej@�jAZBej?d@ej@�jCZDej?dAej@�jCZEej?dBej@�jCZFej?dCej@�jAZGdD�ZHdE�ZIej?dFej@�ZJdG�ZKeLdHkr�e=�ndS(Is�numpy.distutils.fcompiler

Contains FCompiler, an abstract base class that defines the interface
for the numpy.distutils Fortran compiler abstraction model.

Terminology:

To be consistent, where the term 'executable' is used, it means the single
file, like 'gcc', that is executed, and should be a string. In contrast,
'command' means the entire command line, like ['gcc', '-c', 'file.c'], and
should be a list.

But note that FCompiler.executables is actually a dictionary of commands.
t	FCompilert
new_fcompilertshow_fcompilerstdummy_fortran_filei����N(tSet(topen_latin1(tget_python_lib(tFancyGetopt(tDistutilsModuleErrortDistutilsExecErrortCompileErrort	LinkErrortDistutilsPlatformError(tsplit_quotedt	strtobool(t	CCompilertgen_lib_options(tlog(t	is_stringtall_stringstis_sequencetmake_temp_filetget_shared_lib_extension(tEnvironmentConfig(tfind_executable(t
get_exceptiontCompilerNotFoundcBseZRS((t__name__t
__module__(((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pyR.scCst|�rt|�S|SdS(N(RR
(ts((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pytflaglist1s
cCs t|�rt|�St|�S(N(RRtbool(R((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pytstr2bool7s
cCst|�ot|�S(N(RR(tseq((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pytis_sequence_of_strings<sc(BseZdZedddd�d�defdd�d�defdd�d�defdd�d�def�Zedddd�dd�dd�dd�dd�dd�dd�dd��	Zeddd d!d"d#efd$d%d&d'efd(d)d*d+efd,d-d�d�efd.d/d0d.efd1d2d�d�efd3d4d�d�efd5d6d7d5efd8d9d�d�efd:d;d�d�efdd<d=d>efd?d@d�d�efdAdBd�d�efdCdDdEdFefddGdHdIefddJdHdIefddKdLdMef�Z	id dN6d dO6d dP6d dQ6d dR6d$dS6d$dT6d$dU6Z
d$d gZd�Zd�Z
d�ZgZid dVgd6d gd6d$gd6d$dWgd6d$dXgd6d$gd6ddYgd6d�d6Zd�ZdZZd[Zd[Zd�Zd\ZgZdOdQdRdNdSdUdPdTgZd]Ze�Zd^Zd_Zd`ZdaZiZ ddddddddgZ!d�Z"gZ#gZ$db�Z%dc�Z&dd�Z'de�Z(e(d�Z)e(d�Z*e(d�Z+e(d�Z,e(d�Z-e(d�Z.e(d�Z/e(d�Z0df�Z1dg�Z2dh�Z3di�Z4dj�Z5dk�Z6dl�Z7dm�Z8dn�Z9do�Z:dp�Z;dq�Z<dr�Z=ds�Z>dt�Z?du�Z@dv�ZAe?ZBZCe@ZDZEeAZFZGdw�ZHdx�ZIeJdygdz�ZKd�d{�ZLd|�ZMd}�ZNd~�ZOd�ZPd��ZQd�d�d�d�d�dyd�d�d�d�d��
ZRd��ZSRS(�s0Abstract base class to define the interface that must be implemented
    by real Fortran compiler classes.

    Methods that subclasses may redefine:

        update_executables(), find_executables(), get_version()
        get_flags(), get_flags_opt(), get_flags_arch(), get_flags_debug()
        get_flags_f77(), get_flags_opt_f77(), get_flags_arch_f77(),
        get_flags_debug_f77(), get_flags_f90(), get_flags_opt_f90(),
        get_flags_arch_f90(), get_flags_debug_f90(),
        get_flags_fix(), get_flags_linker_so()

    DON'T call these methods (except get_version) after
    constructing a compiler instance or inside any other method.
    All methods, except update_executables() and find_executables(),
    may call the get_version() method.

    After constructing a compiler instance, always call customize(dist=None)
    method that finalizes compiler construction and makes the following
    attributes available:
      compiler_f77
      compiler_f90
      compiler_fix
      linker_so
      archiver
      ranlib
      libraries
      library_dirs
    tdistutils_sectiont	config_fctnoopttnoarchtdebugtverbosetcompiler_f77sexe.compiler_f77tF77tf77exectcompiler_f90sexe.compiler_f90tF90tf90exectcompiler_fixsexe.compiler_fixtversion_cmdsexe.version_cmdt	linker_sos
exe.linker_sotLDSHAREDtldsharedt
linker_exesexe.linker_exetLDtldtarchivertARtartranlibtRANLIBtf77s	flags.f77tF77FLAGStf77flagstf90s	flags.f90tF90FLAGStf90flagstfrees
flags.freet	FREEFLAGSt	freeflagstfixs	flags.fixtopts	flags.opttFOPTtopt_f77s
flags.opt_f77topt_f90s
flags.opt_f90tarchs
flags.archtFARCHtarch_f77sflags.arch_f77tarch_f90sflags.arch_f90sflags.debugtFDEBUGtfdebugt	debug_f77sflags.debug_f77t	debug_f90sflags.debug_f90tflagssself.get_flagstFFLAGStfflagssflags.linker_sotLDFLAGStldflagssflags.linker_exesflags.artARFLAGStarflagss.fs.fors.Fs.ftns.f77s.f90s.F90s.f95s-vs-fixeds-shareds-crs-cs-o s-Is.os.aslib%s%ss%s%stcOs�tj|||�|jj|j�|_|jj|j�|_|jj|j�|_|jj�|_x0|j	D]%}||jkrwd|j|<qwqwWt|_dS(N(
Rt__init__tdistutils_varstclonet_environment_hooktcommand_varst	flag_varstexecutablestcopyt_executable_keystNonetFalset_is_customised(tselftargstkwte((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pyRZ�scCs�|j|j�}|jj|j�|jj|j�|_|jj|j�|_|jj|j�|_|j	j
�|_	|S(N(t__new__t	__class__t__dict__tupdateR[R\R]R^R_R`Ra(Rftobj((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pyt__copy__�scCs
|j�S(N(Ro(Rf((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pyRa�scs�fd�}td|�S(Ncs|jst�|j�S(N(RetAssertionErrorR`(Rf(tkey(sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pytfget�sRr(tproperty(RqRr((RqsH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pyt_command_property�scCs|j||�dS(N(tset_command(RfRqtvalue((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pytset_executablescKs1x*|j�D]\}}|j||�q
WdS(N(titemsRu(RfRhtktv((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pytset_commandsscCs�||jkr.td||jjf��nt|�rIt|�}n|dkswt|d�swt||f��||j	|<dS(Ns$unknown executable '%s' for class %si(
Rbt
ValueErrorRkRRR
RcR"RpR`(RfRqRv((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pyRus.cs8�jst��j��fd���fd�}dd��fd�}�j}|d�}|s�|d�}|r�tjd|�q�td|��n<|dd|�}|s�tjd	|�n|d
d|�|dd|d|�|d
d|d|�|dd|d|�|d�|d�dS(s1Go through the self.executables dictionary, and attempt to
        find and assign appropiate executables.

        Executable names are looked for in the environment (environment
        variables, the distutils.cfg, and command line), the 0th-element of
        the command list, and the self.possible_executables list.

        Also, if the 0th element is "<F77>" or "<F90>", the Fortran 77
        or the Fortran 90 compiler executable is used, unless overridden
        by an environment setting.

        Subclasses should call this if overriden.
        cs6|�kr�|St|�}|�|<�|<|S(N(R(texetfc_exe(t	exe_cache(sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pytcached_find_executable.s
cs?|dk	r;t|�r;td||�jjf��ndS(Ns"%s value %r is invalid in class %s(RcR"R|RkR(tnameRv(Rf(sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pytverify_command_form4scs�jj|d�}|sdSt�j|�}|sM||g�j}n|g�j}t�}g}xk|D]c}|dkr�|}n|dkr�|}n|ss||kr�qsn|j|�|j|�qsWx.|D]&}	�|	�}
|
r�|
|d<|
Sq�W�j	|d�dS(Ns<F77>s<F90>i(
R`tgetRctgetattrR^tpossible_executablestsettaddtappendRu(texe_keyR<R?tcmdtexe_from_environt	possiblestseentunique_possiblesRiR}R~(R�Rf(sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pytset_exe9s2	
		


R,R)s %s: no Fortran 90 compiler founds%s: f90 nor f77R?s %s: no Fortran 77 compiler foundR/R1R<R4R0R7R:N(ReRpt
_exe_cacheRct
compiler_typeRtwarnR(RfR�R�tctypeR?R<((R�RRfsH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pytfind_executabless*	 	
cCsdS(sqCalled at the beginning of customisation. Subclasses should
        override this if they need to set up the executables dictionary.

        Note that self.find_executables() is run afterwards, so the
        self.executables dictionary values can contain <F77> or <F90> as
        the command, which will be replaced by the found F77 or F90
        compiler.
        N((telf((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pytupdate_executablesms	cCsg|jS(s+List of flags common to all compiler types.(t	pic_flags(Rf((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pyt	get_flagsxscCs-|jj|d�}|dkr%gS|dS(Ni(R`R�Rc(RfRqR�((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pyt_get_command_flags|scCs
|jd�S(s"List of Fortran 77 specific flags.R)(R�(Rf((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pyt
get_flags_f77�scCs
|jd�S(s"List of Fortran 90 specific flags.R,(R�(Rf((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pyt
get_flags_f90�scCsgS(s.List of Fortran 90 free format specific flags.((Rf((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pytget_flags_free�scCs
|jd�S(s/List of Fortran 90 fixed format specific flags.R/(R�(Rf((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pyt
get_flags_fix�scCs
|jd�S(s/List of linker flags to build a shared library.R1(R�(Rf((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pytget_flags_linker_so�scCs
|jd�S(s,List of linker flags to build an executable.R4(R�(Rf((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pytget_flags_linker_exe�scCs
|jd�S(sList of archiver flags. R7(R�(Rf((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pytget_flags_ar�scCsgS(s0List of architecture independent compiler flags.((Rf((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pyt
get_flags_opt�scCsgS(s.List of architecture dependent compiler flags.((Rf((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pytget_flags_arch�scCsgS(s=List of compiler flags to compile with debugging information.((Rf((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pytget_flags_debug�scCs|jS(sList of compiler libraries.(t	libraries(Rf((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pyt
get_libraries�scCs|jS(s%List of compiler library directories.(tlibrary_dirs(Rf((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pytget_library_dirs�sicCsF|jst�tj|d|d|�}|dkrBt��n|S(Ntforcet	ok_status(ReRpRtget_versionRcR(RfR�R�tversion((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pyR��s
cs_tjd�jj�t�_�jj|��jj|��j	j|��j
��j��jjdt
�}�jjd|�}�jjdt
�}�jj��jj�g�g�g}g��r��j	j�n�r	�j	j��j	j}n�jj��r.�j	j��nggg}}}�������fd�}	|s�|	d|�|s�|	d|�q�n|r�|	d|�n�j	j|||}
�r��jd�g�|
�n�r	�jd	�g|�|
�n�r-�jd
�g�|
�n�j}|r��j	j}tjjd�r�tdd
�}
tjj|
dd�}tjj|
dd�}|g|d|g}n�jd||�n�j}|r��j	j}�jd||�n�jj }|r5�j	j!}�jd|g|�n�j"�j#���j$�j%��dS(s�Customize Fortran compiler.

        This method gets Fortran compiler specific information from
        (i) class definition, (ii) environment, (iii) distutils config
        files, and (iv) command line (later overrides earlier).

        This method should be always called after constructing a
        compiler instance. But not in __init__ because Distribution
        instance is needed for (iii) and (iv).
        scustomize %sR%R&R'cs�|jt�j|��t�d|�}x�d��fd��fd��fgD]Z\}}}d||f}|rW|t�d|�k	rW|jt�j|��qWqWWdS(Nt
get_flags_R<R?s%s_%s(textendR�R_(ttagRRtthis_getR�tctflagvartt(R<R>R?RAREtfixflagsRf(sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pyR��sRFRJR)R,R/taixtstandard_libitconfigt	ld_so_aixs
python.exps-bI:R1R4R7N(&RtinfoRkRtTrueReR[tuse_distributionR^R_R�R�R�RdR)R,R<R?RBR/RERRR{R1tsystplatformt
startswithRtostpathtjoinR4R7R9tset_library_dirsR�t
set_librariesR�(RftdistR%R&R'RDtoflagstaflagstdflagsR�RTR1tlinker_so_flagst
python_libR�t
python_expR4tlinker_exe_flagsR9RX((R<R>R?RARER�RfsH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pyt	customize�st	

!

"		cCs�g}xk|jj�dddddgD]G}t||�r)t||�}|j|ddt|�f�q)q)W|j�t|�}xG|j	d|j
j�D],}|d d	kr�d
|d}n|GHq�WdS(s0Print out the attributes of a compiler instance.R�R�R�t
object_switchtcompile_switchs= s%s instance properties:is  --s  N(R`tkeysthasattrR�R�RctreprtsortRt
generate_helpRkR(RftpropsRqRztpretty_printertl((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pytdump_propertiess	'
cCsCi}t|�rLt|�rLd}|j}	t|�}|jpFg}
n�t|�r�d}|j}	|	dkr�td|j	j
|f��n|jp�g}
nId}|j}	|	dkr�td|j	j
|f��n|jp�g}
|j
ddkr|j
j�|g}n|j
j�|g}|jj�sCt�|j|g}|
rtjd|d	dj|
�f�n|j|jg�}
|
r�tjd
dj|
��n|	||
||||
}dtjj|	d�||f}y|j|d
|�Wn,tk
r>tt��}t|��nXdS(sCompile 'src' to product 'obj'.s:f77s:f90s%f90 not supported by %s needed for %ss:fixs-f90 (fixed) not supported by %s needed for %si����t sextra %s options: %ris%using compile options from source: %rs%s: %sitdisplayN(t	is_f_filethas_f90_headerR)tget_f77flagstextra_f77_compile_argstis_free_formatR,RcR	RkRtextra_f90_compile_argsR/R�tstripR�RpRR�R�R�R�R�R�tbasenametspawntstrRR
(RfRntsrctexttcc_argstextra_postargstpp_optst	src_flagstflavortcompilertextra_compile_argsto_argsts_argstextra_flagstcommandR�tmsg((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pyt_compile0sN					

cCs�g}|jdk	rd|jddkrG|j|jj�|g�q~|j|jj�|�nd|GHd|jjfGH|jdk	r�xL|g|D] }|jd|j|f�q�Wnd|GHd|jjfGH|S(Ni����R�s'XXX: module_build_dir=%r option ignoredsXXX: Fix module_dir_switch for s%s%ss"XXX: module_dirs=%r option ignoreds#XXX: Fix module_include_switch for (tmodule_dir_switchRcR�R�R�RkRtmodule_include_switch(Rftmodule_dirstmodule_build_dirtoptionstd((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pytmodule_optionsbs	!	cCsd|S(Ns-l((Rftlib((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pytlibrary_optiontscCsd|S(Ns-L((Rftdir((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pytlibrary_dir_optionvscCs�|j||�\}}|j|||�\}}}t||||�}t|�rotjj||�}n|dk	r�td��n|j	||�r�|j
ddkr�|j
j�|g}n|j
j�|g}t|j�r�||jg}n
||j}|||}|	r0dg|d*n|
rC|
|d*n|rY|j
|�n|jtjj|��|tjkr�|j}n
|j}||}y|j|�Wq�tk
r�tt��}t|��q�Xntjd|�dS(Ns%'output_dir' must be a string or Nonei����R�s-gisskipping %s (up-to-date)(t_fix_object_argst
_fix_lib_argsRRR�R�R�Rct	TypeErrort
_need_linktlibrary_switchR�tobjectsR�tmkpathtdirnameRt
EXECUTABLER4R1R�R	R�RRRR'(Rfttarget_descRtoutput_filenamet
output_dirR�R�truntime_library_dirstexport_symbolsR't
extra_preargsR�t
build_tempttarget_langtlib_optsR�tld_argstlinkerR�R�((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pytlinkysB	





cCs�|dkrdSt|�r�|jd�rK|d}t||�}|�S|jd�r�|d}|j|}|r|dSdSq�|jd�r�|d}t|d|�}|�Sn|�SdS(	Nsself.isexe.iisflags.iR�(RcRR�R�R`(RfR�t	hook_namethooktvar((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pyR]�s$




N(sexe.compiler_f77R*R+N(sexe.compiler_f90R-R.N(sexe.compiler_fixR-R.N(sexe.version_cmdNNN(s
exe.linker_sosLDSHAREDR3N(sexe.linker_exeR5R6N(NsARsarN(NsRANLIBR:N((TRRt__doc__RRcR R[R^RR_tlanguage_maptlanguage_orderR�tcompiler_aliasestversion_patternR�R`tsuggested_f90_compilerR�R�RR�R�R�tsrc_extensionst
obj_extensionRtshared_lib_extensiontstatic_lib_extensiontstatic_lib_formattshared_lib_formatt
exe_extensionR�Rbt
c_compilerR�R�RZRoRaRtR0R)R,R/R1R4R7R:RwR{RuR�R�R�R�R�R�R�R�R�R�R�R�R�R�tget_flags_opt_f77tget_flags_opt_f90tget_flags_arch_f77tget_flags_arch_f90tget_flags_debug_f77tget_flags_debug_f90R�R�RdR�R�R�R�R�R�R�RR](((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pyR?s�	









												O													


		e		2				+twin32tgnutintelvtabsofttcompaqvtintelevtgnu95tg95tintelvemtintelemscygwin.*slinux.*tinteltlaheytpgtnagtvasttcompaqtinteletpathf95sdarwin.*tibmssunos.*tsunsirix.*tmipssaix.*tposixtnttmacc
	CsXddlm}tdk	r dStjjtjjt�d�}iaiax||�D]�}tjj	tjj
|��\}}d|}t|�tj
|}t|d�rZx�|jD]�}t||�}|j||jf}|t|j<xQ|jD]F}	|	tkr;td|	|jt|	djf��n|t|	<q�Wq�WqZqZWdS(	scCache all the FCompiler classes found in modules in the
    numpy.distutils.fcompiler package.
    i����(tglobNs*.pysnumpy.distutils.fcompiler.t	compilerss#alias %r defined for both %s and %si(RAtfcompiler_classRcR�R�R�Rt__file__tfcompiler_aliasestsplitextR�t
__import__R�tmodulesR�RBR�R�tdescriptionRR|R(
RAtpystfnametmodule_nameR�tmoduletcnametklasstdesctalias((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pytload_all_fcompiler_classes�s,!$



	c	Cs�ddlm}|dt�}x^|D]V}d}y�td|d|d|�}	|	j|�|	j�}|r�|	jdkr�d}|	j}
|
r�t	j
d||
f�td|d|
d|�}	|	j|�|	j�}|dk	r�|
}q�q�n|r'|	jdkr'td|	jj
��nWnAtk
rKt	jd	|�n!tk
rkt	jd
|�nX|dk	r&|Sq&WdS(Ni����(tget_distributiontalwaystplatR�R"s?Trying %r compiler as suggested by %r compiler for f90 support.s2%s does not support compiling f90 codes, skipping.sH_find_existing_fcompiler: compiler_type='%s' raised DistutilsModuleErrors6_find_existing_fcompiler: compiler_type='%s' not found(tnumpy.distutils.coreRSR�RcRR�R�R,RRR�R|RkRRR'R(tcompiler_typestosnameR�t
requiref90R"RSR�R�RzR�tnew_compiler((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pyt_find_existing_fcompiler�s@
	
			


cCs�|dkrtj}n|dkr0tj}ng}xhtD]`\}}tj||�smtj||�r=x-|D]"}||krt|j|�qtqtWq=q=W|s�|jd�n|S(NR*(	RcR�R�R�R�t_default_compilerstretmatchR�(RXR�tmatching_compiler_typestpatternR�tct((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pyt!available_fcompilers_for_platforms$
c
Cs7t||�}t|d|d|d|d|�}|S(sIDetermine the default Fortran compiler to use for the given
    platform.RXR�RYR"(RbR[(RXR�RYR"R_R�((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pytget_default_fcompiler$s			icCstr
d
St�|d
kr)tj}n|d
krPt|d|d|�}n|tkrrt|\}}}	n}|tkr�t|\}}}	n[d|}
|d
k	r�|
d|}
|
ddjtj	��}
nt
j|
�tad
S|d|d|d	|�}||_
|S(shGenerate an instance of some FCompiler subclass for the supplied
    platform/compiler combination.
    RYR"s7don't know how to compile Fortran code on platform '%s's with '%s' compiler.s Supported compilers are: %s)t,R(tdry_runR�N(tfailed_fcompilerRcRRR�R�RcRCRER�R�RR�R�R"(RUR�R(ReR�RYR"RLROtlong_descriptionR�((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pyR4s.

	c
Cs�|dkr�ddlm}ddlm}|�}tjjtj	d�|_
dgtj	d|_y|jjd�Wnt
k
r�nX||jd<|j�|j�ng}g}g}ts�t�nt�}x|D]�}d}tjd�y5td	|d
|j�}	|	j|�|	j�}WnGttfk
r}t�}
tjd|f�tjt|
��nX|dkr�|jd|dt|d
f�q�|	j �|jd|dt|d
d|f�q�Wt!t"tj#��t"|��}g|D]!}d|dt|d
f^q}|j$�|j$�|j$�t%|�}|j&d�t%|�}|j&d�|r�t%|�}|j&d�ndGHdS(sbPrint list of available compilers (used by the "--help-fcompiler"
    option to "config_fc").
    i����(tDistribution(R$iR$is--help-fcompileri����R�R(sshow_fcompilers: %s not founds
fcompiler=is (%s)sFortran compilers found:s5Compilers available for this platform, but not found:s)Compilers not available on this platform:s>For compiler details, run 'config_fc --verbose' setup command.N('Rctdistutils.distRht'numpy.distutils.command.config_compilerR$R�R�R�R�targvtscript_nametscript_argstremoveR|tcmdclasstparse_config_filestparse_command_lineRCRRRbRt
set_verbosityRR(R�R�RRRR'R�R�R�tlistR�R�R�Rt
print_help(
R�RhR$RBtcompilers_natcompilers_nitplatform_compilersR�RzR�RitfcR�((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pyRZsd	




	


	
"+




cCs4tdd�\}}|jd�|j�|d S(Ntsuffixs.fs#      subroutine dummy()
      end
i����(Rtwritetclose(tfoR�((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pyR�s

s.*[.](for|ftn|f77|f)\Zs-[*]-\s*fortran\s*-[*]-s-[*]-\s*f90\s*-[*]-s-[*]-\s*fix\s*-[*]-s[^c*!]\s*[^\s\d\t]cCs�d}t|d�}|j�}d}t|�r<d}nt|�rWd}d}nx�|dkr�|r�|j�}|r�|ddkr�|d8}|ddkr�t|d �s�|dd	kr�d}Pq�n|j�}qZW|j�|S(
s(Check if file is in free format Fortran.itri'it!s	ii����t&(Rtreadlinet
_has_f_headert_has_f90_headertrstript_free_f90_startR{(tfiletresulttftlinetn((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pyR��s&		
0
cCs;t|d�}|j�}|j�t|�p:t|�S(NR}(RR�R{R�t_has_fix_header(R�R�R�((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pyR��s
s=(c|)f77flags\s*\(\s*(?P<fcname>\w+)\s*\)\s*=\s*(?P<fflags>.*)cCs�i}t|d�}d}x�|j�D]u}|d7}|dkrHPntj|�}|scq(n|jd�j�}|jd�j�}t|�||<q(W|j�|S(s�
    Search the first 20 lines of fortran 77 code for line pattern
      `CF77FLAGS(<fcompiler type>)=<f77 flags>`
    Return a dictionary {<fcompiler type>:<f77 flags>}.
    R}iiitfcnameRT(Rt	readlinest_f77flags_reR^tgroupR�R
R{(R�RRR�tiR�tmR�RT((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pyR��s

t__main__(MRt__all__R�R�R]ttypesR�t	NameErrortsetsRtnumpy.compatRtdistutils.sysconfigRtdistutils.fancy_getoptRtdistutils.errorsRR	R
RRtdistutils.utilR
Rtnumpy.distutils.ccompilerRRtnumpy.distutilsRtnumpy.distutils.misc_utilRRRRRtnumpy.distutils.environmentRtnumpy.distutils.exec_commandRtnumpy.distutils.compatRttypet
__metaclass__t	ExceptionRRR R"RR\RcRCRERRRdR[RbRcRfRRRtcompiletIR^R�tsearchR�R�R�R�R�R�R�R�R(((sH/usr/lib64/python2.7/site-packages/numpy/distutils/fcompiler/__init__.pyt<module>s�		
((			���!	"	
 =