HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/numpy/distutils/fcompiler/__pycache__/__init__.cpython-310.pyc
o

6��a���@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/		d6d!d"�Z0e1�a2							d8d#d$�Z3d9d%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�ZBeCd5kr�e4�dSdS):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 �D/usr/lib/python3/dist-packages/numpy/distutils/fcompiler/__init__.pyr(srcCst|�rt|�S|S�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_strings6�r)c@s�eZdZdZeddddedfdddedfdddedfdddedfd	�Zedd
ddd
ddddd�	ZedGidd�ddddedf�ddddedf�dddd edf�d!d"ddedf�d#d$d%d#edf�d&d'ddedf�d(d)ddedf�d*d+d,d*edf�d-d.ddedf�d/d0ddedf�dd1d2d3edf�d4d5ddedf�d6d7ddedf�d8d9d:d;edf�d<d=d>d?edf�d@dAd>d?edf�dBdCdDdEedf��Z	dddddddddF�Z
ddgZdZdGZ
dZgZddHgdgdgddIgddJgdgdBdKgddL�ZdZdMZdNZdNZdZdOZgZgdP�ZdQZe�ZdRZdSZdTZdUZiZ gdL�Z!dZ"gZ#gZ$dVdW�Z%dXdY�Z&dZd[�Z'd\d]�Z(e(d^�Z)e(d_�Z*e(d`�Z+e(da�Z,e(d<�Z-e(d@�Z.e(db�Z/e(dc�Z0ddde�Z1dfdg�Z2dhdi�Z3djdk�Z4dldm�Z5dndo�Z6dpdq�Z7drds�Z8dtdu�Z9dvdw�Z:dxdy�Z;dzd{�Z<d|d}�Z=d~d�Z>d�d��Z?d�d��Z@d�d��ZAe?ZBZCe@ZDZEeAZFZGd�d��ZHd�d��ZIdd�gfd�d��ZJd�d�d��ZKd�d��ZLd�d��ZMd�d��ZNd�d��ZOd�d��ZP				d�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_f77�F77�f77execNF)zexe.compiler_f90�F90�f90execNF)zexe.compiler_fixr3r4NF)zexe.version_cmdNNNF)z
exe.linker_so�LDSHARED�ldsharedNF)zexe.linker_exe�LD�ldNF)N�AR�arNF)N�RANLIB�ranlibNF)	r0�compiler_f77�compiler_f90�compiler_fix�version_cmd�	linker_so�
linker_exe�archiverr<r0�f77z	flags.f77�F77FLAGS�f77flagsT�f90z	flags.f90�F90FLAGS�f90flags�freez
flags.free�	FREEFLAGS�	freeflags�fixz	flags.fix�optz	flags.opt�FOPT�opt_f77z
flags.opt_f77�opt_f90z
flags.opt_f90�archz
flags.arch�FARCH�arch_f77zflags.arch_f77�arch_f90zflags.arch_f90zflags.debug�FDEBUG�fdebug�	debug_f77zflags.debug_f77�	debug_f90zflags.debug_f90�flagszself.get_flags�FFLAGS�fflagsrAzflags.linker_so�LDFLAGS�ldflagsrBzflags.linker_exer:zflags.ar�ARFLAGS�arflags)�.f�.for�.F�.ftn�.f77�.f90�.F90�.f95r z-vz-fixedz-sharedz-cr)r@r=r>r?rArBrCr<z-cz-o z-I)	rbrdrerarfrhrcrgz.FORz.oz.azlib%s%s�%s%s�cOs~tj|g|�Ri|��|j�|j�|_|j�|j�|_|j�|j�|_|j��|_|j	D]}||jvr9d|j|<q-d|_
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!rk�s


�
zFCompiler.__init__cCsZ|�|j�}|j�|j�|j�|j�|_|j�|j�|_|j�|j�|_|j	�
�|_	|Sr")�__new__�	__class__�__dict__�updaterlrmrnrorprqrr)ru�objr r r!�__copy__�szFCompiler.__copy__cCs|��Sr")r~�rur r r!rr��zFCompiler.copycs�fdd�}t|d�S)Ncs|jsJ�|j�Sr")rtrqr��keyr r!�fget�s

