%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib64/python3.9/site-packages/numpy/distutils/fcompiler/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib64/python3.9/site-packages/numpy/distutils/fcompiler/__pycache__/__init__.cpython-39.pyc

a

z[ycW��@s�dZgd�ZddlZddlZddlZddlmZddlmZddl	m
Z
mZmZm
Z
mZddlmZmZddlmZmZdd	lmZdd
lmZmZmZmZmZddlmZddlmZd
dl m!Z!e"Z#Gdd�de$�Z%dd�Z&dd�Z'dd�Z(Gdd�de�Z)dZ*da+da,dd�Z-d6dd�Z.d7dd �Z/d8d!d"�Z0e1�a2d9d#d$�Z3d:d%d&�Z4d'd(�Z5e�6d)ej7�j8Z9e�6d*ej7�j:Z;e�6d+ej7�j:Z<e�6d,ej7�j:Z=e�6d-ej7�j8Z>d.d/�Z?d0d1�Z@e�6d2ej7�ZAd3d4�ZBeCd5k�r�e4�dS);a�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.

)�	FCompiler�
new_fcompiler�show_fcompilers�dummy_fortran_file�N)�get_python_lib)�FancyGetopt)�DistutilsModuleError�DistutilsExecError�CompileError�	LinkError�DistutilsPlatformError)�split_quoted�	strtobool)�	CCompiler�gen_lib_options)�log)�	is_string�all_strings�is_sequence�make_temp_file�get_shared_lib_extension��find_executable)�_shell_utils�)�EnvironmentConfigc@seZdZdS)�CompilerNotFoundN)�__name__�
__module__�__qualname__�r r �H/usr/lib64/python3.9/site-packages/numpy/distutils/fcompiler/__init__.pyr(srcCst|�rt|�S|SdS�N)rr
��sr r r!�flaglist+sr%cCst|�rt|�St|�Sr")rr�boolr#r r r!�str2bool1sr'cCst|�ot|�Sr")rr)�seqr r r!�is_sequence_of_strings6sr)c@s^eZdZdZeddddedfdddedfdddedfdddedfd	�Zedd
ddd
ddddd�	Zeddddedfdddedfdddedfdddedfddd edfd!ddedfd"ddedfd#d$d%edfd&ddedfd'ddedfd(d)d*edfd+ddedfd,ddedfd-d.d/edfd0d1d2edfd3d1d2edfd4d5d6edfd7�Z	d8d8d8d8d8d9d9d9d:�Z
d9d8gZdZd;Z
dZgZd8d<gd8gd9gd9d=gd9d>gd9gd?d@gddA�ZdZdBZdCZdCZdZdDZgZgdE�ZdFZe�ZdGZdHZdIZdJZiZ gdA�Z!dZ"gZ#gZ$dKdL�Z%dMdN�Z&dOdP�Z'dQdR�Z(e(dS�Z)e(dT�Z*e(dU�Z+e(dV�Z,e(dW�Z-e(dX�Z.e(dY�Z/e(dZ�Z0d[d\�Z1d]d^�Z2d_d`�Z3dadb�Z4dcdd�Z5dedf�Z6dgdh�Z7didj�Z8dkdl�Z9dmdn�Z:dodp�Z;dqdr�Z<dsdt�Z=dudv�Z>dwdx�Z?dydz�Z@d{d|�ZAe?ZBZCe@ZDZEeAZFZGd}d~�ZHdd��ZIdd�gfd�d��ZJd�d�d��ZKd�d��ZLd�d��ZMd�d��ZNd�d��ZOd�d��ZPd�d�d��ZQd�d��ZRd�d��ZSd�d��ZTdS)�ra0Abstract 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
    �	config_fcN�nooptF�noarch�debug�verbose)�distutils_sectionr+r,r-r.)zexe.compiler_f77ZF77Zf77execNF)zexe.compiler_f90�F90�f90execNF)zexe.compiler_fixr0r1NF)zexe.version_cmdNNNF)z
