%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__/config.cpython-39.opt-1.pyc

a

z[yc�P�@s�ddlZddlZddlZddlZddlZddlZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZmZddl
Z
ddlmZddlmZdd	lmZmZmZmZmZmZmZd
e	d<de	d
<Gdd�de�ZGdd�d�ZdS)�N)�config)�LANG_EXT)�log)�	copy_file)�CompileError�	LinkError)�filepath_from_subprocess_output)�generate_manifest)�check_gcc_function_attribute�,check_gcc_function_attribute_with_intrinsics�check_gcc_variable_attribute�check_gcc_version_at_least�check_inline�check_restrict�check_compiler_gccz.f�f77z.f90�f90c@s�eZdZejdg7_dd�Zdd�Zdd�Zdd	�Zd
d�Z	d.dd�Z
d/dd�Zd0dd�Zd1dd�Z
d2dd�Zd3dd�Zd4dd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd5d*d+�Zd6d,d-�ZdS)7r)z
fcompiler=Nz!specify the Fortran compiler typecCsd|_t�|�dS�N)�	fcompiler�
old_config�initialize_options��self�r�D/usr/lib64/python3.9/site-packages/numpy/distutils/command/config.pyr$szconfig.initialize_optionsc
CsFt�|�ddlm}m}tjdkr�|jjdvr�|jj	s�z|j�
�WnXty�}z@t�
d�||jjjf}tt�
d��tj�|�|�WYd}~n
d}~00ddlm}|��dkr�|jj|jjfD]}d	|vr�|�d	�q�t|j|��sB||j|jd
|jd�|_|jdu�rB|j�|j�|j���rB|j�|�|j� �dS)Nr)�	FCompiler�
new_fcompiler�win32)�msvcZintelwZintelemwas                        Could not initialize compiler instance: do you have Visual Studio
                        installed?  If you are trying to build with MinGW, please use "python setup.py
                        build -c mingw32" instead.  If you have Visual Studio installed, check it is
                        correctly installed, and the right version (VS 2008 for python 2.6, 2.7 and 3.2,
                        VS 2010 for >= 3.3).

                        Original exception was: %s, and the Compiler class was %s
                        ============================================================================zd                        ============================================================================)�
msvc9compiler�
z	/MANIFEST�)�compiler�dry_run�forceZ
c_compiler)!r�_check_compilerZnumpy.distutils.fcompilerrr�sys�platformr"�
compiler_typeZinitializedZ
initialize�IOError�textwrap�dedent�	__class__�__name__�print�	distutils�errorsZDistutilsPlatformErrorrZget_build_versionZldflags_sharedZldflags_shared_debug�append�
isinstancerr#Z	customizeZdistributionZget_versionZ
customize_cmdZshow_customization)rrr�e�msgrZldflagsrrrr%(s>
�	�
$��zconfig._check_compilerc	
Cs�ddlm}ddlm}|j}|dvr.|j|_|jdurF|d|f��z||f|�}Wn4||fy�}z||_||�WYd}~n
d}~00||_|S)Nr)r)�DistutilsExecError�rrz%s compiler is not set)�distutils.ccompilerrZdistutils.errorsr5r"r)	rZmth�lang�argsrr5Z
save_compiler�retr3rrr�_wrap_methodYs
zconfig._wrap_methodcCs4|�tj|||||f�\}}|j�|d�||fS)Nz.d)r;r�_compile�
temp_filesr1)r�body�headers�include_dirsr8�src�objrrrr<is


�zconfig._compilec