z)FCompiler._command_property.<locals>.fget)r�)�property)r�r�r r�r!�_command_property�s
zFCompiler._command_propertyr@r=r>r?rCr<cCs|�||�dSr")�set_command�rur��valuer r r!�set_executabler*zFCompiler.set_executablecKs"|��D]
\}}|�||�qdSr")�itemsr�)rurw�k�vr r r!�set_commandss�zFCompiler.set_commandscCs`||jvrtd||jjf��t|�rt|�}|dus)t|dd��s)J||f��||j|<dS)Nz$unknown executable '%s' for class %sr)rs�
ValueErrorrzrrr
r)rqr�r r r!r�	s

��$zFCompiler.set_commandcs��jsJ��j��fdd���fdd�}d��fdd�	}�j}|d�}|s9|d	�}|r3t�d
|�ntd|��|d	|d�}|sHt�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.|durt|�std||�jjf��dSdS)Nz"%s value %r is invalid in class %s)r)r�rzr)�namer�rr r!�verify_command_form.s���z7FCompiler.find_executables.<locals>.verify_command_formNcs��j�|d�}|sdSt�j|�}|s||g�j}n|g�j}t�}g}|D] }|dkr1|}n|dkr7|}|r=||vr>q(|�|�|�|�q(|D]}	�|	�}
|
r[|
|d<|
SqK��|d�dS)Nz<F77>z<F90>r)	rq�get�getattrro�possible_executables�set�add�appendr�)�exe_keyrDrG�cmd�exe_from_environ�	possibles�seen�unique_possiblesrxr�r�)r�rur r!�set_exe3s4
�z+FCompiler.find_executables.<locals>.set_exer>r=z %s: no Fortran 90 compiler foundz%s: f90 nor f77)rGz %s: no Fortran 77 compiler foundr?rA)rDrGrBr@rCr<�NN)rt�
_exe_cache�
compiler_typer�warnr)rur�r��ctyperGrDr )r�r�rur!�find_executabless*
 zFCompiler.find_executablescC�dS)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 rr r r!�update_executablesgs	zFCompiler.update_executablescCs