exe.linker_soZLDSHAREDZldsharedNF)zexe.linker_exeZLDZldNF)NZAR�arNF)NZRANLIB�ranlibNF)	r/�compiler_f77�compiler_f90�compiler_fix�version_cmd�	linker_so�
linker_exe�archiverr3z	flags.f77ZF77FLAGS�f77flagsTz	flags.f90ZF90FLAGS�f90flagsz
flags.freeZ	FREEFLAGS�	freeflagsz	flags.fixz	flags.optZFOPT�optz
flags.opt_f77z
flags.opt_f90z
flags.archZFARCH�archzflags.arch_f77zflags.arch_f90zflags.debugZFDEBUGZfdebugzflags.debug_f77zflags.debug_f90zself.get_flagsZFFLAGS�fflagszflags.linker_soZLDFLAGSZldflagszflags.linker_exezflags.arZARFLAGS�arflags)r/�f77�f90�free�fixr>Zopt_f77Zopt_f90r?Zarch_f77Zarch_f90r-Z	debug_f77Z	debug_f90�flagsr8r9r2rBrC)�.f�.for�.F�.ftn�.f77�.f90�.F90�.f95r z-vz-fixedz-sharedr2z-cr)r7r4r5r6r8r9r:r3z-cz-o z-I)	rHrJrKrGrLrNrIrMz.FORz.oz.azlib%s%s�%s%s�cOs~tj|g|�Ri|��|j�|j�|_|j�|j�|_|j�|j�|_|j��|_|j	D]}||jvrZd|j|<qZd|_
dS)NF)r�__init__�distutils_vars�clone�_environment_hook�command_vars�	flag_vars�executables�copy�_executable_keys�_is_customised)�self�args�kw�er r r!rQ�s

zFCompiler.__init__cCsZ|�|j�}|j�|j�|j�|j�|_|j�|j�|_|j�|j�|_|j	�
�|_	|Sr")�__new__�	__class__�__dict__�updaterRrSrTrUrVrWrX)r[�objr r r!�__copy__�szFCompiler.__copy__cCs|��Sr")rd�r[r r r!rX�szFCompiler.copycs�fdd�}t|d�S)Ncs|js
J�|j�Sr")rZrWre��keyr r!�fget�s
z)FCompiler._command_property.<locals>.fget)rh)�property)rgrhr rfr!�_command_property�szFCompiler._command_propertyr7r4r5r6r8r9r:r3cCs|�||�dSr")�set_command�r[rg�valuer r r!�set_executableszFCompiler.set_executablecKs"|��D]\}}|�||�qdSr")�itemsrk)r[r]�k�vr r r!�set_commandsszFCompiler.set_commandscCs`||jvrtd||jjf��t|�r.t|�}|dusRt|dd��sRJ||f��||j|<dS)Nz$unknown executable '%s' for class %sr)rY�
ValueErrorr`rrr
r)rWrlr r r!rk	s

��$zFCompiler.set_commandcs��js
J��j��fdd���fdd�}d��fdd�	}�j}|d�}|st|d	�}|rft�d
|�q�td|��n*|d	|d�}|s�t�d
|�|d|d�|d||d�|d||d�|d||d�|d�|d�dS)a3Go through the self.executables dictionary, and attempt to
        find and assign appropriate 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 overridden.
        cs,|�vr�|St|�}|�|<�|<|Sr"r)�exe�fc_exe)�	exe_cacher r!�cached_find_executable(s
z:FCompiler.find_executables.<locals>.cached_find_executablecs*|dur&t|�s&td||�jjf��dS)Nz"%s value %r is invalid in class %s)r)rsr`r)�namermrer r!�verify_command_form.s��z7FCompiler.find_executables.<locals>.verify_command_formNcs��j�|d�}|sdSt�j|�}|s6||g�j}n|g�j}t�}g}|D]@}|dkrb|}n|dkrn|}|rP||vr|qP|�|�|�|�qP|D] }	�|	�}
|
r�|
|d<|
Sq���|d�dS)Nz<F77>z<F90>r)	rW�get�getattrrU�possible_executables�set�add�appendrk)Zexe_keyrBrC�cmdZexe_from_environZ	possibles�seenZunique_possiblesr^rtru)rwr[r r!�set_exe3s2

z+FCompiler.find_executables.<locals>.set_exer5r4z %s: no Fortran 90 compiler foundz%s: f90 nor f77)rCz %s: no Fortran 77 compiler foundr6r8)rBrCr9r7r:r3)NN)rZ�
_exe_cache�
compiler_typer�warnr)r[ryr�ZctyperCrBr )rwrvr[r!�find_executabless*
 zFCompiler.find_executablescCsdS)aqCalled 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.
        Nr rer r r!�update_executablesgs	zFCompiler.update_executablescCs
