o
    >~#g                     @   s  d Z g dZddlZddlZddlZddlmZ ddlmZ ddl	m
Z
 ddlmZmZmZmZmZ ddlmZmZ dd	lmZmZ dd
lmZ ddlmZmZmZmZmZ ddlm Z  ddlm!Z! ddl"m#Z# e$Z%g dZ&G dd de'Z(dd Z)dd Z*dd Z+G dd deZ,dZ-da.da/dd Z0			d7dd Z1d8d!d"Z2		d7d#d$Z3e4 a5							d9d%d&Z6d:d'd(Z7d)d* Z8e9d+ej:j;Z<e9d,ej:j;Z=e9d-ej:j;Z>e9d.ej:j?Z@d/d0 ZAd1d2 ZBe9d3ej:ZCd4d5 ZDeEd6kre7  dS dS );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)Path)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   )EnvironmentConfig).for.ftn.f77.fc                   @   s   e Zd ZdS )CompilerNotFoundN)__name__
__module____qualname__ r%   r%   /var/www/static.ux5.de/https/Moving-Object-Detection-with-OpenCV/env/lib/python3.10/site-packages/numpy/distutils/fcompiler/__init__.pyr!   -   s    r!   c                 C   s   t | rt| S | S N)r   r   sr%   r%   r&   flaglist0   s   r*   c                 C   s   t | rt| S t| S r'   )r   r   boolr(   r%   r%   r&   str2bool6   s   r,   c                 C   s   t | ot| S r'   )r   r   )seqr%   r%   r&   is_sequence_of_strings;      r.   c                   @   s  e Zd ZdZeddddedfdddedfdddedfdddedfd	Zedd
dddddddd	ZedGi ddddddedfddddedfdddd edfd!d"ddedfd#d$d%d#edfd&d'ddedfd(d)ddedfd*d+d,d*edfd-d.ddedfd/d0ddedfdd1d2d3edfd4d5ddedfd6d7ddedfd8d9d:d;edfd<d=d>d?edfd@dAd>d?edfdBdCdDdEedfZ	dddddddddFZ
ddgZdZdGZdZg ZddHgdgdgddIgddJgdgdBdKgddLZdZdMZdNZdNZdZdOZg Zg dPZdQZe ZdRZdSZdTZdUZi Z g dLZ!dZ"g Z#g Z$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>dd Z?dd Z@dd ZAe? ZBZCe@ ZDZEeA ZFZGdd ZHdd ZIddgfddZJdddZKdd ZLdd ZMdd ZNdd ZOdd ZP				dddZQdd ZRdd ZSdd ZTdS )r   a0  Abstract 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_sectionr1   r2   r3   r4   )zexe.compiler_f77F77f77execNF)zexe.compiler_f90F90f90execNF)zexe.compiler_fixr8   r9   NF)zexe.version_cmdNNNF)zexe.linker_soLDSHAREDldsharedNF)zexe.linker_exeLDldNF)NARarNF)NRANLIBranlibNF)	r5   compiler_f77compiler_f90compiler_fixversion_cmd	linker_so
linker_exearchiverrA   r5   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_f77zflags.arch_f77arch_f90zflags.arch_f90zflags.debugFDEBUGfdebug	debug_f77zflags.debug_f77	debug_f90zflags.debug_f90flagszself.get_flagsFFLAGSfflagsrF   zflags.linker_soLDFLAGSldflagsrG   zflags.linker_exer?   zflags.arARFLAGSarflags)r    r   .Fr   r   .f90.F90.f95r%   z-vz-fixedz-sharedz-cr)rE   rB   rC   rD   rF   rG   rH   rA   z-cz-o z-I)	r   r   r   r    rg   ri   rf   rh   z.FORz.oz.azlib%s%s%s%s c                 O   s~   t j| g|R i | | j| j| _| j| j| _| j| j| _| j | _| j	D ]}|| jvr9d | j|< q-d| _
d S )NF)r   __init__distutils_varsclone_environment_hookcommand_vars	flag_varsexecutablescopy_executable_keys_is_customised)selfargskwer%   r%   r&   rl      s   



