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/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

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

6��a�k�@s�ddlZddlZddlZddlZddlZddlZddlmZddlmZddl	m
Z
mZmZm
Z
mZddlmZmZmZmZmZddlmZddlmZddlmZdd	lmZmZdd
lmZm Z m!Z!m"Z"m#Z#m$Z$ddl%Z%da&e%�'�Z(e)�Z*dd�Z+d
d�Z,dd�Z-e,ede-�dKdd�Z.e,ede.�dLdd�Z/e,ede/�			dMdd�Z0e,ede0�dNdd�Z1e,ede1�d d!�Z2d"d#�Z3e,ed$e3�dOd%d&�Z4e,ed'e4�dPd)d*�Z5d+dgfd,d-�Z6e,ed.e6�d/d0�Z7e,ed1e7�d2e
d3<d4e
d5<d6e
d7<d8e
d9<d:e
d;<d<e
d=<ej8d>7_8ej9d?k�r&d@e
dA<e!��r&e�:dB�dCej8e_8e
Z;					dQdDdE�Z
e
e_
eZ<dFdG�Zee_dHD]Z=ej>�?dIe=dJ�Z@e@du�rWeAe@dGe��q@dS)R�N)�copy)�	ccompiler)�compiler_class�gen_lib_options�get_default_compiler�new_compiler�	CCompiler)�DistutilsExecError�DistutilsModuleError�DistutilsPlatformError�CompileError�UnknownFileError)�customize_compiler)�LooseVersion)�log)�filepath_from_subprocess_output�forward_bytes_to_stdout)�	cyg2win32�is_sequence�mingw32�get_num_build_jobs�_commandline_dep_string�sanitize_cxx_flagscCs�|d}tj�|�sdSt|d��}|��}Wd�n1s wYt|||�}|d}||kr5dSd�|dd��}	dd�tj|	dd	�D�}
zt�	|�j
}|
D]}t�	|�j
|kraWdSqSWd
StynYdSw)z�
    Check if an objects needs to be rebuild based on its dependencies

    Parameters
    ----------
    obj : str
        object file

    Returns
    -------
    bool
    �.dT�rN����cSs"g|]
}|dkr|�d�s|�qS)�
�:)�endswith)�.0�x�r"�;/usr/lib/python3/dist-packages/numpy/distutils/ccompiler.py�
<listcomp>Es�z _needs_build.<locals>.<listcomp>)�posixF)�os�path�exists�open�	readlinesr�join�shlex�split�stat�st_mtime�OSError)�obj�cc_args�extra_postargs�pp_opts�dep_file�f�lines�cmdline�last_cmdline�contents�deps�t_objr"r"r#�_needs_build%s.
�����r=cs�fdd�}t|||�dS)Ncs�|g|�Ri|��S�Nr")�self�args�kw��funcr"r#�<lambda>Ysz replace_method.<locals>.<lambda>)�setattr)�klass�method_namerC�mr"rBr#�replace_methodWsrIcCsdS)z�
    Does nothing here, but is called by the get_version method and can be
    overridden by subclasses. In particular it is redefined in the `FCompiler`
    class where more documentation can be found.

    Nr"�r?r"r"r#�CCompiler_find_executablesbsrK�find_executablescCs:|dur|}t|�rd�t|��}t�|�z|jr"t�|�WdStj|tjd�WdStj	yE}z|j
}|j}WYd}~n6d}~wtyv}z&d|�d�}z	|�
tjj�}Wntyi|�
d�}Ynwd}WYd}~nd}~wwt|�r�d�t|��}|jr�t|�t�d|�r�d	}nd
}td|||f��)a�
    Execute a command in a sub-process.

    Parameters
    ----------
    cmd : str
        The command to execute.
    display : str or sequence of str, optional
        The text to add to the log file kept by `numpy.distutils`.
        If not given, `display` is equal to `cmd`.

    Returns
    -------
    None

    Raises
    ------
    DistutilsExecError
        If the command failed, i.e. the exit status was not 0.

    N� ��stderrz

z


�utf8�sToo many open filesz2
Try rerunning setup command until build succeeds.rz)Command "%s" failed with exit status %d%s)rr+�listr�info�verbose�
subprocess�check_output�STDOUT�CalledProcessError�output�
returncoder0�encode�sys�stdout�encoding�AttributeErrorr�re�searchr	)r?�cmd�display�exc�o�s�e�msgr"r"r#�CCompiler_spawnpsF
�������ri�spawnrcCs�|durd}g}|D]h}tj�tj�|��\}}tj�|�d}|tj�|�d�}|�d�rN|�d�d}|d|�}	tj�tj�	|	��}	|	||d�}||j
vr[td||f��|rctj�|�}tj�|||j
�}
|�|
�q
|S)a�
    Return the name of the object files for the given source files.

    Parameters
    ----------
    source_filenames : list of str
        The list of paths to source files. Paths can be either relative or
        absolute, this is handled transparently.
    strip_dir : bool, optional
        Whether to strip the directory from the returned paths. If True,
        the file name prepended by `output_dir` is returned. Default is False.
    output_dir : str, optional
        If given, this path is prepended to the returned paths to the
        object files.

    Returns
    -------
    obj_names : list of str
        The list of paths to the object files corresponding to the source
        files in `source_filenames`.

    Nr�z..�z"unknown file type '%s' (from '%s'))r&r'�splitext�normpath�
splitdrive�isabs�
startswith�rfind�basename�abspath�src_extensionsr
r+�
obj_extension�append)r?�source_filenames�	strip_dir�
output_dir�	obj_names�src_name�base�ext�i�d�obj_namer"r"r#�CCompiler_object_filenames�s&

r��object_filenamesc	sBt�}	t�tdurt�|	�aWd�n1swY|s"gSddlm}
m}m}t	�|
�rVg}
dD]}t
�d|�}|durCq5|
�d|d�|�f�q5d�|
�}
n�j
}d	d�|�f}
t�|
���|||||��\}}��}���||��d
d���}
�r�|
dd���7}
t�|
�����fdd
�}t	�|
�r�t|���}gg}}|D]4}||vr�||\}}�jdkr�t|�}t|�}||�r�||�s�|�|||ff�q�|�|||ff�q�|}|D]}||�q�n|��}t|�dk�r|	dk�rddl}|j�|	�}|�||�|��|S|D]}||��q|S)a�
    Compile one or more source files.

    Please refer to the Python distutils API reference for more details.

    Parameters
    ----------
    sources : list of str
        A list of filenames
    output_dir : str, optional
        Path to the output directory.
    macros : list of tuples
        A list of macro definitions.
    include_dirs : list of str, optional
        The directories to add to the default include file search path for
        this compilation only.
    debug : bool, optional
        Whether or not to output debug symbols in or alongside the object
        file(s).
    extra_preargs, extra_postargs : ?
        Extra pre- and post-arguments.
    depends : list of str, optional
        A list of file names that all targets depend on.

    Returns
    -------
    objects : list of str
        A list of object file names, one per source file `sources`.

    Raises
    ------
    CompileError
        If compilation fails.

    Nr)�	FCompiler�	is_f_file�has_f90_header)�f77�f90�fix�	compiler_zFortran %s compiler: %srMrzC compiler: %s
zcompile options: '%s'z
extra options: '%s'cs|\}\}}t|����sdS	t�|tvr$t�|�	Wd�nWd�n1s.wYt�d�qz7t���|||����Wd�n1sQwYWt�t�|�Wd�dS1sjwYdSt�
t�|�Wd�w1s�wYw)NTg�������?)	r=�_global_lock�_processing_files�add�time�sleep�_job_semaphore�_compile�remove)r@r1�srcr~�r2r3r4r?r"r#�single_compile2s.
��
�
��(��z)CCompiler_compile.<locals>.single_compile�absoftrk)rr�r��	threading�	Semaphore�numpy.distutils.fcompilerr�r�r��
isinstance�getattrrwr+�compiler_sorrS�_setup_compile�_get_cc_argsrR�keys�
compiler_typer�items�len�multiprocessing.pool�pool�
ThreadPool�map�close)r?�sourcesrz�macros�include_dirs�debug�
extra_preargsr3�depends�jobsr�r�r�rc�fc�fcomp�ccomp�objects�buildr��objects_to_build�f77_objects�
other_objectsr1r�r~�build_itemsre�multiprocessingr�r"r�r#�CCompiler_compile�sr+
��

��



�
��r��compiler"cst�d|jj�jjf�t|d�rd|jdvr|j�d���fdd�}|d�r0|��j�|d	�rB�j	D]
\}}|�
||�q7|d
�rQ�jD]}|�|�qI|d�r^|�
|j�j�|d�rk|�|j�j�|d
�ru|��j�|d�r�|��j�dSdS)a�
    Customize compiler using distutils command.

    Parameters
    ----------
    cmd : class instance
        An instance inheriting from `distutils.cmd.Command`.
    ignore : sequence of str, optional
        List of `CCompiler` commands (without ``'set_'``) that should not be
        altered. Strings that are checked for are:
        ``('include_dirs', 'define', 'undef', 'libraries', 'library_dirs',
        'rpath', 'link_objects')``.

    Returns
    -------
    None

    zcustomize %s using %s�compiler�clangrz-ffp-exception-behavior=strictcst�|d�duo|�vSr>)r�)�attr�rb�ignorer"r#�allow�sz&CCompiler_customize_cmd.<locals>.allowr��define�undef�	libraries�library_dirs�rpath�link_objectsN)rrS�	__class__�__name__�hasattrr�rw�set_include_dirsr�r��define_macror��undefine_macro�
set_librariesr��set_library_dirsr��set_runtime_library_dirsr��set_link_objectsr�)r?rbr�r��name�value�macror"r�r#�CCompiler_customize_cmdus.�
�r��
customize_cmdcs�g}d}t|j���}dD]}||vr|�|�q
|D]}t||�r7t||�}t|t|��}|�|t|�f�qdt|d�d��fdd�|D�}d�	|�S)	Nr)
�versionr�r��
object_switch�compile_switchr�r�r�r�r�z%-rkzs = %scsg|]}�|�qSr"r")r �prop��fmtr"r#r$�sz'_compiler_to_string.<locals>.<listcomp>r)
rR�executablesr�rwr�r��maxr��reprr+)r��props�mxr��key�vr7r"r�r#�_compiler_to_string�s 
�

�
r�cCsZz|��Wn	tyYnwtjjdkr+td�t|j�tt|��td�dSdS)z�
    Print the compiler customizations to stdout.

    Parameters
    ----------
    None

    Returns
    -------
    None

    Notes
    -----
    Printing is only done if the distutils log threshold is < 2.

    rlzP********************************************************************************N)�get_version�	Exceptionr�_global_log�	threshold�printr�r�rJr"r"r#�CCompiler_show_customization�s�
�r��show_customizationc
	Cs�t�d|jj�t|�|rrz|j�d�Wnttfy"Ynwt	|d�rVd|j
dvrV|jsU|j
d�d�r?d\}}nd\}}|j
d�
||�g|j
d	d
�|_nt	|d�rdt�d|j
f�t	|d�srt�d
|jj�t	|d�r�d|j
dvs�d|j
dvs�d|j
dvr�d|_d
Stjdkr�dd
l}dd
l}|��}zQz4tj�|d�}t|d��
}	|	�d�Wd
�n1s�wY|j|g|dd|dgd�d|_Wnty�d|_Yn	wW|�|�d
SW|�|�d
S|�|�wd
S)am
    Do any platform-specific customization of a compiler instance.

    This method calls `distutils.sysconfig.customize_compiler` for
    platform-specific customization, as well as optionally remove a flag
    to suppress spurious warnings in case C++ code is being compiled.

    Parameters
    ----------
    dist : object
        This parameter is not used for anything.
    need_cxx : bool, optional
        Whether or not C++ has to be compiled. If so (True), the
        ``"-Wstrict-prototypes"`` option is removed to prevent spurious
        warnings. Default is False.

    Returns
    -------
    None

    Notes
    -----
    All the default options used by distutils can be extracted with::

      from distutils import sysconfig
      sysconfig.get_config_vars('CC', 'CXX', 'OPT', 'BASECFLAGS',
                                'CCSHARED', 'LDSHARED', 'SO')

    zcustomize %sz-Wstrict-prototypesr��ccr�gcc)r��g++)r�zc++rkNz#### %s #######�compiler_cxxzMissing compiler_cxx fix for r�r�Tr%zfile.c�wzint a;
z-MMDz-MFr)rzr�F)rrSr�r�rr�r�r_�
ValueErrorr�r�r�rq�replace�warn�
_auto_dependsr&r��tempfile�shutil�mkdtempr'r+r)�writer�r�rmtree)
r?�dist�need_cxx�a�br�r��tmpdir�fnr6r"r"r#�CCompiler_customize�sd�
��


��
�

��
�
�r��	customize�[-.\d]+cs���fdd�}|S)aU
    Simple matching of version numbers, for use in CCompiler and FCompiler.

    Parameters
    ----------
    pat : str, optional
        A regular expression matching version numbers.
        Default is ``r'[-.\d]+'``.
    ignore : str, optional
        A regular expression matching patterns to skip.
        Default is ``''``, in which case nothing is skipped.
    start : str, optional
        A regular expression matching the start of where to start looking
        for version numbers.
        Default is ``''``, in which case searching is started at the
        beginning of the version string given to `matcher`.

    Returns
    -------
    matcher : callable
        A function that is appropriate to use as the ``.version_match``
        attribute of a `CCompiler` class. `matcher` takes a single parameter,
        a version string.

    csz|�dd�}d}�rt��|�}|sdS|��}	t��||d��}|s'dS�r7t��|�d��r7|��}q	|�d�S)NrrMr)r�r`�match�endra�group)r?�version_string�posrH�r��pat�startr"r#�matcherBs 
