%PDF- %PDF-
Mini Shell

Mini Shell

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

a

z[yc#K�@s�dZddlZddlmZddlZddlmZddlmZm	Z	m
Z
ddlmZddl
mZddlmZmZmZmZmZmZdd	lmZejZeee��D]:Zeedd
vr�eeddfeedd�ee<q�Gd
d�de�ZdS)zC Modified version of build_clib that handles fortran source files.
�N)�glob)�
build_clib)�DistutilsSetupError�DistutilsError�DistutilsFileError)�log)�newer_group)�filter_sources�get_lib_source_files�get_numpy_include_dirs�has_cxx_sources�
has_f_sources�is_sequence)�new_ccompiler_opt)z
build-clibz
build-temp�=�c@steZdZdZejgd�Zejgd�Zdd�Zdd�Zdd	�Z	d
d�Z
dd
�Zdd�Zdd�Z
dd�Zdd�ZdS)rz1build C/C++/F libraries used by Python extensions))z
fcompiler=Nz!specify the Fortran compiler type)�inplace�izBuild in-place)z	parallel=�jznumber of parallel jobs)�
warn-errorNz'turn all warnings into errors (-Werror))z
cpu-baseline=Nz4specify a list of enabled baseline CPU optimizations)z
cpu-dispatch=Nz.specify a list of dispatched CPU optimizations)�disable-optimizationNz1disable CPU optimized code(dispatch,simd,fast...))rrrcCs8t�|�d|_d|_d|_d|_d|_d|_d|_dS)Nr)	�old_build_clib�initialize_options�	fcompilerr�parallel�
warn_error�cpu_baseline�cpu_dispatch�disable_optimization)�self�r �H/usr/lib64/python3.9/site-packages/numpy/distutils/command/build_clib.pyr1s
zbuild_clib.initialize_optionsc
Csh|jrFzt|j�|_Wn.tyD}ztd�|�WYd}~n
d}~00t�|�|�dddddd�dS)Nz)--parallel/-j argument must be an integerZbuild)rr)rr)rr)rr)rr)r�int�
ValueErrorr�finalize_optionsZset_undefined_options)r�er r r!r$<s 
�zbuild_clib.finalize_optionscCs*|jD]\}}t|�dg��rdSqdS�N�sourcesTF)�	librariesr
�get�r�lib_name�
build_infor r r!�have_f_sourcesKszbuild_clib.have_f_sourcescCs*|jD]\}}t|�dg��rdSqdSr&)r(rr)r*r r r!�have_cxx_sourcesQszbuild_clib.have_cxx_sourcescCsT|js
dSg}|�d�|jD]*\}}|�dd�}|r||vr|�|�qddlm}||j|j|jd�|_|jj	|j
|��d�|jr�|jj�d�|jj
�d�|j}d|_|j�|�||_|j��|j�sbtj�dd	d
d�}tj�|�d�j|�}tj�tj�|jd��}t|d
��r*|j��t|j||j|j|d�|_dd�}	ddl}
|
�|	|j�|� ��r�ddl!m"}||j#|j$|j|jd|v|jd�|_%|j%du�r�|j%�	|j
�|j}d|_|j%�|�||_|j%��nd|_%|�&|j�|j'�rP|j
j(D]L}|j�)|j*�}tj�|j+|�}
tj�|j,|�}|�-|j,�t.�/|
|��qdS)N�	build_src�languager)�new_compiler)�compiler�dry_run�force)Zneed_cxxz-Werror�numpy�	distutils�includeznpy_cpu_dispatch_config.hzccompiler_opt_cache_clib.py�compiler_opt)r2�dispatch_hpathrr�
cache_pathcSs t�d�t�|jdd��dS)Nz3
########### CLIB COMPILER OPTIMIZATION ###########T)Zfull)r�info�report)Zcoptr r r!r<�s
zbuild_clib.run.<locals>.report��
new_fcompiler�f90�r2�verboser3r4�
requiref90Z
c_compiler)0r(Zrun_commandr)�appendZdistutils.ccompilerr1r2r3r4�	customize�distributionr.rZcompiler_soZ
customize_cmdZshow_customizationr�os�path�join�get_finalized_commandr/�abspath�
build_temp�hasattrr8Zcache_flushrrr�atexit�registerr-�numpy.distutils.fcompilerr>rrA�_f_compiler�build_librariesrZinstalled_libraries�library_filename�namerZ
target_dir�mkpath�shutil�copy)r�	languagesr+r,�lr1r(r9Zopt_cache_pathr<rMr>Zlibname�source�targetr r r!�runWs�
�
�
�
�
�zbuild_clib.runcCs.|�|j�g}|jD]}|�t|��q|S�N)Zcheck_library_listr(�extendr
)r�	filenames�libr r r!�get_source_files�s

zbuild_clib.get_source_filescCs |D]\}}|�|||�qdSr\)�build_a_library)rr(r+r,r r r!rQ�szbuild_clib.build_librariescCs>|durgSg}|D]$}t|�r.|||�7}q|�|�q|S)ah Assemble flags from flag list

        Parameters
        ----------
        in_flags : None or sequence
            None corresponds to empty list.  Sequence elements can be strings
            or callables that return lists of strings. Callable takes `self` as
            single parameter.

        Returns
        -------
        out_flags : list
        N)�callablerC)rZin_flagsZ	out_flagsZin_flagr r r!�assemble_flags�szbuild_clib.assemble_flagsc0s(|j}|j}|�d�}|dus&t|�s2td|��t|�}t|�\}}}	}