g|jS)z+List of flags common to all compiler types.)�	pic_flagsrer r r!�	get_flagsrszFCompiler.get_flagscCs&|j�|d�}|durgS|dd�S)Nr)rWrz)r[rgr�r r r!�_get_command_flagsvszFCompiler._get_command_flagscCs
|�d�S)z"List of Fortran 77 specific flags.r4�r�rer r r!�
get_flags_f77|szFCompiler.get_flags_f77cCs
|�d�S)z"List of Fortran 90 specific flags.r5r�rer r r!�
get_flags_f90szFCompiler.get_flags_f90cCsgS)z.List of Fortran 90 free format specific flags.r rer r r!�get_flags_free�szFCompiler.get_flags_freecCs
|�d�S)z/List of Fortran 90 fixed format specific flags.r6r�rer r r!�
get_flags_fix�szFCompiler.get_flags_fixcCs
|�d�S)z/List of linker flags to build a shared library.r8r�rer r r!�get_flags_linker_so�szFCompiler.get_flags_linker_socCs
|�d�S)z,List of linker flags to build an executable.r9r�rer r r!�get_flags_linker_exe�szFCompiler.get_flags_linker_execCs
|�d�S)zList of archiver flags. r:r�rer r r!�get_flags_ar�szFCompiler.get_flags_arcCsgS)z0List of architecture independent compiler flags.r rer r r!�
get_flags_opt�szFCompiler.get_flags_optcCsgS)z.List of architecture dependent compiler flags.r rer r r!�get_flags_arch�szFCompiler.get_flags_archcCsgS)z=List of compiler flags to compile with debugging information.r rer r r!�get_flags_debug�szFCompiler.get_flags_debugcCs|jdd�S)zList of compiler libraries.N)�	librariesrer r r!�
get_libraries�szFCompiler.get_librariescCs|jdd�S)z%List of compiler library directories.N)�library_dirsrer r r!�get_library_dirs�szFCompiler.get_library_dirsrcCs,|js
J�tj|||d�}|dur(t��|S)N)�force�	ok_status)rZr�get_versionr)r[r�r��versionr r r!r��s

zFCompiler.get_versioncs�t�d�jj�d�_�j�|��j�|��j�|���	���
��j�dd�}�j�d|�}�j�dd�}�jj��jj
�g�g�g}g��r�tj�����jj��r�tj�����jj��jj}�jj��r�tj�����jj��ggg}}}�������fdd�}	|�s:|	d	|�|�s:|	d
|�|�rJ|	d|��jj|||}
��rx�j��|
d���r��j�|�|
d���r��j��|
d
��j}|�rr�jj}tj�d��rtdd�}
tj�|
dd�}tj�|
dd�}|g|d|g}tj�d��rbddl m!}|d�}tj�|d�}tj�|d�}|g|d|g}�j||d��j"}|�r��jj"}�j||d��jj#}|�r��jj$}�j|g|d���%��&����'��(��dS)a�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).
        zcustomize %sTr+Fr,r-cs�|�t�j|��t�d|�}d��fd��fd��ffD]>\}}}d||f}|r<|t�d|�ur<|�t�j|��q<dS)N�
get_flags_rBrCz%s_%s)�extendr{rV)�tagrFZthis_getrx�cZflagvar�t�rBr;rCr<rEZfixflagsr[r r!r��s�z&FCompiler.customize.<locals>.get_flagsr>r?)r4)r5)r6Zaixr)Zstandard_libZconfig�	ld_so_aixz
python.expz-bI:Zos400r)�get_config_varZLIBPL)r8)r9)r:N))r�infor`rrZrRZuse_distributionrUrVr�r�rzr4r5rZNativeParser�splitrBrCrDr6rErFrrr8�sys�platform�
startswithr�os�path�join�distutils.sysconfigr�r9r:r2Zset_library_dirsr�Z
set_librariesr�)r[�distr+r,r-r=ZoflagsZaflagsZdflagsr�r@r8Zlinker_so_flagsZ
python_libr�Z
python_expr�Z
python_configr9Zlinker_exe_flagsr2rAr r�r!�	customize�s�




zFCompiler.customizecCs�g}t|j���gd�D]0}t||�rt||�}|�|ddt|�f�q|��t|�}|�	d|j
j�D],}|dd�dkr�d|dd�}t|�qndS)z0Print out the attributes of a compiler instance.)r�r�r��
object_switch�compile_switchNz= z%s instance properties:�z  --z  )
�listrW�keys�hasattrr{r�repr�sortrZ
generate_helpr`r�print)r[Zpropsrgrq�pretty_printer�lr r r!�dump_properties's�

�
zFCompiler.dump_propertiesc
Cs�i}t|�r2t|�s2d}|j}	t|�}|jp.g}
njt|�rld}|j}	|	dur`td|jj	|f��|j
phg}
n0d}|j}	|	dur�td|jj	|f��|j
p�g}
|jddkr�|j�
�|g}n|j�
�|g}|j�
�s�J�|j|g}|
�rt�d	|d
d�d�|
�f�|�|jg�}
|
�r0t�dd�|
��|	||
||||
}dtj�|	d
�||f}z|j||d�Wn8t�y�}zt|�}t|�d�WYd}~n
d}~00dS)zCompile 'src' to product 'obj'.z:f77z:f90Nz%f90 not supported by %s needed for %sz:fixz-f90 (fixed) not supported by %s needed for %s���� zextra %s options: %rrz%using compile options from source: %rz%s: %sr)�display)�	is_f_file�has_f90_headerr4�get_f77flags�extra_f77_compile_args�is_free_formatr5r	r`r�extra_f90_compile_argsr6r��stripr�rr�r�rzr�r�r��basename�spawn�strr
)r[rc�src�extZcc_args�extra_postargsZpp_optsZ	src_flagsZflavor�compilerZextra_compile_args�o_args�s_args�extra_flags�commandr�r^�msgr r r!�_compile;s`
�
�

�����zFCompiler._compilecCs�g}|jdurH|jddkr2|�|j��|g�qb|�|j��|�ntd|�td|jj�|jdur�|g|D]}|�d|j|f�qvntd|�td|jj�|S)Nr�r�z'XXX: module_build_dir=%r option ignoredzXXX: Fix module_dir_switch for rOz"XXX: module_dirs=%r option ignoredz#XXX: Fix module_include_switch for )�module_dir_switchr�r�rr�r`r�module_include_switch)r[Zmodule_dirsZmodule_build_dir�options�dr r r!�module_optionsms

zFCompiler.module_optionscCsd|S)Nz-lr )r[�libr r r!�library_optionszFCompiler.library_optioncCsd|S)Nz-Lr )r[�dirr r r!�library_dir_option�szFCompiler.library_dir_optionc
Cs�|�||�\}}|�|||�\}}}t||||�}t|�rJtj�||�}n|durZtd��|�||��r�|j	ddkr�|j	�
�|g}n|j	�
�|g}t|j�r�||jg}n
||j}|||}|	r�dg|dd�<|
r�|
|dd�<|r�|�|�|�
tj�|��|tjk�r"|jdd�}n|jdd�}||}z|�|�Wn8t�y~}zt|�}t|�d�WYd}~n
d}~00nt�d|�dS)Nz%'output_dir' must be a string or Noner�r�z-grzskipping %s (up-to-date))Z_fix_object_argsZ
_fix_lib_argsrrr�r�r��	TypeErrorZ
_need_link�library_switchr��objectsr�Zmkpath�dirnamerZ
EXECUTABLEr9r8r�r	r�rrr-)r[Ztarget_descr�Zoutput_filename�
output_dirr�r�Zruntime_library_dirsZexport_symbolsr-Z
extra_preargsr�Z
build_tempZtarget_langZlib_optsr�Zld_argsZlinkerr�r^r�r r r!�link�sF��


"zFCompiler.linkcCs�|durdSt|�r�|�d�r:|dd�}t||�}|�S|�d�rl|dd�}|j|}|rf|dSdSq�|�d�r�|dd�}t|d|�}|�Sn|�SdS)	Nzself.�zexe.r�rzflags.�r�)rr�r{rW)r[rxZ	hook_name�hook�varr r r!rT�s$




zFCompiler._environment_hookcCsdS)zc
        Check if the given C compiler can link objects produced by
        this compiler.
        Tr )r[Z	ccompilerr r r!�can_ccompiler_link�szFCompiler.can_ccompiler_linkcCs
t��dS)a�
        Convert a set of object files that are not compatible with the default
        linker, to a file that is compatible.

        Parameters
        ----------
        objects : list
            List of object files to include.
        output_dir : str
            Output directory to place generated object files.
        extra_dll_dir : str
            Output directory to place extra DLL files that need to be
            included on Windows.

        Returns
        -------
        converted_objects : list of str
             List of converted object files.
             Note that the number of output files is not necessarily
             the same as inputs.

        N)�NotImplementedError)r[r�r�Z
extra_dll_dirr r r!�wrap_unlinkable_objects�sz!FCompiler.wrap_unlinkable_objects)N)
NNNNNrNNNN)Urrr�__doc__rr'rRrUr%rVZlanguage_mapZlanguage_orderr��compiler_aliasesZversion_patternr|rW�suggested_f90_compilerr�r�r�r�r�r�Zsrc_extensionsZ
obj_extensionrZshared_lib_extensionZstatic_lib_extensionZstatic_lib_formatZshared_lib_formatZ
exe_extensionr�rY�
c_compilerr�r�rQrdrXrjr7r4r5r6r8r9r:r3rnrrrkr�r�r�r�r�r�r�r�r�r�r�r�r�r�Zget_flags_opt_f77Zget_flags_opt_f90Zget_flags_arch_f77Zget_flags_arch_f90Zget_flags_debug_f77Zget_flags_debug_f90r�r�r�r�r�r�r�r�r�r�rTr�r�r r r r!r9s(����	�	O
u2�
/r)
)�win32)
�gnu�intelv�absoft�compaqv�intelev�gnu95�g95Zintelvem�intelemZflang)zcygwin.*)r�r�r�r�r�r�r�)zlinux.*)Zarmr��intelZlahey�pg�nvr��nagZvastZcompaqZinteler�r�r�Zpathf95�nagforZfujitsu)zdarwin.*)	r�r�r�r��ibmr�r�r�r�)zsunos.*)Zsunr�r�r�)zirix.*)Zmipsr�r�)zaix.*)r�r�r�)�posix�r�r�)�ntr�)Zmac)r�r�r�c
	Cs�ddlm}tdurdStj�tj�t�d�}iaia||�D]�}tj�tj�	|��\}}d|}t
