%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_ext.cpython-39.pyc

a

z[yc�|�@s�dZddlZddlZddlmZddlmZddlmZddl	m
Z
mZmZddl
mZddlmZdd	lmZdd
lmZddlmZmZmZmZmZmZddlmZdd
lmZm Z Gdd�de�ZdS)zC Modified version of build_ext that handles fortran source files.

�N)�glob)�newer_group)�	build_ext)�DistutilsFileError�DistutilsSetupError�DistutilsError)�	copy_file)�log)�filepath_from_subprocess_output)�
combine_paths)�filter_sources�get_ext_source_files�get_numpy_include_dirs�has_cxx_sources�
has_f_sources�is_sequence)�show_fortran_compilers)�new_ccompiler_opt�CCompilerOptc@s�eZdZdZejgd�ZejdddefgZejddgZdd	�Z	d
d�Z
dd
�Zddd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�ZdS)rz:build C/C++/F extensions (compile/link to build directory)))z
fcompiler=Nz!specify the Fortran compiler type)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...))z
simd-test=NzMspecify a list of CPU optimizations to be tested against NumPy SIMD interfacezhelp-fcompilerNz list available Fortran compilersrrcCs8t�|�d|_d|_d|_d|_d|_d|_d|_dS�N)	�
old_build_ext�initialize_options�	fcompiler�parallel�
warn_error�cpu_baseline�cpu_dispatch�disable_optimization�	simd_test��self�r$�G/usr/lib64/python3.9/site-packages/numpy/distutils/command/build_ext.pyr4s
zbuild_ext.initialize_optionsc
Cs�|jrFzt|j�|_Wn.tyD}ztd�|�WYd}~n
d}~00t|jt�rb|j�tj�|_|jpjg}|j	jdur�g|j	_|j	j|_|j�
|�t�|�|�
ddddddd�|jtjd	<dS)
Nz)--parallel/-j argument must be an integerZbuild)rr)rr)rr)rr)r r )r!r!r!)r�int�
ValueError�
isinstance�include_dirs�str�split�os�pathsep�distribution�extendr�finalize_optionsZset_undefined_optionsr!rZconf_target_groups)r#�eZ	incl_dirsr$r$r%r0>s, 



