Current File : //usr/lib64/python2.7/site-packages/numpy/distutils/command/config.pyo
�
E�`Qc@sddlZddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZddlm
Z
mZddlZddlmZddlmZdd	lmZmZdd
lmZded<d
ed<defd��YZdefd��YZdS(i����N(tconfig(tLANG_EXT(tlog(t	copy_file(tCompileErrort	LinkError(texec_command(tgenerate_manifest(tcheck_inlinetcheck_compiler_gcc4(t
get_exceptions.ftf77s.f90tf90RcBseZejdg7_d�Zdddddd�Zd�Zd�Zd�Z	d�Z
dddd	�Zddd
�Zddd�Z
dddd�Zddddd
�Zddddeedd�Zddddeedd�Zd�Zd�Zdddddd�ZRS(s
fcompiler=s!specify the Fortran compiler typecCsd|_tj|�dS(N(tNonet	fcompilert
old_configtinitialize_options(tself((sD/usr/lib64/python2.7/site-packages/numpy/distutils/command/config.pyRs	tccCs/tjdt�tj|||||||�S(Ns�
+++++++++++++++++++++++++++++++++++++++++++++++++
Usage of try_run is deprecated: please do not 
use it anymore, and avoid configuration checks 
involving running executable on the target machine.
+++++++++++++++++++++++++++++++++++++++++++++++++
(twarningstwarntDeprecationWarningRttry_run(Rtbodytheaderstinclude_dirst	librariestlibrary_dirstlang((sD/usr/lib64/python2.7/site-packages/numpy/distutils/command/config.pyR!s	c
CsNtj|�ddlm}m}tjdkr�|jjdkr�|jj	s�y|jj
�Wq�tk
r�t�}d||jj
jf}dGHtjj|��q�Xq�nt|j|�sJ|d|jd|jd	d
d|j�|_|jdk	rJ|jj|j�|jj�rG|jj|�|jj�qGqJndS(Ni����(t	FCompilert
new_fcompilertwin32tmsvcs�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, VS 2003 for
2.5, etc...). Original exception was: %s, and the Compiler
class was %s
============================================================================sL============================================================================tcompilertdry_runtforceit
c_compiler(Rt_check_compilertnumpy.distutils.fcompilerRRtsystplatformR!t
compiler_typetinitializedt
initializetIOErrorR
t	__class__t__name__t	distutilsterrorstDistutilsPlatformErrort
isinstanceRR"R
t	customizetdistributiontget_versiont
customize_cmdtshow_customization(RRRtetmsg((sD/usr/lib64/python2.7/site-packages/numpy/distutils/command/config.pyR%,s*
!
	c	Cs�ddlm}ddlm}|j}|dkrD|j|_ny||f|�}Wn5||fk
r�tt��}||_|�nX||_|S(Ni����(R(tDistutilsExecErrorRR(RR(tdistutils.ccompilerRtdistutils.errorsR:R!RtstrR
(	RtmthRtargsRR:t
save_compilertretR9((sD/usr/lib64/python2.7/site-packages/numpy/distutils/command/config.pyt_wrap_methodRs		
	cCs"|jtj|||||f�S(N(RBRt_compile(RRRRR((sD/usr/lib64/python2.7/site-packages/numpy/distutils/command/config.pyRCasc
Cse|jjdkr|pg}|p(g}|d
kr�d}|jr�xi|jjpYgD]U}|jd�r�tdd|gdt�\}}	|s�|	}q�n|j|�qZWx9|jjp�gD]"}
|
|kr�|j|
�q�q�Wq�nxH|D]}
|
jd�rq�nt}xI|p&gD];}t	j
j|d	|
�}
t	j
j|
�r't
}Pq'q'W|rrq�nt}xy|D]q}t	j
j|d
|
�}
t	j
j|
�rt	j
j|d	|
�}t|
|�|jj|�t
}PqqW|rq�ntjd|
|f�q�Wn|jjdkr=t|�n|jtj|||||||f�S(NR RRRs/usr/libtcygpaths-wtuse_tees%s.libslib%s.as+could not find library %r in directories %stmingw32(sf77sf90(R!R)RRt
startswithRtFalsetappendRtostpathtjointisfiletTrueRt
temp_filesRRRRBRt_link(RRRRRRRtdtstotlibnamet
fileexiststlibdirtlibfiletlibfile2((sD/usr/lib64/python2.7/site-packages/numpy/distutils/command/config.pyRPesZ

	


	
	cCs |j�|jd|g|�S(Ns2/* we need a dummy line to make distutils happy */(R%ttry_compile(RtheaderRRR((sD/usr/lib64/python2.7/site-packages/numpy/distutils/command/config.pytcheck_header�s
cCs-|j�d||f}|j|||�S(NsD
int main()
{
#ifndef %s
    (void) %s;
#endif
    ;
    return 0;
}(R%RY(RtsymbolRRR((sD/usr/lib64/python2.7/site-packages/numpy/distutils/command/config.pyt
check_decl�s
	cCs*|j�d|f}|j|||�S(NsW
int main()
{
#if %s
#else
#error false or undefined macro
#endif
    ;
    return 0;
}(R%RY(RR\RRR((sD/usr/lib64/python2.7/site-packages/numpy/distutils/command/config.pytcheck_macro_true�s


cCs�|j�di|d6}t}zOy+|j|i|d6||d�t}Wntjjk
rnt}nXWd|j�X|S(sYCheck type availability. Return True if the type can be compiled,
        False otherwises[
int main() {
  if ((%(name)s *) 0)
    return 0;
  if (sizeof (%(name)s))
    return 0;
}
tnamettypeRN(R%RHRCRNR/R0Rt_clean(Rt	type_nameRRRRtst((sD/usr/lib64/python2.7/site-packages/numpy/distutils/command/config.pyt
check_type�s



cCs�|j�d}|j|i|d6||d�|j�|r�d}x_|D]T}y:|j|i|d6|d6||d�|j�|SWqNtk
r�qNXqNWnd}d}d}	xmtr*y7|j|i|d6|	d6||d�|j�PWq�tk
r&|	d}d	|	d}	q�Xq�W|	}
x|||
kr�|
|d	|}	y<|j|i|d6|	d6||d�|j�|	}
Wq4tk
r�|	d}q4Xq4W|S(
sCheck size of a given type.s�
typedef %(type)s npy_check_sizeof_type;
int main ()
{
    static int test_array [1 - 2 * !(((long) (sizeof (npy_check_sizeof_type))) >= 0)];
    test_array [0] = 0

    ;
    return 0;
}
R`Rs�
typedef %(type)s npy_check_sizeof_type;
int main ()
{
    static int test_array [1 - 2 * !(((long) (sizeof (npy_check_sizeof_type))) == %(size)s)];
    test_array [0] = 0

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

    ;
    return 0;
}
iii(R%RCRaRRN(RRbRRRtexpectedRRetlowtmidthigh((sD/usr/lib64/python2.7/site-packages/numpy/distutils/command/config.pytcheck_type_size�sL








	







c	
Cs�|j�g}	|r*|	jd|�n|	jd�|	jd|�|	jd�|	jd�|r�|dkr}d}n|	jd||f�n|	jd|�|	jd	�|	jd
�dj|	�d}	|j|	||||�S(Nsint %s (void);s#ifdef _MSC_VERs#pragma function(%s)s#endifsint main (void) {ts	  %s(%s);s  %s;s  return 0;t}s
(R%RIR
RLttry_link(
RtfuncRRRRtdecltcallt	call_argsR((sD/usr/lib64/python2.7/site-packages/numpy/distutils/command/config.pyt
check_func,s$



	

c	Cs�|j�g}	|rPx7|j�D]&\}
}|r#|	jd|
�q#q#Wn|	jd�x|D]}|	jd|�qdW|	jd�|	jd�|r#x�|D]v}
|
|kr||
r|o�|
|ko�||
s�d}
n
||
}
|	jd|
|
f�q�|	jd|
�q�Wn"x|D]}
|	jd|
�q*W|	jd	�|	jd
�dj|	�d}	|j|	||||�S(s.Check 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
        libraru_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
            dictionay, 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.
        sint %s (void);s#ifdef _MSC_VERs#pragma function(%s)s#endifsint main (void) {Rks	  %s(%s);s  %s;s  return 0;Rls
(R%titemsRIRLRm(RtfuncsRRRRRoRpRqRtftvRnR?((sD/usr/lib64/python2.7/site-packages/numpy/distutils/command/config.pytcheck_funcs_onceKs4





	



cCs
t|�S(sUReturn the inline keyword recognized by the compiler, empty string
        otherwise.(R(R((sD/usr/lib64/python2.7/site-packages/numpy/distutils/command/config.pyR�scCs
t|�S(s*Return True if the C compiler is gcc >= 4.(R	(R((sD/usr/lib64/python2.7/site-packages/numpy/distutils/command/config.pyR	�scCs�tjdt�ddlm}m}|j�d\}	}
yt�}y5|j||||||�\}}
}|j	�Wn|j
}
|j	��nXtjj
d|�}t|dd�\}}
ttd�r8tj|�}	tj|�r>tj|�}tjd	|f�|tjkr5t�q5q>n|}	tjd
�Wn$||fk
rrtjd�nX|j�|	|
fS(
s�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.
        s�
+++++++++++++++++++++++++++++++++++++++++++++++++
Usage of get_output is deprecated: please do not 
use it anymore, and avoid configuration checks 
involving running executable on the target machine.
+++++++++++++++++++++++++++++++++++++++++++++++++
i����(RRi�Rkt.t
execute_intWEXITSTATUSs subprocess exited with signal %dssuccess!sfailure.(i�Rk(RRRR;RRR%t
GrabStdoutRPtrestoretdataRJRKRLRthasattrRztWIFSIGNALEDtWTERMSIGRterrortsignaltSIGINTtKeyboardInterrupttinfoRa(RRRRRRRRRtexitcodetoutputtgrabbertsrctobjtexet
exitstatustsig((sD/usr/lib64/python2.7/site-packages/numpy/distutils/command/config.pyt
get_output�s<	
		

N(s
fcompiler=Ns!specify the Fortran compiler type(R.t
__module__Rtuser_optionsR
RRR%RBRCRPR[R]R^RdRjRHRrRwRR	R�(((sD/usr/lib64/python2.7/site-packages/numpy/distutils/command/config.pyRs4	
	&			2T:		R{cBs,eZd�Zd�Zd�Zd�ZRS(cCs"tj|_d|_|t_dS(NRk(R'tstdoutt
sys_stdoutR}(R((sD/usr/lib64/python2.7/site-packages/numpy/distutils/command/config.pyt__init__�s	cCs#|jj|�|j|7_dS(N(R�twriteR}(RR}((sD/usr/lib64/python2.7/site-packages/numpy/distutils/command/config.pyR��scCs|jj�dS(N(R�tflush(R((sD/usr/lib64/python2.7/site-packages/numpy/distutils/command/config.pyR��scCs|jt_dS(N(R�R'R�(R((sD/usr/lib64/python2.7/site-packages/numpy/distutils/command/config.pyR|�s(R.R�R�R�R�R|(((sD/usr/lib64/python2.7/site-packages/numpy/distutils/command/config.pyR{�s			(RJR�RR'tdistutils.command.configRRRR/Rtdistutils.file_utilRR;RRtnumpy.distutils.exec_commandRt numpy.distutils.mingw32ccompilerRt numpy.distutils.command.autodistRR	tnumpy.distutils.compatR
tobjectR{(((sD/usr/lib64/python2.7/site-packages/numpy/distutils/command/config.pyt<module>s"

��