g|jS)z+List of flags common to all compiler types.)�	pic_flagsrr r r!�	get_flagsr�
zFCompiler.get_flagscCs&|j�|d�}|dur
gS|dd�S)Nr)rqr�)rur�r�r r r!�_get_command_flagsvszFCompiler._get_command_flagscC�
|�d�S)z"List of Fortran 77 specific flags.r=�r�rr r r!�
get_flags_f77|r�zFCompiler.get_flags_f77cCr�)z"List of Fortran 90 specific flags.r>r�rr r r!�
get_flags_f90r�zFCompiler.get_flags_f90cC�gS)z.List of Fortran 90 free format specific flags.r rr r r!�get_flags_free��zFCompiler.get_flags_freecCr�)z/List of Fortran 90 fixed format specific flags.r?r�rr r r!�
get_flags_fix�r�zFCompiler.get_flags_fixcCr�)z/List of linker flags to build a shared library.rAr�rr r r!�get_flags_linker_so�r�zFCompiler.get_flags_linker_socCr�)z,List of linker flags to build an executable.rBr�rr r r!�get_flags_linker_exe�r�zFCompiler.get_flags_linker_execCr�)zList of archiver flags. rCr�rr r r!�get_flags_ar�r�zFCompiler.get_flags_arcCr�)z0List of architecture independent compiler flags.r rr r r!�
get_flags_opt�r�zFCompiler.get_flags_optcCr�)z.List of architecture dependent compiler flags.r rr r r!�get_flags_arch�r�zFCompiler.get_flags_archcCr�)z=List of compiler flags to compile with debugging information.r rr r r!�get_flags_debug�r�zFCompiler.get_flags_debugcC�|jdd�S)zList of compiler libraries.N)�	librariesrr r r!�
get_libraries��zFCompiler.get_librariescCr�)z%List of compiler library directories.N)�library_dirsrr r r!�get_library_dirs�r�zFCompiler.get_library_dirsrcCs,|jsJ�tj|||d�}|durt��|S)N)�force�	ok_status)rtr�get_versionr)rur�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��rWtj�����jj��rgtj�����jj��jj}�jj��rytj�����jj��ggg}}}�������fdd�}	|s�|	d	|�|s�|	d
|�|r�|	d|��jj|||}
�r��j��|
d��rƈj�|�|
d��r҈j��|
d
��j}|�r
�jj}tj�d��rtdd�}
tj�|
dd�}tj�|
dd�}|g|d|g}�j||d��j }|�r�jj }�j||d��jj!}|�r0�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|��qdS)N�
get_flags_rDrGz%s_%s)�extendr�rp)�tagrZ�this_getr��c�flagvar�t�rDrFrGrIrM�fixflagsrur r!r��s���z&FCompiler.customize.<locals>.get_flagsrNrR)r=)r>)r?�aixr)�standard_lib�config�	ld_so_aixz
python.expz-bI:)rA)rB)rCN)'r�inforzrrtrl�use_distributionrorpr�r�r�r=r>r�NativeParser�splitrDrGrJr?rMrZr�rA�sys�platform�
startswithr�os�path�joinrBrCr:�set_library_dirsr��
set_librariesr�)ru�distr,r-r.rL�oflags�aflags�dflagsr�r\rA�linker_so_flags�
python_libr��
python_exprB�linker_exe_flagsr:r`r r�r!�	customize�sz




zFCompiler.customizecCs�g}t|j���gd�D]}t||�r%t||�}|�|ddt|�f�q
|��t|�}|�	d|j
j�D]}|dd�dkrId|dd�}t|�q7dS)z0Print out the attributes of a compiler instance.)r�r�r��
object_switch�compile_switchNz= z%s instance properties:�z  --z  )
�listrq�keys�hasattrr�r��repr�sortr�
generate_helprzr�print)ru�propsr�r��pretty_printer�lr r r!�dump_properties!s"�

�
�
�zFCompiler.dump_propertiesc
Cs�i}t|�rt|�sd}|j}	t|�}|jpg}
n5t|�r6d}|j}	|	dur0td|jj	|f��|j
p4g}
nd}|j}	|	durItd|jj	|f��|j
pMg}
|jddkr]|j�
�|g}n|j�
�|g}|j�
�slJ�|j|g}|
r�t�d	|d
d�d�|
�f�|�|jg�}
|
r�t�dd�|
��|	||
||||
}dtj�|	d
�||f}z
|j||d�WdSty�}z	t|�}t|�d�d}~ww)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_headerr=�get_f77flags�extra_f77_compile_args�is_free_formatr>r	rzr�extra_f90_compile_argsr?r��stripr�rr�r�r�r�r�r��basename�spawn�strr
)rur}�src�ext�cc_args�extra_postargs�pp_opts�	src_flags�flavor�compiler�extra_compile_args�o_args�s_args�extra_flags�commandr�rx�msgr r r!�_compile5sd
�
�

�����
��zFCompiler._compilecCs�g}|jdur$|jddkr|�|j��|g�n|�|j��|�n
td|�td|jj�|jdurJ|g|D]}|�d|j|f�q;|Std|�td|jj�|S)Nr�r�z'XXX: module_build_dir=%r option ignoredzXXX: Fix module_dir_switch for riz"XXX: module_dirs=%r option ignoredz#XXX: Fix module_include_switch for )�module_dir_switchr�r�r�r�rzr�module_include_switch)ru�module_dirs�module_build_dir�options�dr r r!�module_optionsgs

�zFCompiler.module_optionscC�d|S)Nz-lr )ru�libr r r!�library_optionyr�zFCompiler.library_optioncCr)Nz-Lr )ru�dirr r r!�library_dir_option{r�zFCompiler.library_dir_optionc
Cs�|�||�\}}|�|||�\}}}t||||�}t|�r%tj�||�}n|dur-td��|�||�r�|j	ddkrB|j	�
�|g}n|j	�
�|g}t|j�rV||jg}n||j}|||}|	rjdg|dd�<|
rr|
|dd�<|ry|�|�|�
tj�|��|tjkr�|jdd�}n|jdd�}||}z|�|�WdSty�}z	t|�}t|�d�d}~wwt�d|�dS)Nz%'output_dir' must be a string or Noner�r�z-grzskipping %s (up-to-date))�_fix_object_args�
_fix_lib_argsrrr�r�r��	TypeError�
_need_link�library_switchr��objectsr��mkpath�dirnamer�
EXECUTABLErBrArr	rrrr.)ru�target_descr#�output_filename�
output_dirr�r��runtime_library_dirs�export_symbolsr.�
extra_preargsr�
build_temp�target_lang�lib_optsr�ld_args�linkerrrxrr r r!�link~sJ��




��zFCompiler.linkcCs�|durdSt|�rL|�d�r|dd�}t||�}|�S|�d�r5|dd�}|j|}|r3|dSdS|�d�rJ|dd�}t|d|�}|�SdS|�S)	Nzself.�zexe.r�rzflags.�r�)rr�r�rq)rur��	hook_name�hook�varr r r!rn�s&




�zFCompiler._environment_hookcCr�)zc
        Check if the given C compiler can link objects produced by
        this compiler.
        Tr )ru�	ccompilerr r r!�can_ccompiler_link�szFCompiler.can_ccompiler_linkcCst��)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.

        )�NotImplementedError)rur#r)�
extra_dll_dirr r r!�wrap_unlinkable_objects�sz!FCompiler.wrap_unlinkable_objectsr")
NNNNNrNNNN)Urrr�__doc__rr'rlror%rp�language_map�language_orderr��compiler_aliases�version_patternr�rq�suggested_f90_compilerr�r�r"rrr��src_extensions�
obj_extensionr�shared_lib_extension�static_lib_extension�static_lib_format�shared_lib_format�
exe_extensionr�rs�
c_compilerr�r�rkr~rrr�r@r=r>r?rArBrCr<r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��get_flags_opt_f77�get_flags_opt_f90�get_flags_arch_f77�get_flags_arch_f90�get_flags_debug_f77�get_flags_debug_f90r�r�r�r�r�rrrrr2rnr9r<r r r r!r9s((����������	�
���
�������	�	O
o2
�/r)
)�win32)
�gnu�intelv�absoft�compaqv�intelev�gnu95�g95�intelvem�intelem�flang)zcygwin.*)rRrSrTrUrVrWrX)zlinux.*)rW�intel�lahey�pg�nvrT�nag�vast�compaq�intelerZrRrX�pathf95�nagfor�fujitsu)zdarwin.*)rWr`rT�ibmr\rRrXr^)zsunos.*)�sunrRrWrX)zirix.*)�mipsrRrW)zaix.*)rgrRrW)�posix�rRrW)�ntrk)�mac)rWrRr^c
	Cs�ddlm}tdurdStj�tj�t�d�}iaia||�D]T}tj�tj�	|��\}}d|}t