z%simple_version_match.<locals>.matcherr")rr�r	r
r"rr#�simple_version_match(srFc	s.|s
t|d�r
|jS|��z|j}Wn
tyYdSw|r$|ds&dSz|j}Wn tyKz|j�WntyBYYdSw�fdd�}Ynwz
tj|tj	d�}Wn%tj
yo}z|j}|j}WYd}~nd}~wt
y{d}d}Ynwt|�}d}d}||vr�||�}|r�t|�}||_|S)	a�
    Return compiler version, or None if compiler is not available.

    Parameters
    ----------
    force : bool, optional
        If True, force a new determination of the version, even if the
        compiler already has a version attribute. Default is False.
    ok_status : list of int, optional
        The list of status values returned by the version look-up process
        for which a version string is returned. If the status value is not
        in `ok_status`, None is returned. Default is ``[0]``.

    Returns
    -------
    version : str or None
        Version string, in the format of `distutils.version.LooseVersion`.

    r�Nrcs"t��|�}|s
dS|�d�}|S)Nr�)r`rr)rrHr��rr"r#r
{s

z&CCompiler_get_version.<locals>.matcherrNrQ�)r�r�rL�version_cmdr_�
version_match�version_patternrUrVrWrXrYrZr0rr)	r?�force�	ok_statusrr
rYrd�statusr�r"rr#�CCompiler_get_versionWsN
�

����rr�cCs�|jdvr|St|�}|j|_|jdgt|jdd��|_tj�d�r@d|jdvr@|jd|jdg|jdd�|_|S|jdg|jdd�|_|S)z�
    Return the C++ compiler.

    Parameters
    ----------
    None

    Returns
    -------
    cxx : class instance
        The C++ compiler, as a `CCompiler` instance.

    )�msvc�intelw�intelemwrrkN�aix�	ld_so_aixrl)	r�rr�rr�r\�platformrq�	linker_so)r?�cxxr"r"r#�CCompiler_cxx_compiler�s

���r�cxx_compiler)�intelccompiler�IntelCCompilerz(Intel C Compiler for 32-bit applications�intel)r�IntelItaniumCCompilerz7Intel C Itanium Compiler for Itanium-based applications�intele)r�IntelEM64TCCompilerz(Intel C Compiler for 64-bit applications�intelem)r�IntelCCompilerWz3Intel C Compiler for 32-bit applications on Windowsr)r�IntelEM64TCCompilerWz3Intel C Compiler for 64-bit applications on Windowsr)�
pathccompiler�PathScaleCCompilerz2PathScale Compiler for SiCortex-based applications�pathcc))�linux.*r!)r+r#)r+r%)r+r*)�ntr)r,r�win32)�mingw32ccompiler�Mingw32CCompilerz>Mingw32 port of GNU C Compiler for Win32(for MSC built Python)rz+Setting mingw32 as default compiler for nt.))r,rc
Csp|durt��tjk}|durtj}z|durt|�}t|\}}}Wnty<d|}|dur8|d|}t|��wd|}zt	|�WnAt
y�}	z5t|	�}t�dt|��|dd�}zt	|�Wnt
y}}	z
t|	�}t
d|��d}	~	wwWYd}	~	nd}	~	wwz
tj|}
t|
�|}Wnty�t
d||f��w|d||�}||_t�d|�|S)	Nz5don't know how to compile C/C++ code on platform '%s'z with '%s' compilerznumpy.distutils.z,%s in numpy.distutils; trying from distutils�z4can't compile C/C++ code: unable to load module '%s'zBcan't compile C/C++ code: unable to find class '%s' in module '%s'znew_compiler returns %s)r�
get_threshold�INFOr&r�rr�KeyErrorr�
__import__�ImportError�strrSr
r\�modules�varsrTr�)�platr�rT�dry_runr�module_name�
class_name�long_descriptionrhrg�modulerFr"r"r#r�s^��������
��rcCsBt||||�}g}|D]}t|�r|�t|��q|�|�q|Sr>)�_distutils_gen_lib_optionsr�extendrRrw)r�r��runtime_library_dirsr�r�lib_optsrr"r"r#rs�r)�msvc9r�_msvc�bcpp�cygwinc�emxc�unixcz
distutils.r�r>)rr)NNNrNNN)r")r)rrr)NNNrr)Br&r`r\r,r�rUr�	distutilsr�distutils.ccompilerrrrrr�distutils.errorsr	r
rrr
�distutils.sysconfigr�distutils.versionr�numpy.distutilsr�numpy.distutils.exec_commandrr�numpy.distutils.misc_utilrrrrrrr�r��Lockr��setr�r=rIrKrir�r�r�r�r�r�rrr�_default_compilersrrS�_distutils_new_compilerr?�_ccr7�get�_mrEr"r"r"r#�<module>s� 2

E
-
�
/
Q
/C
�
�,
��

https://t.me/RX1948 - 2025