zFCompiler.__init__c                 C   sZ   |  | j}|j| j |j|j|_|j|j|_|j|j|_|j	
 |_	|S r'   )__new__	__class____dict__updaterm   rn   ro   rp   rq   rr   rs   )rv   objr%   r%   r&   __copy__   s   zFCompiler.__copy__c                 C   s   |   S r'   )r   rv   r%   r%   r&   rs         zFCompiler.copyc                    s    fdd}t |dS )Nc                    s   | j sJ | j  S r'   )ru   rr   r   keyr%   r&   fget   s   

z)FCompiler._command_property.<locals>.fget)r   )property)r   r   r%   r   r&   _command_property   s   
zFCompiler._command_propertyrE   rB   rC   rD   rH   rA   c                 C   s   |  || d S r'   )set_commandrv   r   valuer%   r%   r&   set_executable  r/   zFCompiler.set_executablec                 K   s"   |  D ]
\}}| || qd S r'   )itemsr   )rv   rx   kvr%   r%   r&   set_commands
  s   zFCompiler.set_commandsc                 C   s`   || j vrtd|| jjf t|rt|}|d u s)t|dd  s)J ||f|| j|< d S )Nz$unknown executable '%s' for class %sr   )rt   
ValueErrorr{   r"   r   r   r.   rr   r   r%   r%   r&   r     s   

$zFCompiler.set_commandc                    s   j sJ jfdd fdd}d fdd	}j}|d}|s9|d	}|r3td
|  ntd| |d	|d}|sHtd|  |d|d |d||d |d||d |d||d |d |d dS )a3  Go 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.
        c                    s,   |  v r |  S t | }|  | <  |< |S r'   r   )exefc_exe)	exe_cacher%   r&   cached_find_executable-  s
   z:FCompiler.find_executables.<locals>.cached_find_executablec                    s.   |d urt |std| | jjf d S d S )Nz"%s value %r is invalid in class %s)r.   r   r{   r"   )namer   r   r%   r&   verify_command_form3  s   z7FCompiler.find_executables.<locals>.verify_command_formNc                    s   j | d }|sd S tj| }|s||gj }n|gj }t }g }|D ] }|dkr1|}n|dkr7|}|r=||v r>q(|| || q(|D ]}	 |	}
|
r[|
|d< |
  S qK| d  d S )Nz<F77>z<F90>r   )	rr   getgetattrrp   possible_executablessetaddappendr   )exe_keyrI   rL   cmdexe_from_environ	possiblesseenunique_possiblesry   r   r   )r   rv   r%   r&   set_exe8  s4   
z+FCompiler.find_executables.<locals>.set_exerC   rB   z %s: no Fortran 90 compiler foundz%s: f90 nor f77)rL   z %s: no Fortran 77 compiler foundrD   rF   )rI   rL   rG   rE   rH   rA   NN)ru   
_exe_cachecompiler_typer   warnr!   )rv   r   r   ctyperL   rI   r%   )r   r   rv   r&   find_executables  s*   
 zFCompiler.find_executablesc                 C      dS )aq  Called 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%   r   r%   r%   r&   update_executablesl  s   	zFCompiler.update_executablesc                 C   s
   g | j  S )z+List of flags common to all compiler types.)	pic_flagsr   r%   r%   r&   	get_flagsw     
zFCompiler.get_flagsc                 C   s&   | j |d }|d u rg S |dd  S )Nr   )rr   r   )rv   r   r   r%   r%   r&   _get_command_flags{  s   zFCompiler._get_command_flagsc                 C   
   |  dS )z"List of Fortran 77 specific flags.rB   r   r   r%   r%   r&   get_flags_f77  r   zFCompiler.get_flags_f77c                 C   r   )z"List of Fortran 90 specific flags.rC   r   r   r%   r%   r&   get_flags_f90  r   zFCompiler.get_flags_f90c                 C      g S )z.List of Fortran 90 free format specific flags.r%   r   r%   r%   r&   get_flags_free     zFCompiler.get_flags_freec                 C   r   )z/List of Fortran 90 fixed format specific flags.rD   r   r   r%   r%   r&   get_flags_fix  r   zFCompiler.get_flags_fixc                 C   r   )z/List of linker flags to build a shared library.rF   r   r   r%   r%   r&   get_flags_linker_so  r   zFCompiler.get_flags_linker_soc                 C   r   )z,List of linker flags to build an executable.rG   r   r   r%   r%   r&   get_flags_linker_exe  r   zFCompiler.get_flags_linker_exec                 C   r   )zList of archiver flags. rH   r   r   r%   r%   r&   get_flags_ar  r   zFCompiler.get_flags_arc                 C   r   )z0List of architecture independent compiler flags.r%   r   r%   r%   r&   get_flags_opt  r   zFCompiler.get_flags_optc                 C   r   )z.List of architecture dependent compiler flags.r%   r   r%   r%   r&   get_flags_arch  r   zFCompiler.get_flags_archc                 C   r   )z=List of compiler flags to compile with debugging information.r%   r   r%   r%   r&   get_flags_debug  r   zFCompiler.get_flags_debugc                 C      | j dd S )zList of compiler libraries.N)	librariesr   r%   r%   r&   get_libraries     zFCompiler.get_librariesc                 C   r   )z%List of compiler library directories.N)library_dirsr   r%   r%   r&   get_library_dirs  r   zFCompiler.get_library_dirsr   c                 C   s,   | j sJ tj| ||d}|d u rt |S )N)force	ok_status)ru   r   get_versionr!   )rv   r   r   versionr%   r%   r&   r     s
   
zFCompiler.get_versionc                    s  t djj  d_j| j| j| 	  
  jdd}jd|}jdd}jj jjg g g }g  rWtj  jjrgtjjjjj}jjrytjjj g g g }}} fdd}	|s|	d	| |s|	d
| |r|	d| jj| | | }
 rj  |
 d rƈj|  |
 d r҈j |
 d j}|r3jj}tjdrtdd}tj|dd}tj|dd}|g| d| g }tjdr+ddl m!} |d}tj|d}tj|d}|g| d| g }j|| d j"}|rEjj"}j|| d jj#}|rYjj$}j|g| d %&  '(  dS )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 %sTr1   Fr2   r3   c                    s   | tj|  td|  }d fdfdffD ]\}}}d| |f }|r=|td| ur=| tj| qd S )N
get_flags_rI   rL   z%s_%s)extendr   rq   )tagr_   this_getr   cflagvartrI   rK   rL   rN   rR   fixflagsrv   r%   r&   r     s   z&FCompiler.customize.<locals>.get_flagsrS   rW   )rB   )rC   )rD   aixr   )standard_libconfig	ld_so_aixz
python.expz-bI:os400r   )get_config_varLIBPL)rF   )rG   )rH   N))r   infor{   r"   ru   rm   use_distributionrp   rq   r   r   r   rB   rC   r   NativeParsersplitrI   rL   rO   rD   rR   r_   r   rF   sysplatform
startswithr   ospathjoindistutils.sysconfigr   rG   rH   r?   set_library_dirsr   set_librariesr   )rv   distr1   r2   r3   rQ   oflagsaflagsdflagsr   ra   rF   linker_so_flags
python_libr   
python_expr   python_configrG   linker_exe_flagsr?   re   r%   r   r&   	customize  s   




zFCompiler.customizec                 C   s   g }t | j g d D ]}t| |r%t| |}||ddt| f q|  t|}|	d| j
j D ]}|dd dkrId|dd  }t| q7dS )z0Print out the attributes of a compiler instance.)r   r   r   object_switchcompile_switchNz= z%s instance properties:   z  --z  )listrr   keyshasattrr   r   reprsortr   generate_helpr{   r"   print)rv   propsr   r   pretty_printerlr%   r%   r&   dump_properties,  s"   



zFCompiler.dump_propertiesc              
   C   s  i }t |j tv rt|sd}| j}	t|}| jpg }
n5t|r;d}| j	}	|	du r5t
d| jj|f | jp9g }
nd}| j}	|	du rNt
d| jj|f | jpRg }
| jd dkrb| j |g}n| j | g}| j sqJ | j|g}|
rtd	|d
d d|
f  || jg }|rtdd|  |	| | | | | |
 }dtj|	d | |f }z
| j||d W dS  t
y } z	t|}t|dd}~ww )zCompile '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 zextra %s options: %rr   z%using compile options from source: %rz%s: %sr   )display)r   suffixlowerFORTRAN_COMMON_FIXED_EXTENSIONShas_f90_headerrB   get_f77flagsextra_f77_compile_argsis_free_formatrC   r
   r{   r"   extra_f90_compile_argsrD   r   stripr   r   r   r   r   r   r   r   basenamespawnstrr   )rv   r~   srcextcc_argsextra_postargspp_opts	src_flagsflavorcompilerextra_compile_argso_argss_argsextra_flagscommandr   ry   msgr%   r%   r&   _compile@  sh   




zFCompiler._compilec                 C   s   g }| j d ur$| j d dkr|| j  |g n|| j  |  ntd|  td| jj | jd urJ|g| D ]}|d| j|f  q;|S td|  td| jj |S )Nr   r   z'XXX: module_build_dir=%r option ignoredzXXX: Fix module_dir_switch for rj   z"XXX: module_dirs=%r option ignoredz#XXX: Fix module_include_switch for )module_dir_switchr   r  r   r   r{   r"   module_include_switch)rv   module_dirsmodule_build_diroptionsdr%   r%   r&   module_optionss  s   

zFCompiler.module_optionsc                 C      d| S )Nz-lr%   )rv   libr%   r%   r&   library_option  r   zFCompiler.library_optionc                 C   r!  )Nz-Lr%   )rv   dirr%   r%   r&   library_dir_option  r   zFCompiler.library_dir_optionc              
   C   s  |  ||\}}| |||\}}}t| |||}t|r%tj||}n|d ur-td| ||r| j	d dkrB| j	
 |g}n| j	
 | g}t| jrV|| jg }n|| j }|| | }|	rjdg|d d< |
rr|
|d d< |ry|| | tj| |tjkr| jd d  }n| jd d  }|| }z| | W d S  ty } z	t|}t|d d }~ww td| d S )Nz%'output_dir' must be a string or Noner   r   z-gr   zskipping %s (up-to-date))_fix_object_args_fix_lib_argsr   r   r   r   r   	TypeError
_need_linklibrary_switchr  objectsr   mkpathdirnamer   
EXECUTABLErG   rF   r	  r
   r
  r   r   r3   )rv   target_descr+  output_filename
output_dirr   r   runtime_library_dirsexport_symbolsr3   extra_preargsr  
build_temptarget_langlib_optsr  ld_argslinkerr  ry   r  r%   r%   r&   link  sJ   




zFCompiler.linkc                 C   s   |d u rd S t |rL|dr|dd  }t| |}| S |dr5|dd  }| j| }|r3|d S d S |drJ|dd  }t| d| }| S d S | S )	Nzself.   zexe.r   r   zflags.   r   )r   r   r   rr   )rv   r   	hook_namehookvarr%   r%   r&   ro     s&   




zFCompiler._environment_hookc                 C   r   )zc
        Check if the given C compiler can link objects produced by
        this compiler.
        Tr%   )rv   	ccompilerr%   r%   r&   can_ccompiler_link  s   zFCompiler.can_ccompiler_linkc                 C   s   t  )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)rv   r+  r1  extra_dll_dirr%   r%   r&   wrap_unlinkable_objects  s   z!FCompiler.wrap_unlinkable_objectsr'   )
NNNNNr   NNNN)Ur"   r#   r$   __doc__r   r,   rm   rp   r*   rq   language_maplanguage_orderr   compiler_aliasesversion_patternr   rr   suggested_f90_compilerr   r   r*  r  r  r   src_extensionsobj_extensionr   shared_lib_extensionstatic_lib_extensionstatic_lib_formatshared_lib_formatexe_extensionr   rt   
c_compilerr  r  rl   r   rs   r   rE   rB   rC   rD   rF   rG   rH   rA   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   r  r   r#  r%  r:  ro   rA  rD  r%   r%   r%   r&   r   >   s(   (	
		O
u3
/r   )
)win32)
gnuintelvabsoftcompaqvintelevgnu95g95intelvemintelemflang)zcygwin.*)rZ  r[  r\  r]  r^  r_  r`  )zlinux.*)armr_  intellaheypgnvr\  nagvastcompaqintelerb  rZ  r`  pathf95nagforfujitsu)zdarwin.*)	r_  ri  rn  r\  ibmre  rZ  r`  rg  )zsunos.*)sunrZ  r_  r`  )zirix.*)mipsrZ  r_  )zaix.*)rp  rZ  r_  )posixrZ  r_  )ntrt  )mac)r_  rZ  rg  c            
   	   C   s   ddl m }  tdurdS tjtjtd}i ai a| |D ]T}tjtj	|\}}d| }t
| tj| }t|drs|jD ]0}t||}|j||jf}|t|j< |jD ]}	|	tv rmtd|	|jt|	 d jf |t|	< qXqBqdS )	zcCache all the FCompiler classes found in modules in the
    numpy.distutils.fcompiler package.
    r   )globNz*.pyznumpy.distutils.fcompiler.	compilersz#alias %r defined for both %s and %sr   )rw  fcompiler_classr   r   r   r-  __file__fcompiler_aliasessplitextr  
__import__r   modulesr   rx  r   r   descriptionrH  r   r"   )
rw  pysfnamemodule_namer  modulecnameklassdescaliasr%   r%   r&   load_all_fcompiler_classes  s6   






r  Fc              	   C   s  ddl m} |dd}| D ]x}d }zNt|||d}	|	| |	 }|rO|	jd u rOd }|	j}
|
rOtd||
f  t||
|d}	|	| |	 }|d urO|
}|r^|	jd u r^t	d|	j
j W n tyn   td| Y n ty|   td	| Y nw |d ur|  S qd S )
Nr   )get_distributionT)always)platr  rR  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)numpy.distutils.corer  r   r   r   rC   rJ  r   r   r   r{   r"   r	   r3   r!   )compiler_typesosnamer   
requiref90rR  r  r   r   r   r   new_compilerr%   r%   r&   _find_existing_fcompiler#  sP   


r  c                 C   st   | d u rt j} |d u rtj}g }tD ]\}}t||s"t|| r0|D ]}||vr/|| q$q|s8|d |S )NrZ  )r   r   r   r   _default_compilersrematchr   )r  r   matching_compiler_typespatternr   ctr%   r%   r&   !available_fcompilers_for_platformH  s   

r  c                 C   s,   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  rR  )r  r   r   r  )r  r   r  rR  r  r   r%   r%   r&   get_default_fcompilerW  s   r  c                 C   s   | |f}|t v r
dS t  | du rtj} |du rt| ||d}|tv r+t| \}}	}
n1|tv r7t| \}}	}
n%d|  }|durP|d|  }|ddt   }t	
| t | dS |	|||d}||_|S )zhGenerate an instance of some FCompiler subclass for the supplied
    platform/compiler combination.
    N)r  rR  z7don't know how to compile Fortran code on platform '%s'z with '%s' compiler.z Supported compilers are: %s),)r4   dry_runr   )failed_fcompilersr  r   r   r  ry  r{  r   r   r   r   r   rR  )r  r  r4   r  r   r  rR  fcompiler_keyr  r  long_descriptionr  r%   r%   r&   r   i  s4   

r   c                 C   s  | du rGddl m} ddlm} | } tjtjd | _	dgtjdd  | _
z| j
d W n	 ty9   Y nw || jd< |   |   g }g }g }tsRt  t }|D ]h}d}td zt|| jd	}	|	|  |	 }W n# ttfy }
 ztd
|f  tt|
 W Y d}
~
nd}
~
ww |du r|d| dt| d f qW|	  |d| dt| d d|  f qWtt t! t | }dd |D }|"  |"  |"  t#|}|$d t#|}|$d |rt#|}|$d t%d dS )zbPrint list of available compilers (used by the "--help-fcompiler"
    option to "config_fc").
    Nr   )Distribution)r0   r0   r   z--help-fcompiler)r  r4   zshow_fcompilers: %s not found
fcompiler=   z (%s)c                 S   s"   g | ]}d | dt | d fqS )r  Nr  )ry  ).0fcr%   r%   r&   
<listcomp>  s    z#show_fcompilers.<locals>.<listcomp>zFortran 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_compilerr0   r   r   r  r   argvscript_namescript_argsremover   cmdclassparse_config_filesparse_command_linery  r  r  r   set_verbosityr   r4   r   r   r	   r!   r3   r   r   r   r   r   r   r   r   
print_helpr   )r   r  r0   rx  compilers_nacompilers_niplatform_compilersr  r   r   ry   r   r%   r%   r&   r     sn   






r   c                  C   s,   t dd\} }| d |   |d d S )Nr    )r   z#      subroutine dummy()
      end
r  )r   writeclose)for   r%   r%   r&   r     s   
r   z-\*-\s*fortran\s*-\*-z-\*-\s*f90\s*-\*-z-\*-\s*fix\s*-\*-z[^c*!]\s*[^\s\d\t]c                 C   s  d}t | dd{}| }d}t|st|rd}nt|r"d}d}|dkrc|rk| }|rQ|d dkrQ|d8 }|d dkrFt|dd	 sN|d
d dkrQd}n*| }|dkrs|s(W d   |S W d   |S W d   |S W d   |S W d   |S 1 sw   Y  |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    sD   ,




r  c                 C   sD   t | dd}| }W d    n1 sw   Y  t|p!t|S )Nr  r  )r  r  r  r  )r  r  r  r%   r%   r&   r    s   
r  z=(c|)f77flags\s*\(\s*(?P<fcname>\w+)\s*\)\s*=\s*(?P<fflags>.*)c                 C   s   i }t | dd>}d}|D ](}|d7 }|dkr n%t|}|s!q|d }|d }t|||< qW d   |S W d   |S 1 sIw   Y  |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  r   r      fcnamera   N)r  _f77flags_rer  groupr  r   )r  r_   r  ir  mr  ra   r%   r%   r&   r    s&   





r  __main__)NNFNr   )NNr   r   r   FNr'   )FrE  __all__r   r   r  pathlibr   r   r   distutils.fancy_getoptr   distutils.errorsr	   r
   r   r   r   distutils.utilr   r   numpy.distutils.ccompilerr   r   numpy.distutilsr   numpy.distutils.misc_utilr   r   r   r   r   numpy.distutils.exec_commandr   r   environmentr   type__metaclass__r  	Exceptionr!   r*   r,   r.   r   r  ry  r{  r  r  r  r  r   r  r   r   r   compileIsearchr  r  r  r  r  r  r  r  r  r"   r%   r%   r%   r&   <module>   s|         8

%


'<
