https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/numpy/distutils/command/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/numpy/distutils/command/__pycache__/build_clib.cpython-310.pyc
o

6��aZH�@s�dZddlZddlmZddlZddlmZddlmZm	Z	m
Z
ddlmZddl
mZddlmZmZmZmZmZmZdd	lmZejZeee��D]Zeedd
vrheeddfeedd�ee<qKGd
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@sleZdZdZejgd�Zejgd�Zdd�Zdd�Zdd	�Z	d
d�Z
dd
�Zdd�Zdd�Z
dd�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 �D/usr/lib/python3/dist-packages/numpy/distutils/command/build_clib.pyr1s

zbuild_clib.initialize_optionsc
Cs\|jrzt|j�|_Wnty}ztd�|�d}~wwt�|�|�dddddd�dS)Nz)--parallel/-j argument must be an integer�build)rr)rr)rr)rr)rr)r�int�
ValueErrorr�finalize_options�set_undefined_options)r�er r r!r%<s
��
�zbuild_clib.finalize_optionscC�*|jD]\}}t|�dg��rdSqdS�N�sourcesTF)�	librariesr
�get�r�lib_name�
build_infor r r!�have_f_sourcesK�
�zbuild_clib.have_f_sourcescCr(r))r+rr,r-r r r!�have_cxx_sourcesQr1zbuild_clib.have_cxx_sourcescCsN|jsdSg}|�d�|jD]\}}|�dd�}|r$||vr$|�|�qddlm}||j|j|jd�|_|jj	|j
|��d�|jrR|jj�d�|jj
�d�|j}d|_|j�|�||_|j��|js�tj�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%dur�|j%�	|j
�|j}d|_|j%�|�||_|j%��nd|_%|�&|j�|j'�r#|j
j(D]'}|j�)|j*�}tj�|j+|�}
tj�|j,|�}|�-|j,�t.�/|
|�q�dSdS)N�	build_src�languager)�new_compiler)�compiler�dry_run�force)�need_cxxz-Werror�numpy�	distutils�includeznpy_cpu_dispatch_config.hzccompiler_opt_cache_clib.py�compiler_opt)r6�dispatch_hpathrr�
cache_pathcSs t�d�t�|jdd��dS)Nz3
########### CLIB COMPILER OPTIMIZATION ###########T)�full)r�info�report)�coptr r r!rB�s
zbuild_clib.run.<locals>.report��
new_fcompiler�f90�r6�verboser7r8�
requiref90�
c_compiler)0r+�run_commandr,�append�distutils.ccompilerr5r6r7r8�	customize�distributionr2r�compiler_so�
customize_cmd�show_customizationr�os�path�join�get_finalized_commandr3�abspath�
build_temp�hasattrr=�cache_flushrrr�atexit�registerr0�numpy.distutils.fcompilerrErrH�_f_compiler�build_librariesr�installed_libraries�library_filename�namer�
target_dir�mkpath�shutil�copy)r�	languagesr.r/�lr5r+r>�opt_cache_pathrBr[rE�libname�source�targetr r r!�runWs�

��
�
�

��

��zbuild_clib.runcCs.|�|j�g}|jD]	}|�t|��q|S�N)�check_library_listr+�extendr
)r�	filenames�libr r r!�get_source_files�s