Cs�|jjdk�r�|pgdd�}|p$gdd�}|dvr�d}|jr�|jjpJgD]N}|�d�r�zt�dd|g�}Wnttjfy�Yn
0t	|�}|�
|�qL|jjp�gD]}||vr�|�
|�q�|D]�}|�d�r�q�d}	|p�gD],}
tj
�|
d|�}tj
�|�r�d	}	�qq�|	�rq�d}	|D]X}
tj
�|
d
|�}tj
�|��rtj
�|
d|�}t||�|j�
|�d	}	�qx�q|	�r�q�t�d||f�q�n|jjdk�r�t|�|�tj|||||||f�S)
Nrr6�cz/usr/libZcygpathz-wFz%s.libTzlib%s.az+could not find library %r in directories %sZmingw32)r"r(r�library_dirs�
startswith�
subprocess�check_output�OSError�CalledProcessErrorrr1�	libraries�os�path�join�isfilerr=r�warnr	r;r�_link)
rr>r?r@rJrDr8�dZlibnameZ
fileexists�libdirZlibfileZlibfile2rrrrPqs`
�


�

��zconfig._linkNrCcCs|��|�d|g|�S)Nz2/* we need a dummy line to make distutils happy */)r%�try_compile)r�headerr@rDr8rrr�check_header�s
�zconfig.check_headercCs(|��t�d�||f}|�|||�S)Nz�
            int main(void)
            {
            #ifndef %s
                (void) %s;
            #endif
                ;
                return 0;
            }�r%r*r+rS�r�symbolr?r@r>rrr�
check_decl�s
�
zconfig.check_declcCs&|��t�d�|f}|�|||�S)Nz�
            int main(void)
            {
            #if %s
            #else
            #error false or undefined macro
            #endif
                ;
                return 0;
            }rVrWrrr�check_macro_true�s
	�zconfig.check_macro_truecCsv|��t�d�d|i}d}zHz |�|d|i||d�d}WntjjyZd}Yn0W|��n
|��0|S)zYCheck type availability. Return True if the type can be compiled,
        False otherwisez�
            int main(void) {
              if ((%(name)s *) 0)
                return 0;
              if (sizeof (%(name)s))
                return 0;
            }
            �nameF�typerCT)r%r*r+r<r/r0r�_clean)r�	type_namer?r@rDr>�strrr�
check_type�s�	�zconfig.check_typec	Cs\|��t�d�}|�|d|i||d�|��|r�t�d�}|D]D}z,|�|||d�||d�|��|WSty�YqD0qDt�d�}d}d}	z*|�|||	d�||d�|��Wq�Wq�ty�|	d}d	|	d}	Yq�0q�|	}
||
k�rX|
|d	|}	z*|�|||	d�||d�|��|	}
Wq�t�yT|	d}Yq�0q�|S)
zCheck size of a given type.a,
            typedef %(type)s npy_check_sizeof_type;
            int main (void)
            {
                static int test_array [1 - 2 * !(((long) (sizeof (npy_check_sizeof_type))) >= 0)];
                test_array [0] = 0

                ;
                return 0;
            }
            r\rCaW
                typedef %(type)s npy_check_sizeof_type;
                int main (void)
                {
                    static int test_array [1 - 2 * !(((long) (sizeof (npy_check_sizeof_type))) == %(size)s)];
                    test_array [0] = 0

                    ;
                    return 0;
                }
                )r\�sizea3
            typedef %(type)s npy_check_sizeof_type;
            int main (void)
            {
                static int test_array [1 - 2 * !(((long) (sizeof (npy_check_sizeof_type))) <= %(size)s)];
                test_array [0] = 0

                ;
                return 0;
            }
            rr!�)r%r*r+r<r]r)rr^r?r@rDZexpectedr>raZlowZmidZhighrrr�check_type_size�sR
�
�

�
�zconfig.check_type_sizeFc	
Cs�|��g}	|r6t|�tkr(|	�|�n|	�d|�|	�d�|	�d|�|	�d�|	�d�|r�|durrd}|	�d||f�n|	�d|�|	�d	�|	�d
�d�|	�d}	|�|	||||�S)N�int %s (void);�#ifdef _MSC_VER�#pragma function(%s)�#endif�int main (void) {��	  %s(%s);�  %s;�  return 0;�}�
)r%r\�strr1rM�try_link)
r�funcr?r@rJrD�decl�call�	call_argsr>rrr�
check_func<s*





�zconfig.check_funcc	Cs|��g}	|r4|��D]\}
}|r|	�d|
�q|	�d�|D]}|	�d|�qB|	�d�|	�d�|r�|D]X}
|
|vr�||
r�|r�|
|vr�||
s�d}
n||
}
|	�d|
|
f�qr|	�d|
�qrn|D]}
|	�d|
�q�|	�d	�|	�d
�d�|	�d}	|�|	||||�S)a0Check a list of functions at once.

        This is useful to speed up things, since all the functions in the funcs
        list will be put in one compilation unit.

        Arguments
        ---------
        funcs : seq
            list of functions to test
        include_dirs : seq
            list of header paths
        libraries : seq
            list of libraries to link the code snippet to
        library_dirs : seq
            list of library paths
        decl : dict
            for every (key, value), the declaration in the value will be
            used for function in key. If a function is not in the
            dictionary, no declaration will be used.
        call : dict
            for every item (f, value), if the value is True, a call will be
            done to the function f.
        rdrerfrgrhrirjrkrlrmrn)r%�itemsr1rMrp)rZfuncsr?r@rJrDrrrsrtr>�f�vrqr9rrr�check_funcs_once^s6





�zconfig.check_funcs_oncecCst|�S)zUReturn the inline keyword recognized by the compiler, empty string
        otherwise.)rrrrrr�szconfig.check_inlinecCst|�S)zWReturn the restrict keyword recognized by the compiler, empty string
        otherwise.)rrrrrr�szconfig.check_restrictcCst|�S)z$Return True if the C compiler is gcc)rrrrrr�szconfig.check_compiler_gcccCst|||�Sr)r
)r�	attributer[rrrr
�sz#config.check_gcc_function_attributecCst|||||�Sr)r)rrzr[�codeZincluderrrr�s�z3config.check_gcc_function_attribute_with_intrinsicscCs
t||�Sr)r)rrzrrrr�sz#config.check_gcc_variable_attributercCst||||�S)zYReturn True if the GCC version is greater than or equal to the
        specified version.)r
)r�major�minorZ
patchlevelrrrr
�sz!config.check_gcc_version_at_leastc
Csztjdtdd�|��d\}}	�z$t�}
z&|�||||||�\}}}
|
��Wn"tyr|
j}	|
���Yn0t	j
�d|
�}
ztj
|
gdd�}	WnHtjy�}z|j}d}	WYd}~n*d}~0ty�d	}d}	Yn
0t|	�}	tt	d
��r6t	�|�}t	�|��r:t	�|�}t�d|f�|tjk�r:t�n|}t�d�Wn"ttf�yht�d
�Yn0|��||	fS)z�Try to compile, link to an executable, and run a program
        built from 'body' and 'headers'. Returns the exit status code
        of the program and its output.
        z�
+++++++++++++++++++++++++++++++++++++++++++++++++
Usage of get_output is deprecated: please do not 
use it anymore, and avoid configuration checks 
involving running executable on the target machine.
+++++++++++++++++++++++++++++++++++++++++++++++++
rb)�
stacklevel)�ri�.)�cwdriN��WEXITSTATUSz subprocess exited with signal %dzsuccess!zfailure.)�warningsrO�DeprecationWarningr%�
GrabStdoutrP�restore�	Exception�datarKrLrMrFrGrI�
returncoderHr�hasattrr��WIFSIGNALED�WTERMSIGr�error�signal�SIGINT�KeyboardInterrupt�inforrr])rr>r?r@rJrDr8Zuse_teeZexitcode�outputZgrabberrArBZexe�excZ
exitstatusZsigrrr�
get_output�sN�
�



zconfig.get_output)NNrC)NN)NN)NNN)NNNN)NNNNFFN)NNNNFFN)rr)NNNNrCN)r-�
__module__�__qualname__rZuser_optionsrr%r;r<rPrUrYrZr`rcruryrrrr
rrr
r�rrrrrsH�16
�
�
�

T�
#�
=
�rc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
r�cCstj|_d|_|t_dS)Nri)r&�stdout�
sys_stdoutr�rrrr�__init__�szGrabStdout.__init__cCs|j�|�|j|7_dSr)r��writer�)rr�rrrr��szGrabStdout.writecCs|j��dSr)r��flushrrrrr�szGrabStdout.flushcCs|jt_dSr)r�r&r�rrrrr�szGrabStdout.restoreN)r-r�r�r�r�r�r�rrrrr��sr�)rKr�rFr&r*r�Zdistutils.command.configrrrr/rZdistutils.file_utilrr7rrZnumpy.distutils.exec_commandrZ numpy.distutils.mingw32ccompilerr	Z numpy.distutils.command.autodistr
rrr
rrrr�rrrr�<module>s*$Z

Zerion Mini Shell 1.0