|�tj|}t
|d�r>|jD]`}t||�}|j||jf}|t|j<|jD]2}	|	tvr�td|	|jt|	djf��|t|	<q�q�q>dS)	zcCache all the FCompiler classes found in modules in the
    numpy.distutils.fcompiler package.
    r)�globNz*.pyznumpy.distutils.fcompiler.�	compilersz#alias %r defined for both %s and %sr)r�fcompiler_classr�r�r�r��__file__�fcompiler_aliases�splitextr��
__import__r��modulesr�rr{r��descriptionr�rsr)
rZpys�fname�module_namer��moduleZcname�klassZdesc�aliasr r r!�load_all_fcompiler_classess0





��rFc	Csddlm}|dd�}|D]�}d}z�t|||d�}	|	�|�|	��}|r�|	jdur�d}|	j}
|
r�t�d||
f�t||
|d�}	|	�|�|	��}|dur�|
}|r�|	jdur�t	d|	j
j��Wn:ty�t�
d|�Ynty�t�
d	|�Yn0|dur|SqdS)
Nr)�get_distributionT)�always)�platr�r�z?Trying %r compiler as suggested by %r compiler for f90 support.z2%s does not support compiling f90 codes, skipping.zH_find_existing_fcompiler: compiler_type='%s' raised DistutilsModuleErrorz6_find_existing_fcompiler: compiler_type='%s' not found)Znumpy.distutils.corerrr�r�r5r�rr�rsr`rrr-r)Zcompiler_types�osnamer��
requiref90r�rr�r�rqr�Znew_compilerr r r!�_find_existing_fcompilersJ
�
���
�

rcCst|durtj}|durtj}g}tD]<\}}t�||�sDt�||�r$|D]}||vrH|�|�qHq$|sp|�d�|S)Nr�)r�rxr�r��_default_compilers�re�matchr)rr��matching_compiler_types�patternr�Zctr r r!�!available_fcompilers_for_platformBs
rcCs,t||�}t�d|�t|||||d�}|S)zIDetermine the default Fortran compiler to use for the given
    platform.z+get_default_fcompiler: matching types: '%s')rr�rr�)rrr�r)rr�rr�rr�r r r!�get_default_fcompilerQs���rcCs�||f}|tvrdSt�|dur(tj}|dur>t|||d�}|tvrVt|\}}	}