�zbuild_ext.finalize_optionsc#	s��js
dS��d��j��r��jrz�jj�d�rJt�d��j�	d�}q��j�	d�}d|_|�
�|��d�jjd<n��d���d�}�j
�|j�nd}ddlm}ddlm}�j}||�j�j�jd��_�j��j��j����j�r�jj�d	��jj�d	��j���j�s�tj� d
ddd
�}tj� ��d�j!|�}tj�"tj� �j#d��}t$�d��r~�j%�&�t'�j|�j(�j)|d��_%dd�}ddl*}|�+|�j%�tj� �j#d��_,tj�-�j,��s�t�.�j,�i}	|du�rZ|j/�p�gD]Z\}
}|
|	v�rN|	|
|k�rNt�d|
t0|	|
�dd�t0|�dd�f�||	|
<�q��jj/�pfgD] \}
}|
|	v�r~�qh||	|
<�qht1�}�jD�]�}
t1�}g}g}g}|
j/D]�}
|
|	v�r|	|
}||�dg�7}||�dg�7}|�dg�D]}||v�r�|�|��q�|	�|
i��dg�D]}|�2|��q&�q�|�rv|
j/|}t�3d|
j4|
j/|f�||
_/|
j
||
_
|�r�t�3d|
j4|f�|
j5||
_5t6|
j7��r�|�2d�t8|
j7��r�|�2d�|
j9�p܈j�:|
j7�}|�r�|�2|�d|v�r�d}nd}d}d |v�rd }d!}nd|v�r,d}d!}|
j9�r:|�rn|�rh||k�rh|
j9�rht�d"|
j4||f�||
_9|�;|��q�d |v}d|v}d|v}|�r�||�j�j�jd��_<�j<}|j�j|d#�|���|��|�=��_<nd�_<|�rp�j>}|�j>�j�j�jd�jd$��_?�j?}|�r6|j@}|��j�|�rZ|�A��rZ|���|��n��d%|�d�_?nd�_?|�r��j>}|�j>�j�j�jd!�jd$��_B�jB}|�r�|j@}|��j�|�r�|�A��r�|���|��n��d&|�d�_Bnd�_B��C��fd'd(��jD�}|D]�}tj� |d�} �j�sJtj� �jD| �} t�E�j,�D]L}!tj�-| ��srt�.| �|!�F��Gd)��s��qVtj� �j,|!�}"tH|"| ��qV�q dS)*N�	build_src�
build_clibzMbuild_clib already run, it is too late to ensure in-place build of build_clib�r)�new_compiler)�
new_fcompiler)�compiler�verbose�dry_run�forcez-Werror�numpy�	distutils�includeznpy_cpu_dispatch_config.hzccompiler_opt_cache_ext.py�compiler_opt)r7�dispatch_hpathrr�
cache_pathcSs t�d�t�|jdd��dS)Nz2
########### EXT COMPILER OPTIMIZATION ###########T)Zfull)r	�info�report)Zcoptr$r$r%rB�s
zbuild_ext.run.<locals>.reportz.libszKlibrary %r defined more than once, overwriting build_info
%s... 
with
%s...i,�	libraries�library_dirs�macrosZsource_languagesz-updating extension %r libraries from %r to %rz-extending extension %r defined_macros with %r�f77�c++�cF�f90Tz.resetting extension %r language from %r to %r.)Zneed_cxx)r7r8r9r:Z
requiref90Z
c_compilerz!f77_compiler=%s is not available.z!f90_compiler=%s is not available.cs"h|]}��|j��d�d�qS)�.r)�get_ext_fullname�namer+)�.0�extr"r$r%�	<setcomp>Ss�z build_ext.run.<locals>.<setcomp>z.dll)I�
extensionsZrun_commandr.Zhas_c_libraries�inplaceZhave_run�getr	�warnZget_command_objZensure_finalized�run�get_finalized_commandrD�appendr3Zdistutils.ccompilerr5Znumpy.distutils.fcompilerr6r7r8r9r:Z	customizeZ
customize_cmdrZcompiler_soZshow_customizationr r,�path�joinr2�abspath�
build_temp�hasattrr>Zcache_flushrrr�atexit�register�
extra_dll_dir�isdir�makedirsrC�repr�set�addrArL�
define_macrosr�sourcesr�languageZdetect_language�update�
_cxx_compiler�cxx_compilerr�
_f77_compiler�
compiler_typeZget_version�
_f90_compilerZbuild_extensions�	build_lib�listdir�lower�endswithr)#r#r3r5r6rkr?Zopt_cache_pathrBr\Zclibs�libnameZ
build_infoZ
all_languagesrNZ
ext_languagesZc_libsZ
c_lib_dirsrEZbinfo�m�lZ
new_c_libsZext_languageZhas_fortranZneed_f90_compilerZneed_f77_compilerZneed_cxx_compilerr7ZctyperZ	pkg_rootsZpkg_rootZshared_lib_dir�fnZruntime_libr$r"r%rT`s|


��

�
�
�
$�




��






��
�

��

�
�
z
build_ext.runcCs|Srr$)r#rerPr$r$r%�swig_sourcescszbuild_ext.swig_sourcesc0s|j}|dust|�s$td|j��t|�}|s4dS|�|j�}|jr�|�d�}d�|dd��}|d}|�	d�}|�
|�}tj�||�
|��}	ntj�|j|�
|��}	||j}
|j}|js�|j��s�t�d�d}|s�t|
|	d�s�t�d	|j�dSt�d
|j�|j�pg}t|dd��p$g}
t|dd��p6g}|jdd�}|jD]}|�|f��qLt|j�\}}}}|jjd
k�r�|�r�|�d�||7}g}|j dk�r�|j!}n"|j dk�r�|j"}n|j!�p�|j"}|du�rt#|d��r�|j$�p�gng|_$t#|d��r|j%�pgng|_%|j&}|�r<|du�r<t'd|j��|�sH|�r`|du�r`t'd|j��|j dv�r�|du�r�|�(d|j�|j dk�r�|du�r�|�(d|j�d|ji}|j)}|j*t+�}g}g}g}g}|j�s�|�	d�j,}tj�ddd�}tj�||�}|�|�|j�r dn|} |f|df||f|dffD]8\}!}"�|!D]&�|"��fd d!��dd�D�7}"�qL�q>|j�-�}n
|�d"�g}#|�r�t�d#�|#|jj.|f|| ||||j|||d$�|��7}#|�rt�d%�|#|jj.|f|| ||||j||
d&�|��7}#|�rVt�d'�|#|jj/|f|||||j|||
d(�|��7}#|�r�t�d)�|#|j/|f|||||j|||d(�|��7}#g}$g}%|�r�t�d*�|j0dd�}&tj�|j)tj�1|�
|���}'|�2|'�|j3du�r�t4d+�}(|$|�5|&|'�7}$|%|j/||j)|||j|$|jd,�7}%|j3du�r�t4d+�D]�})|)|(v�rP�q>tj�|'|)�}*tj�6|)�tj�6|*�k�r|�q>tj�7|*��r�t�8|*�z|�9|)|'�Wn&t:�y�t�(d-|)|'f�Yn0�q>|�rt�d.�|%|j/||j)|||j|$|jd,�7}%|%�r |�;|j��s |%}+|#},ng}+|#|%},|j<�r@|,�=|j<�|j>�pJg}|�?|�dd�}-|j@dd�}.|jjA}/|jjd/v�r�|�B||-|.�n|j dv�r�|du�r�|jA}/|j dk�r�|du�r�|jA}/|du�r�|�C|,|-||.|+�\},}-|/|,|	|-|.|jD||�E|�|j|j)|j d0�
dS)1Nzjin 'ext_modules' option (extension '%s'), 'sources' must be present and must be a list of source filenamesrJr����build_pyz*Detected changes on compiler optimizationsTZnewerz$skipping '%s' extension (up-to-date)zbuilding '%s' extensionZextra_c_compile_argsZextra_cxx_compile_args�msvcz/Zm1000rIrF�extra_f77_compile_args�extra_f90_compile_argsz5extension %r has C++ sourcesbut no C++ compiler foundz>extension %r has Fortran sources but no Fortran compiler found)rFrIzTextension %r has Fortran libraries but no Fortran linker found, using default linkerrGzLextension %r has C++ libraries but no C++ linker found, using default linker�dependsr2r;r<r=)z.dispatch.c)z
.dispatch.cppz
.dispatch.cxxcs&g|]}|���r����|���qSr$)rp�pop�index)rM�s�Z_extZ_srcr$r%�
<listcomp>�s�z-build_ext.build_extension.<locals>.<listcomp>)ZNPY_DISABLE_OPTIMIZATIONr4z#compiling C++ dispatch-able sources)�
output_dir�src_dirrEr)�debug�extra_postargsZ	ccompilerz!compiling C dispatch-able sources)r�r�rEr)r�r�zcompiling C sources)r�rEr)r�r�zcompiling C++ sourcesz#compiling Fortran 90 module sourcesz*.mod)r�rEr)r�r�r{zfailed to move %r to %rzcompiling Fortran sources)rxZintelwZintelemw)rCrD�runtime_library_dirsr�Zexport_symbolsr�rZZtarget_lang)FrerrrL�listrKrQr+rXrUZget_package_dirr,rW�get_ext_filenamermr{r:r r>Z	is_cachedr	r�rrAZextra_compile_args�getattrrdZundef_macrosrVrr7rkrfrlrjr[ryrzrhrrSrZr)rr2Zcpu_baseline_flagsZtry_dispatch�compile�module_dirs�dirnameZmkpathZmodule_dir_switchrZmodule_optionsrY�isfile�removeZ	move_filerZcan_ccompiler_linkZ
extra_objectsr/Zextra_link_argsZ
get_librariesrDZlink_shared_object�_libs_with_msvc_and_fortran�_process_unlinkable_fobjectsr�Zget_export_symbols)0r#rNre�fullname�modpath�package�baserwZpackage_dirZext_filenamer{Z
force_rebuild�
extra_argsZextra_cflagsZextra_cxxflagsrEZundef�	c_sourcesZcxx_sourcesZ	f_sourcesZfmodule_sourcesrriZkwsr�r)Zcopt_c_sourcesZcopt_cxx_sourcesZcopt_baseline_flagsZcopt_macrosZbsrc_dirr?Zcopt_build_srcZ_srcsZ_dstZ	c_objectsr�Z	f_objectsr�Zmodule_build_dirZexisting_modules�f�t�unlinkable_fobjects�objectsrCrDZlinkerr$rr%�build_extensiongs���


�
�


�


��������


��
�

��	�
���	
����	
����


��
��

�
��
��zbuild_ext.build_extensioncCsP|�d�j}|�d�j}|jjtj�|d�g|jd�}|jj	|d||j
d�dS)Nr2r3zgfortran_vs2003_hack.c)r�Z_gfortran_workaround)r�r�)rUr2r3r7r�r,rWrXrZZcreate_static_libr�)r#r�r2r3r�r$r$r%�_add_dummy_mingwex_symcs��
�z build_ext._add_dummy_mingwex_symc

Cs t|�}t|�}t|�}|dd�D]�}|D]�}tj�||d�}tj�|�r,|�|�t|d��"}	|�|	���	��Wd�n1s�0Ytj�||d�}
t|
d��"}	|�|	���	��Wd�q,1s�0Yq,q$|�rdd�|D�}|j
||j|jd�}|�|�||fS)Nz	.fobjects�rz	.cobjectscSsg|]}tj�|��qSr$)r,rWrY)rM�objr$r$r%r���z:build_ext._process_unlinkable_fobjects.<locals>.<listcomp>)r�r^)
r�r,rWrXr�r��openr/�read�
splitlinesZwrap_unlinkable_objectsrZr^)
r#r�rCrrDr��lib�libdirZfake_libr�Zc_libZfobjects�wrappedr$r$r%r�ls*
04�
z&build_ext._process_unlinkable_fobjectsc
Cs�|durdS|D]�}|�d�r qd}|p*gD]*}tj�|d|�}tj�|�r,d}qXq,|r^qd}|D]^}tj�|d|�}tj�|�rftj�|j|d�}t||�|j|vr�|�|j�d}q�qf|r�qt�	d||f�qg}	|j
D]R}
|
�d��r2zt�d	d
|
g�}
Wnt
tjf�y(Yn
0t|
�}
|	�|
�q�|�|	�|jD]|}|�d��sN|�|�t|	d|d�}|�rNtj�|j|d�}
tj�|
��s�t|d
|
�|j|v�rN|�|j��qNdS)NrxFz%s.libTzlib%s.az.libz+could not find library %r in directories %sz/usr/libZcygpathz-wr�z.ar)�
startswithr,rWrXr�rZrrVr	rSrD�
subprocessZcheck_output�OSErrorZCalledProcessErrorr
r/rCr)r#rZc_librariesZc_library_dirsrqZ
fileexistsr�ZlibfileZlibfile2Z
f_lib_dirs�dirr��pZdst_namer$r$r%r��s`


�



z%build_ext._libs_with_msvc_and_fortrancCs.|�|j�g}|jD]}|�t|��q|Sr)�check_extensions_listrPr/r
)r#�	filenamesrNr$r$r%�get_source_files�s

zbuild_ext.get_source_filesc	CsP|�|j�g}|jD]4}|js"q|�|j�}|�tj�|j	|�
|���q|Sr)r�rPrerKrLrVr,rWrXrmr�)r#ZoutputsrNr�r$r$r%�get_outputs�s
�zbuild_ext.get_outputs)N)�__name__�
__module__�__qualname__�descriptionrZuser_optionsZhelp_optionsrZboolean_optionsrr0rTrur�r�r�r�r�r�r$r$r$r%rs*��
"
}	#=r)!�__doc__r,r�rZdistutils.dep_utilrZdistutils.command.build_extrrZdistutils.errorsrrrZdistutils.file_utilrZnumpy.distutilsr	Znumpy.distutils.exec_commandr
Znumpy.distutils.system_inforZnumpy.distutils.misc_utilrr
rrrrZ'numpy.distutils.command.config_compilerrZnumpy.distutils.ccompiler_optrrr$r$r$r%�<module>s 

Zerion Mini Shell 1.0