|
p`|�dd�dk}g}|rt|�d�|r�|�d�|r�|�d�n|	r�|�d�||d<|j||j	d	�}
||�d
g�}|j
}|js�|j�
�s�t�d�d}|�st||
d
��st�d|�dSt�d|�|�di�}|du�r�|�r�t�d|f�ddlm}||j|j|j|j
||jd�}|du�r�|j}|�d���}|�|�|�|�|	�s�|
�r�|du�r�td|��|du�r�|�d��p�g|_|�d��p�g|_|�d�}|du�rg}|�d�}|du�r$g}|�|�d��}|�|�d��}|�|�d��}|� t!��|�d��png}t"j#�$|
�}|�r�|�%|�|jdk�r�||7}g}g}g}g}g}|j�s`|�&d�j'}t"j#�(d d!d"�} t"j#�(|| �} |�| �|j)�r�dn|}!|f|d#f||f|d$ffD]8\}"}#�|"D]&�|#��fd%d&��dd�D�7}#�q(�q|j�*�}n
|�d'�g}$|�r�t�d(�|$|jj+||j,|!||||j|||%d)�7}$|�r�t�d*�|$|jj+||j,|!||||j||d+�7}$|�rt�d,�|$|j-||j,||||j|||d-�7}$|�rft�d.�|�.�}%|%j-||j,||||j|||d-�}&|$� |&�|	�sr|
�r�g}g}'|�r�|j/du�r�t0d/�}(||�1||�7}|
�r�t�d0�|'|j-|
|j,|||j|d-�7}'|�r�|jj/du�r�t0d/�D]�})|)|(v�r�q�t"j#�(||)�}*t"j#�2|)�t"j#�2|*�k�r,�q�t"j#�3|*��rDt"�4|*�z|�5|)|�Wn&t6�yzt�7d1|)|f�Yn0�q�|	�r�t�d2�|'|j-|	|j,|||j|d-�7}'ng}'|'�r�|�8|��s�t"j#�(|j	|d3�}+t9|+d4��*})|)�:d5�(d6d7�|'D���Wd�n1�s0Yt"j#�(|j	|d8�}+t9|+d4��*})|)�:d5�(d9d7�|$D���Wd�n1�sp0Yt"j#�(|j	||j;�},t9|,d:��})Wd�n1�s�0Yn |$� |'�|j<|$||j	|jd;�|�d<g�}-|D]&\}.}/|.|-v�r�|-� |/�d<g���q�|-�r$|-|d<<dS)=Nr'zfin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenamesr0�cr?zc++Zf77�source_languages)�
output_dir�dependsz*Detected changes on compiler optimizationsTZnewerz"skipping '%s' library (up-to-date)zbuilding '%s' library�	config_fczEusing additional config_fc from setup script for fortran compiler: %srr=r@z<library %s has Fortran sources but no Fortran compiler found�extra_f77_compile_args�extra_f90_compile_args�macros�include_dirsZextra_compiler_args�extra_cflags�extra_cxxflags�module_dirsZmsvcr/r5r6r7)z.dispatch.c)z
.dispatch.cppz
.dispatch.cxxcs&g|]}|���r����|���qSr )�endswith�pop�index)�.0�s�Z_extZ_srcr r!�
<listcomp>Js�z.build_clib.build_a_library.<locals>.<listcomp>)ZNPY_DISABLE_OPTIMIZATIONrz#compiling C++ dispatch-able sources)rf�src_dirrkrl�debug�extra_postargsZ	ccompilerz!compiling C dispatch-able sources)rfrwrkrlrxryzcompiling C sources)rfrkrlrxryzcompiling C++ sourcesz*.modz#compiling Fortran 90 module sourceszfailed to move %r to %rzcompiling Fortran sourcesz	.fobjects�w�
css|]}tj�|�VqdSr\�rFrGrJ�rs�objr r r!�	<genexpr>��z-build_clib.build_a_library.<locals>.<genexpr>z	.cobjectscss|]}tj�|�VqdSr\r|r}r r r!r�r��wb)rfrxr()=r2rPr)rr�listr	rCrRrr4rr8Z	is_cachedrrxrr;rOr>Z
compiler_typerAr3rEZget_option_dictrV�updaterDrrirjrcr]rrFrG�dirnamerTrIr/rHrZcpu_baseline_flagsZtry_dispatchrK�compile�cxx_compilerZmodule_dir_switchrZmodule_optionsrJ�isfile�removeZ	move_filer�warnZcan_ccompiler_link�open�writeZstatic_lib_extensionZcreate_static_lib)0rr,r+r(r2rr'Z	c_sourcesZcxx_sourcesZ	f_sourcesZfmodule_sourcesrBreZlib_filergZ
force_rebuildrhr>ZdistZbase_config_fcrkrlryrmrnroZmodule_build_dirZcopt_c_sourcesZcopt_cxx_sourcesZcopt_baseline_flagsZcopt_macrosZbsrc_dirr9Zcopt_build_srcZ_srcsZ_dstZobjectsr�Zcxx_objectsZ	f_objectsZexisting_modules�f�tZlistfnZ	lib_fnameZclib_librariesZlnameZbinfor rur!ra�s�
��
�


�
��


�
����



���


��
�

�
�	
���

���	
�
�

�
�

�:
�:
�"
�
zbuild_clib.build_a_libraryN)�__name__�
__module__�__qualname__�descriptionr�user_optionsZboolean_optionsrr$r-r.r[r`rQrcrar r r r!rs�Zr)�__doc__rFrrUZdistutils.command.build_clibrrZdistutils.errorsrrrZnumpy.distutilsrZdistutils.dep_utilrZnumpy.distutils.misc_utilr	r
rrr
rZnumpy.distutils.ccompiler_optrr�Z_l�range�lenZ_ir r r r!�<module>s (

Zerion Mini Shell 1.0