Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/numpy/distutils/fcompiler/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/numpy/distutils/fcompiler/__pycache__/gnu.cpython-311.pyc

�

�܋fP���ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	m
Z
mZddlm
Z
ddlmZddlmZddgZejd��Zd	�ZGd
�de��ZGd�de��Zd�Zed
kr�ddlmZddlmZejd��eed��� ����	eed��� ����dS#e!$rZ"ee"��YdZ"["dSdZ"["wwxYwdS)�N)�Popen�PIPE�STDOUT)�filepath_from_subprocess_output)�	FCompiler)�LooseVersion�GnuFCompiler�Gnu95FCompilerzTarget: ([a-zA-Z0-9_\-]*)c�\�tjdkotj��ddkS)N�win32r�64bit)�sys�platform�architecture���p/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib64/python3.11/site-packages/numpy/distutils/fcompiler/gnu.py�is_win64rs'���<�7�"�L�x�'<�'>�'>�q�'A�W�'L�Lrc	�.�eZdZdZdZdZd�Zd�ZddgZdd	ggd
�ddgd�dd
gdggd�d�Z	dZ
dZej
dkrejdkrdgZejdkr dD]Ze	e�d���dZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd �Zd!�ZdS)"r	�gnu)�g77zGNU Fortran 77 compilerc�0�|�d��rG||�d��dzd����}|�d���Gt|��dkrst	jd|��}|r[|�d��rd|�d��fS|���d	krd
|�d��fSn�t	jd|��}|rd
|�d��fSt	jd|��}|r\|�d��}|�d
��s*|�d��s|�d��rd|fSd
|fSd}t||z���)z6Handle the different versions of GNU fortran compilerszgfortran: warning�
�N�z	([0-9.]+)zGNU Fortranrr�gfortranzGNU Fortran\s+95.*?([0-9-.]+)z%GNU Fortran.*?\-?([0-9-.]+\.[0-9-.]+)�0�2�3z6A valid Fortran version was not found in this string:
)	�
startswith�find�strip�len�re�search�group�start�
ValueError)�self�version_string�m�v�errs     r�gnu_version_matchzGnuFCompiler.gnu_version_matchs����'�'�(;�<�<�	G��~�2�2�4�8�8�1�<�=�=�>�D�D�F�F�
��'�'�(;�<�<�	G��~���"�$�$��	�,��7�7�A��	
4�"�,�,�]�;�;�4�!�1�7�7�1�:�:�.�.��W�W�Y�Y�!�^�^�&�����
�
�3�3���	�:�N�K�K�A��
0�"�A�G�G�A�J�J�/�/��	�8�.�J�J�A��
+��G�G�A�J�J���<�<��$�$�+����S�(9�(9�+�Q�\�\�#�=N�=N�+�!�1�:�%�'��?�*�H����~�-�.�.�.rc�\�|�|��}|r|ddkrdS|dS)Nrrr)r.)r)r*r,s   r�
version_matchzGnuFCompiler.version_matchLs7���"�"�>�2�2���	�A�a�D�E�M�M��4���t�rr�f77N�-dumpversion)N�-g�-Wall�-fno-second-underscore)Nr3r4�ar�-cr�ranlib��version_cmd�compiler_f77�compiler_f90�compiler_fix�	linker_so�archiverr8�
linker_exe�nt�cygwinz-fPICr)r:r;r>r@�-mno-cygwin�g2c�gnu95c���|jdd�}tjdkr�tj�dd��}|sTddl}|�d��}|sd}d|��}tj	|d���t|��tjd<|�gd	���n|�d
��tj�
d��r|�d��|S)
Nr�darwin�MACOSX_DEPLOYMENT_TARGETrz10.9z.Env. variable MACOSX_DEPLOYMENT_TARGET set to �)�
stacklevel)z
-undefined�dynamic_lookupz-bundlez-shared�sunosz
-mimpure-text)r>rr�os�environ�get�	sysconfig�get_config_var�warnings�warn�str�extend�appendr )r)�opt�targetrP�ss     r�get_flags_linker_soz GnuFCompiler.get_flags_linker_soms���n�Q�R�R� ���<�8�#�#��Z�^�^�$>��E�E�F��
E�!� � � �"�1�1�2L�M�M���3�#�F�Q��Q�Q�A��M�!��2�2�2�2�9<�V����
�5�6��J�J�B�B�B�C�C�C�C��J�J�y�!�!�!��<�"�"�7�+�+�	(�
�J�J��'�'�'��
rc���	tj|jdgz��}t|��}tj�|��S#ttjf$rYnwxYwdS)Nz-print-libgcc-file-name)	�
subprocess�check_outputr;rrM�path�dirname�OSError�CalledProcessError)r)�outputs  r�get_libgcc_dirzGnuFCompiler.get_libgcc_dir�s���	+��,�T�->�-F�,G�.H�I�I�F�
5�V�<�<�F��7�?�?�6�*�*�*��	��6�7�	�	�	��D�	����
�ts�A
�
A&�%A&c�j�tjdd�dkrd}ntjdkrd}nd}d}|r~d�|��g}	tj|j|z��}t
|��}tj�	|��}n#ttjf$rYnwxYw|S)N��linuxzlibgfortran.sorGzlibgfortran.dylibz-print-file-name={0})rr�formatr\r]r;rrMr^r_r`ra)r)�libgfortran_name�libgfortran_dir�find_lib_argrbs     r�get_libgfortran_dirz GnuFCompiler.get_libgfortran_dir�s����<�����w�&�&�/���
�\�X�
%�
%�2���#�����		:�2�9�9�:J�K�K�L�L�
:�#�0�'+�'8�<�'G�I�I��
9��@�@��"$�'�/�/�&�"9�"9����	�Z�:�;�
�
�
���
����
�s�B�B0�/B0c��g}tjdd�dk�rw|���}|�r`tjdk�r:|�d���s$tj�|��}tj�|d|jz��}tj�	|��s�t	jj|gtj
fdz�R�}tj�tj�|d����}tj�|d|jz��}tj�	|��r|�|��|�|��|�
��}|r|�|��|S)Nrerfrz/usr/libzlib%s.a��lib)rrrcr rMr^�normpath�joinrD�exists�pardir�abspathrVrk)r)rW�dr^�root�d2�lib_gfortran_dirs       r�get_library_dirszGnuFCompiler.get_library_dirs�sb�����<�����w�&�&��#�#�%�%�A��
��<�7�*�*�1�<�<�
�3K�3K�*���(�(��+�+�A��7�<�<��9�t�x�+?�@�@�D��7�>�>�$�/�/�+�!�w�|�A�D�"�)���1B�D�D�D���W�_�_�R�W�\�\�$��-F�-F�G�G��!�w�|�|�B�	�D�H�0D�E�E���7�>�>�$�/�/�+��J�J�r�N�N�N��
�
�1�
�
�
��3�3�5�5���	)��J�J�'�(�(�(��
rc���g}|���}|�`|jdz}|j||jfz}tj�tj�||����s|j}n|j}|�|�|��|j	}tjdkr"|r |jdkr|�d��tjdkr|�d��|S)Nz-picr�msvc�gccrG�
cc_dynamic)
rcrD�static_lib_format�static_lib_extensionrMr^�isfilerprV�
c_compilerrr�
compiler_type)r)rWrtrD�fr�s      r�
get_librarieszGnuFCompiler.get_libraries�s��������!�!���=��(�V�#�C��&�#�t�/H�)I�I�A��7�>�>�"�'�,�,�q�!�"4�"4�5�5�
��h����(�C��?��J�J�s�O�O�O��_�
��<�7�"�"�z�"��(�F�2�2��J�J�u�����<�8�#�#��J�J�|�$�$�$��
rc��dgS)Nr3r�r)s r�get_flags_debugzGnuFCompiler.get_flags_debug�s	���v�
rc�v�|���}|r
|dkrdg}ndg}|�d��|S)Nz3.3.3z-O2z-O3z-funroll-loops)�get_versionrV)r)r,rWs   r�
get_flags_optzGnuFCompiler.get_flags_opt�sM���������	��g����'�C�C��'�C��
�
�#�$�$�$��
rc���ddl}	|���d}n#t$rgcYSwxYwtjd��}g}|�|��D]	}|d|gz
}�
|S)z( Return detected arch flags from CFLAGS rN�CFLAGSz
-arch\s+(\w+)�-arch)rP�get_config_vars�KeyErrorr$�compile�findall)r)rP�cflags�arch_re�
arch_flags�archs      r�
_c_arch_flagszGnuFCompiler._c_arch_flags�s�������	��.�.�0�0��:�F�F���	�	�	��I�I�I�	�����*�-�.�.���
��O�O�F�+�+�	*�	*�D��7�D�/�)�J�J��s�!�0�0c��gS)Nrr�s r�get_flags_archzGnuFCompiler.get_flags_arch�s���	rc���tjdkstjdkrt�d|vsJ�tjdkrd|��Stj�d��rd|��Sd|��S)	NrrB�,rGz-Wl,-rpath,��aix�os400z-Wl,-blibpath:z-Wl,-rpath=)rr�NotImplementedErrorr )r)�dirs  r�runtime_library_dir_optionz'GnuFCompiler.runtime_library_dir_option�s����<�7�"�"�c�l�h�&>�&>�%�%��#�~�~�~�~��<�8�#�#�&��&�&�&�
�\�
$�
$�%5�
6�
6�	'�)�C�)�)�)�&��&�&�&r)�__name__�
__module__�__qualname__r��compiler_aliases�descriptionr.r0�possible_executables�executables�module_dir_switch�module_include_switchrM�namerr�	pic_flags�keyrVrD�suggested_f90_compilerrZrcrkrxr�r�r�r�r�r�rrrr	r	s��������M� ��+�K�+/�+/�+/�Z���"�5�>����/�H�H�H���.�.�.����"��.�.�.�	�	�K��� ��
�w�$���3�<�8�3�3��I�	��|�w���M�	3�	3�C����#�#�M�2�2�2�2�
�C�$��!�!�!�F	�	�	����*���,���*���	�	�	�������'�'�'�'�'rc	��eZdZdZdZdZd�ZddgZddggd	�gd
�gd	�gd�dd
gdgddgd�ZdZ	dZ
ej�
d��r\ed�d��ej��ddd�dkr dD]Zee�d���dZd�Zd�Zd�Zd�Zd �Zd!�Zd"�Zd#�Zd$�Zd%�ZdS)&r
rE)rzGNU Fortran 95 compilerc���|�|��}|r|ddkrdS|d}t|��dkrn5tjdkr%dD]"}|j|�d���#|S)Nrrr�4r)r:r;r<r=r>r@rC)r.rrrr�rV)r)r*r,r�s    rr0zGnu95FCompiler.version_matchs����"�"�>�2�2���	�A�a�D�J�&�&��4�
�a�D����?�?�c�!�!���|�w�&�&��@�@�C��$�S�)�0�0��?�?�?�?��rr�f95�<F90>r2)Nr4r3z-ffixed-formr5)Nr4r3r5)r�r4r3r6r7r8Nr4r9z-Jz-Ir�r>z	-lpthreadrrI�64)r;r<r=r>r@z-maix64c���tjdksgSg}|���}d|vrd||�d��<dD]-}t	||��r||vr|�d|g���.|S)z>Return a list of -arch flags for every supported architecture.rG�i386�i686)�ppcr��x86_64�ppc64�s390xr�)rrr��index�_can_targetrU)r)�cmdr��c_archsr�s     r�_universal_flagszGnu95FCompiler._universal_flags<s����|�x�'�'��I��
��$�$�&�&���W���-3�G�G�M�M�&�)�)�*�@�	3�	3�D��3��%�%�
3�$�'�/�/��!�!�7�D�/�2�2�2���rc��t�|��}|�|j��}|r||dd�<|S�Nr)r	�	get_flagsr�r<�r)�flagsr�s   rr�zGnu95FCompiler.get_flagsLsE���&�&�t�,�,���*�*�4�+<�=�=�
��	#�"�E�"�1�"�I��rc��t�|��}|�|j��}|r||dd�<|Sr�)r	rZr�r>r�s   rrZz"Gnu95FCompiler.get_flags_linker_soSsD���0�0��6�6���*�*�4�>�:�:�
��	#�"�E�"�1�"�I��rc���t�|��}tjdk�r|j}|�r|jdkr�|���}|r�tj�	|�
����}tjj|gtjfdz�R�}tj�|d��}tj�	|��}tj�
tj�|d����r|�|��|���}|r|�|��|S)Nrrzrmrnzlibmingwex.a)r	rxrrr�r��
get_targetrMr^rorcrprrrqrVrk)	r)rWr�rXrtrur^�mingwdirrws	         rrxzGnu95FCompiler.get_library_dirsZs,���+�+�D�1�1���<�7�"�"���J��
-�j�6�&�@�@����*�*���-���(�(��)<�)<�)>�)>�?�?�A��7�<��@�b�i�]�Q�->�@�@�@�D��7�<�<��e�4�4�D�!�w�/�/��5�5�H��w�~�~�b�g�l�l�8�^�&L�&L�M�M�-��
�
�8�,�,�,��3�3�5�5���	)��J�J�'�(�(�(��
rc��t�|��}tjdkr|�d��tjdkrv|j}|rV|jdkrKd|vrG|�d��}|�|dzd��|�|dzd��|j}|r
|jdkrgS	|S)	NrGr|rrzr{r�mingwex�mingw32)	r	r�rr�remover�r�r��insert)r)rWr��is    rr�zGnu95FCompiler.get_librariesms����(�(��.�.���<�8�#�#��J�J�|�$�$�$��<�7�"�"���J��
1�j�6�&�@�@��C�<�<��	�	�%�(�(�A��J�J�q�1�u�i�0�0�0��J�J�q�1�u�i�0�0�0���J��
�j�6�&�@�@��	���
rc�j�	tj|jdgztjtj���}|���\}}|pd|pdz}t|��}t�|��}|r|�d��Sn#ttj
f$rYnwxYwdS)Nz-v)�stdin�stderrrr�)r\rr;r�communicater�TARGET_Rr%r&r`ra)r)�p�stdoutr�rbr+s      rr�zGnu95FCompiler.get_targets���	"�� ��!�T�F�*� �o�!�����A�
�]�]�_�_�N�F�F��m���
�#�6�F�5�V�<�<�F�����'�'�A��
"��w�w�q�z�z�!�
"����6�7�	�	�	��D�	�����rs�AB�B0�/B0c��tj��}|D]Z}t|d��5}	|�d��}|sn|�|���.	ddd��n#1swxYwY�[tj|�����}|�d��}|�	d��S)N�rbTi�ascii�=)
�hashlib�sha1�open�read�update�base64�	b32encode�digest�decode�rstrip)r)�	filenames�h�fnr��block�texts       r�_hash_fileszGnu95FCompiler._hash_files�s����L�N�N���	$�	$�B��b�$���
$�1�$��F�F�6�N�N�E� ����H�H�U�O�O�O�	$��	
$�
$�
$�
$�
$�
$�
$�
$�
$�
$�
$����
$�
$�
$�
$�������
�
�+�+���{�{�7�#�#���{�{�3���s�0A%�%A)	�,A)	c��|j}|jdkrtd���|�t	|��t	|��z��}t��rd}nd}dtj�tj�	|d����ddd�z}	|	d	z|zd
z|z}
|
dz}|
dz}|
d
z}
tj�
||��}tj�
||��}tj�
||
��}tj�|��r||fS|rdgt	|��zdgz}|�|||t	|��dd|zddddgz���t��rd}nd}d|zd|z|g}|j
s|���|�|jg|z��||fS)zeCreate a wrapper shared library for the given objects

        Return an MSVC-compatible lib
        rzzThis method only supports MSVC�	win_amd64rrnrN��.z
.gfortran-z.dllz.defz.libz-Wl,--whole-archivez-Wl,--no-whole-archivez-Wl,--allow-multiple-definitionz-Wl,--output-def,z-Wl,--export-all-symbolsz-Wl,--enable-auto-importz-staticz-mlong-double-64)�
output_dir�extra_postargsz/MACHINE:X64z/MACHINE:X86z/def:z/OUT:)r�r�r(r��listrrMr^�splitext�basenamerpr�link_shared_object�initialized�
initialize�spawnrn)r)�objectsr��
extra_dll_dir�chained_dlls�
is_archiver��object_hash�tagr��	root_name�dll_name�def_name�lib_name�dll_path�def_path�lib_path�	specifier�lib_argss                   r�_link_wrapper_libz Gnu95FCompiler._link_wrapper_lib�s5���_�
��#�v�-�-��=�>�>�>��&�&�t�G�}�}�t�L�7I�7I�'I�J�J���:�:�	��C�C��C��2�7�+�+��G���W�Q�Z�(�(�*�*�*+�-�-/�a�R�1�1���s�N�[�0�<�?�#�E�	��v�%���v�%���v�%���7�<�<�
�x�8�8���7�<�<�
�H�5�5���7�<�<�
�H�5�5��
�7�>�>�(�#�#�	&��X�%�%��	3�-�.��g���>�0�1�2�G������$���-�-�1�#�h�.�*�*��"�
1��		 �	�	�	��:�:�	'�&�I�I�&�I��h�&��(�(:�I�F���%�	$��!�!�#�#�#����*�.�)�H�4�5�5�5���!�!rc��|jdvS)N)rz)r�)r)�compilers  r�can_ccompiler_linkz!Gnu95FCompiler.can_ccompiler_link�s���%�Z�7�7rc��|jjdkr�g}g}|D]T}|����d��r|�|���?|�|���Ug}g}|ddd�D]L}	|�|	g|||d���\}
}|�d|
��|�d|���M|s|S|�||||d���\}
}|
g|zStd	���)
z�
        Convert a set of object files that are not compatible with the default
        linker, to a file that is compatible.
        rzz.aN���T)r�r�rFzUnsupported C compiler)r�r��lower�endswithrVrr�r()r)r�r�r��archives�
plain_objects�obj�chained_libsr��archivern�dlls            r�wrap_unlinkable_objectsz&Gnu95FCompiler.wrap_unlinkable_objects�sU��
�?�(�F�2�2��H��M��
.�
.���9�9�;�;�'�'��-�-�.��O�O�C�(�(�(�(�!�(�(��-�-�-�-��L��L�#�D�D�b�D�>�
,�
,���1�1��I��!�!-�#�2�%�%���S��#�#�A�s�+�+�+��#�#�A�s�+�+�+�+� �
$�#�#��-�-����)� �.�"�"�H�C���5�<�'�'��5�6�6�6r)r�r�r�r�r�r�r0r�r�r�r�rrr rVrr�rDr�r�rZrxr�r�r�rr	rrrrr
r

s��������M�%��+�K����&'��.��!�>�2�4�4�4�4�4�4�4�4�4�1�1�1����"�������K��� ��
�|���/�0�0�3��K� �'�'��4�4�4� �8� �"�"�1�%�b�q�b�)�T�1�1�`�
3�
3���C� �'�'�	�2�2�2�2�
�C���� ���������&���$���$ � � �<"�<"�<"�|8�8�8�+7�+7�+7�+7�+7rc���|dd�}tjd���\}}tj|��	tj�|��}tj�|��ddz}	|�d|d|g��t|tt|���}|���|jdktj�
|��rtj|��tj|��S#tj�
|��rtj|��wwxYw#tj|��wxYw)	z7Return true if the architecture supports the -arch flagNz.f)�suffixrz.or�z-c)r�r��cwd)�tempfile�mkstemprM�closer^r_r�rUrrrr��
returncoderqr�)r�r��newcmd�fid�filenamertrbr�s        rr�r�s=��
����V�F��$�D�1�1�1�M�C���H�S�M�M�M���G�O�O�H�%�%����!�!�(�+�+�A�.��5��	"��M�M�7�D�$��9�:�:�:��f�V�D�a�@�@�@�A�
�M�M�O�O�O��<�1�$��w�~�~�f�%�%�
"��	�&�!�!�!�
�	�(�������w�~�~�f�%�%�
"��	�&�!�!�!�!�
"�����	�	�(�������s%�AE�AD�3E�6E�E�E+�__main__)�log)�customized_fcompilerrIr�g95)#r$rMrrRrrr�r�r\rrr�numpy.distutils.exec_commandr�numpy.distutils.fcompilerr�distutils.versionr�	compilersr�r�rr	r
r�r��	distutilsr �numpy.distutilsr!�
set_verbosity�printr��	Exception�errr�<module>r-s0��	�	�	�	�	�	�	�	�
�
�
�
�����������������
�
�
�
�����*�*�*�*�*�*�*�*�*�*�H�H�H�H�H�H�/�/�/�/�/�/�*�*�*�*�*�*�
�-�.�	��2�:�2�3�3��
M�M�M�m'�m'�m'�m'�m'�9�m'�m'�m'�`A7�A7�A7�A7�A7�\�A7�A7�A7�H���(�z���������4�4�4�4�4�4��C��a����	�E�
�
�u�
%�
%�
1�
1�
3�
3�4�4�4��
��"�"�5�)�)�5�5�7�7�8�8�8�8�8������
��a�������������������s�&C(�(D�-C>�>D

Hacked By AnonymousFox1.0, Coded By AnonymousFox