nb|tvrnt|\}}	}
nJd|}|dur�|d|}|dd�t���}t	�
|�t�|�dS|	|||d�}||_|S)zhGenerate an instance of some FCompiler subclass for the supplied
    platform/compiler combination.
    N)rr�z7don't know how to compile Fortran code on platform '%s'z with '%s' compiler.z Supported compilers are: %s)�,)r.�dry_runr�)
�failed_fcompilersrr�rxrrrr�r�rr�r~r�)rr�r.rr�rr�Z
fcompiler_keyr
rZlong_descriptionr�r r r!rcs4��

rcCs
|dur�ddlm}ddlm}|�}tj�tjd�|_	dgtjdd�|_
z|j
�d�WntyrYn0||j
d<|��|��g}g}g}ts�t�t�}|D]�}d}t�d�z$t||jd	�}	|	�|�|	��}WnHttf�y,}
z*t�d
|f�t�t|
��WYd}
~
n
d}
~
00|du�rV|�d|dt|df�q�|	��|�d|dt|dd
|f�q�tt t�!��t |��}dd�|D�}|�"�|�"�|�"�t#|�}|�$d�t#|�}|�$d�|�r�t#|�}|�$d�t%d�dS)zbPrint list of available compilers (used by the "--help-fcompiler"
    option to "config_fc").
    Nr)�Distribution)r*r*rz--help-fcompiler���)r�r.zshow_fcompilers: %s not found�
fcompiler=�z (%s)cSs"g|]}d|dt|df�qS)r!Nr")r)�.0Zfcr r r!�
<listcomp>�s�z#show_fcompilers.<locals>.<listcomp>zFortran compilers found:z5Compilers available for this platform, but not found:z)Compilers not available on this platform:z>For compiler details, run 'config_fc --verbose' setup command.)&Zdistutils.distrZ'numpy.distutils.command.config_compilerr*r�r�r�r��argv�script_nameZscript_args�removersZcmdclassZparse_config_filesZparse_command_linerrrrZ
set_verbosityrr.r�r�rrr-r�rr�r�r}r�r�r�
print_helpr�)r�rr*rZcompilers_naZcompilers_niZplatform_compilersr�rqr�r^r�r r r!r�sh


$

���


rcCs,tdd�\}}|�d�|��|dd�S)NrG)�suffixz#      subroutine dummy()
      end
r )r�write�close)�forxr r r!r�s
rz.*\.(for|ftn|f77|f)\Zz-\*-\s*fortran\s*-\*-z-\*-\s*f90\s*-\*-z-\*-\s*fix\s*-\*-z[^c*!]\s*[^\s\d\t]cCs�d}t|dd���}|��}d}t|�s.t|�r4d}nt|�rDd}d}|dkr�|r�|��}|r�|ddkr�|d8}|ddkr�t|dd	��s�|d
d�dkr�d}q�|��}qDWd�n1s�0Y|S)z(Check if file is in free format Fortran.r�latin1��encodingi'r�!�	Nr�r��&)�open�readline�
_has_f_header�_has_fix_header�_has_f90_header�rstrip�_free_f90_start)�file�result�f�line�nr r r!r��s$,(r�cCsDt|dd��}|��}Wd�n1s*0Yt|�pBt|�S)Nr-r.)r3r4r7r6)r�r<r=r r r!r��s&r�z=(c|)f77flags\s*\(\s*(?P<fcname>\w+)\s*\)\s*=\s*(?P<fflags>.*)cCs�i}t|dd��j}d}|D]P}|d7}|dkr2qlt�|�}|sBq|�d���}|�d���}t|�||<qWd�n1s�0Y|S)	z�
    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-r.rr��fcnamer@N)r3�_f77flags_rer�groupr�r
)r�rFr<�ir=�mr@r@r r r!r��s
,r��__main__)NNFN)NN)NNFN)NNrrrFN)N)Dr��__all__r�r�rr�rZdistutils.fancy_getoptrZdistutils.errorsrr	r
rrZdistutils.utilr
rZnumpy.distutils.ccompilerrrZnumpy.distutilsrZnumpy.distutils.misc_utilrrrrrZnumpy.distutils.exec_commandrrZenvironmentr�typeZ
__metaclass__�	Exceptionrr%r'r)rrrrrrrrr}rrrr�compile�Irr��searchr5r7r6r9r�r�rAr�rr r r r!�<module>sv7�
%
�
�
'
<


Zerion Mini Shell 1.0