zbuild_clib.get_source_filescCs |D]\}}|�|||�qdSrn)�build_a_library)rr+r.r/r r r!r_�s�zbuild_clib.build_librariesc.s�|j}|j}|�d�}|dust|�std|��t|�}t|�\}}}	}
|
p0|�dd�dk}g}|r:|�d�|rA|�d�|rI|�d�n|	rP|�d�||d<|j||j	d	�}
||�d
g�}|j
}|jsv|j�
�svt�d�d}|s�t||
d
�s�t�d|�dSt�d|�|�di�}|dur�|r�t�d|f�ddlm}||j|j|j|j
||jd�}|dur�|j}|�d���}|�|�|�|�|	s�|
r�|dur�td|��|dur�|�d�p�g|_|�d�p�g|_|�d�}|dur�g}|�d�}|du�rg}|�d��p
g}|�t ��|�d��pg}t!j"�#|
�}|�r*|�$|�|jdk�r6||7}g}g}g}g}g}|j�s�|�%d�j&}t!j"�'ddd �}t!j"�'||�}|�|�|j(�rbdn|}|f|d!f||f|d"ffD]\} }!�| D]�|!��fd#d$��dd�D�7}!�qx�qq|j�)�}n|�d%�g}"|�r�t�d&�|"|jj*||j+|||||j||#d'�7}"|�r�t�d(�|"|jj*||j+|||||j|d)�7}"|�r�t�d*�|"|j,||j+||||j||d+�7}"|�rt�d,�|�-�}#|#j,||j+||||j||d+�}$|"�|$�|	�s|
�r�g}g}%|�r.|j.du�r&t/d-�}&||�0||�7}|
�rEt�d.�|%|j,|
|j+|||j|d+�7}%|�r�|jj.du�r�t/d-�D]H}'|'|&v�r\�qSt!j"�'||'�}(t!j"�1|'�t!j"�1|(�k�rr�qSt!j"�2|(��r~t!�3|(�z	|�4|'|�W�qSt5�y�t�6d/|'|f�Y�qSw|	�r�t�d0�|%|j,|	|j+|||j|d+�7}%ng}%|%�r;|�7|��s;t!j"�'|j	|d1�})t8|)d2��}'|'�9d3�'d4d5�|%D���Wd�n	1�s�wYt!j"�'|j	|d6�})t8|)d2��}'|'�9d3�'d7d5�|"D���Wd�n	1�swYt!j"�'|j	||j:�}*t8|*d8��}'Wd�n	1�s5wYn|"�|%�|j;|"||j	|jd9�|�d:g�}+|D]\},}-|,|+v�re|+�|-�d:g���qS|+�rp|+|d:<dSdS);Nr*zfin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenamesr4�crFzc++�f77�source_languages)�
output_dir�dependsz*Detected changes on compiler optimizationsT�newerz"skipping '%s' library (up-to-date)zbuilding '%s' library�	config_fczEusing additional config_fc from setup script for fortran compiler: %srrDrGz<library %s has Fortran sources but no Fortran compiler found�extra_f77_compile_args�extra_f90_compile_args�macros�include_dirs�extra_compiler_args�module_dirs�msvcr3r:r;r<)z.dispatch.c)z
.dispatch.cppz
.dispatch.cxxcs&g|]}|���r����|���qSr )�endswith�pop�index)�.0�s��_ext�_srcr r!�
<listcomp>,s

��z.build_clib.build_a_library.<locals>.<listcomp>)�NPY_DISABLE_OPTIMIZATIONrz#compiling C++ dispatch-able sources)rx�src_dirr~r�debug�extra_postargs�	ccompilerz!compiling C dispatch-able sources)rxr�r~rr�r�zcompiling C sources)rxr~rr�r�zcompiling C++ sourcesz*.modz#compiling Fortran 90 module sourceszfailed to move %r to %rzcompiling Fortran sourcesz	.fobjects�w�
cs��|]	}tj�|�VqdSrn�rSrTrW�r��objr r r!�	<genexpr>���z-build_clib.build_a_library.<locals>.<genexpr>z	.cobjectscsr�rnr�r�r r r!r��r��wb)rxr�r+)<r6r^r,rr�listr	rLrarr8rr=�	is_cachedrr�rrAr]rE�
compiler_typerHr7rO�get_option_dictrf�updaterNrr|r}rprrSrT�dirnamerdrVr3rUr�cpu_baseline_flags�try_dispatchrX�compile�cxx_compiler�module_dir_switchr�module_optionsrW�isfile�remove�	move_filer�warn�can_ccompiler_link�open�write�static_lib_extension�create_static_lib).rr/r.r+r6rr*�	c_sources�cxx_sources�	f_sources�fmodule_sourcesrIrw�lib_filery�
force_rebuildr{rE�dist�base_config_fcr~rr�r��module_build_dir�copt_c_sources�copt_cxx_sources�copt_baseline_flags�copt_macros�bsrc_dirr>�copt_build_src�_srcs�_dst�objectsr��cxx_objects�	f_objects�existing_modules�f�t�listfn�	lib_fname�clib_libraries�lname�binfor r�r!rt�s�
�
��


�
��

�����





��
��

�

�
�
�
�
�

��
��
��
��
���
�
��zbuild_clib.build_a_libraryN)�__name__�
__module__�__qualname__�descriptionr�user_options�boolean_optionsrr%r0r2rmrsr_rtr r r r!rs�Zr)�__doc__rSrre�distutils.command.build_clibrr�distutils.errorsrrr�numpy.distutilsr�distutils.dep_utilr�numpy.distutils.misc_utilr	r
rrr
r�numpy.distutils.ccompiler_optrr��_l�range�len�_ir r r r!�<module>s  &�

https://t.me/RX1948 - 2025