|�tj|}t
|d�rs|jD]0}t||�}|j||jf}|t|j<|jD]}	|	tvrmtd|	|jt|	djf��|t|	<qXqBqdS)	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)rn�fcompiler_classr�r�r�r%�__file__�fcompiler_aliases�splitextr�
__import__r��modulesr�ror�r��descriptionr@r�r)
rn�pys�fname�module_namer�module�cname�klass�desc�aliasr r r!�load_all_fcompiler_classes�s6





��
���rFc	Csddlm}|dd�}|D]x}d}zNt|||d�}	|	�|�|	��}|rO|	jdurOd}|	j}
|
rOt�d||
f�t||
|d�}	|	�|�|	��}|durO|
}|r^|	jdur^t	d|	j
j��Wntynt�
d|�Ynty|t�
d	|�Ynw|dur�|Sq
dS)
Nr)�get_distributionT)�always)�platr
rJz?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)�numpy.distutils.corer�rr�r�r>rBrr�r�rzrrr.r)�compiler_types�osnamer��
requiref90rJr�r�r�r�r��new_compilerr r r!�_find_existing_fcompilersP
�
���
����r�cCst|durtj}|durtj}g}tD]\}}t�||�s"t�||�r0|D]}||vr/|�|�q$q|s8|�d�|S)NrR)r�r�r�r��_default_compilers�re�matchr�)r�r��matching_compiler_types�patternr��ctr r r!�!available_fcompilers_for_platform:s
�
r�cCs,t||�}t�d|�t|||||d�}|S)zIDetermine the default Fortran compiler to use for the given
    platform.z+get_default_fcompiler: matching types: '%s')r�r�r�rJ)r�rr�r�)r�r�r�rJr�r�r r r!�get_default_fcompilerIs���r�cCs�||f}|tvr
dSt�|durtj}|durt|||d�}|tvr+t|\}}	}
n1|tvr7t|\}}	}
n%d|}|durP|d|}|dd�t���}t	�
|�t�|�dS|	|||d�}||_|S)zhGenerate an instance of some FCompiler subclass for the supplied
    platform/compiler combination.
    N)r�rJz7don't know how to compile Fortran code on platform '%s'z with '%s' compiler.z Supported compilers are: %s)�,)r/�dry_runr�)
�failed_fcompilersrr�r�r�rprrr�r�rr�r�rJ)r�r
r/r�r�r�rJ�
fcompiler_keyryr|�long_descriptionrr r r!r[s4��

rcCs|durGddlm}ddlm}|�}tj�tjd�|_	dgtjdd�|_
z|j
�d�Wn	ty9Ynw||j
d<|��|��g}g}g}tsRt�t�}|D]h}d}t�d�zt||jd	�}	|	�|�|	��}Wn#ttfy�}
zt�d
|f�t�t|
��WYd}
~
nd}
~
ww|dur�|�d|dt|df�qW|	��|�d|dt|dd
|f�qWtt 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�)rp)�.0�fcr 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.)&�distutils.distr��'numpy.distutils.command.config_compilerr+r�r�rr��argv�script_name�script_args�remover��cmdclass�parse_config_files�parse_command_linerprr�r�
set_verbosityrr/r�r�rrr.r�r�r�r�r�r�r�r�
print_helpr�)r�r�r+ro�compilers_na�compilers_ni�platform_compilersr
r�r�rxr�r r r!r�sn�


��
���


rcCs,tdd�\}}|�d�|��|dd�S)Nra)�suffixz#      subroutine dummy()
      end
r�)r�write�close)�for�r 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]cCsd}t|dd��{}|��}d}t|�st|�rd}nt|�r"d}d}|dkrc|rk|��}|rQ|ddkrQ|d8}|ddkrFt|dd	��sN|d
d�dkrQd}n*|��}|dkrs|s(Wd�|SWd�|SWd�|SWd�|SWd�|S1s�wY|S)z(Check if file is in free format Fortran.r�latin1��encodingi'r�!�	Nr3r��&)�open�readline�
_has_f_header�_has_fix_header�_has_f90_header�rstrip�_free_f90_start)�file�result�f�line�nr r r!r��sD,�
��
��
��
��
��r�cCsDt|dd��}|��}Wd�n1swYt|�p!t|�S)Nr�r�)r�r�r�r�)rr�r�r r r!r��s
�r�z=(c|)f77flags\s*\(\s*(?P<fcname>\w+)\s*\)\s*=\s*(?P<fflags>.*)cCs�i}t|dd��>}d}|D](}|d7}|dkrn%t�|�}|s!q
|�d���}|�d���}t|�||<q
Wd�|SWd�|S1sIwY|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)r��_f77flags_rer��groupr�r
)rrZr��ir��mr�r\r r r!r��s&
�
�
�
�
�
r��__main__)NNFNr�)NNrrrFNr")Dr=�__all__r�r�r��distutils.sysconfigr�distutils.fancy_getoptr�distutils.errorsrr	r
rr�distutils.utilr
r�numpy.distutils.ccompilerrr�numpy.distutilsr�numpy.distutils.misc_utilrrrrr�numpy.distutils.exec_commandrr�environmentr�type�
__metaclass__�	Exceptionrr%r'r)rr�rprrrr�r�r�r�r�rrr�compile�Ir�r��searchr�r�r�r�r�r�r�r�rr r r r!�<module>sz1
�
%
�
�
'<
