Current File : //usr/lib64/python2.7/site-packages/numpy/distutils/command/build_ext.pyc
�
E�`Qc@s:dZddlZddlZddlmZddlmZddlmZddl	m
Z
mZmZddl
mZddlmZdd	lmZdd
lmZddlmZmZmZmZmZmZmZmZddlmZye Wn!e!k
rdd
l"m#Z nXdefd��YZdS(sB Modified version of build_ext that handles fortran source files.
i����N(tglob(tnewer_group(t	build_ext(tDistutilsFileErrortDistutilsSetupErrortDistutilsError(t	copy_file(tlog(texec_command(t
combine_paths(tfilter_sourcest
has_f_sourcesthas_cxx_sourcestget_ext_source_filestget_numpy_include_dirstis_sequencetget_build_architecturetmsvc_version(tshow_fortran_compilers(tSetRcBs�eZdZejdgZejdddefgZd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�ZRS(s:build C/C++/F extensions (compile/link to build directory)s
fcompiler=s!specify the Fortran compiler typeshelp-fcompilers list available Fortran compilerscCstj|�d|_dS(N(t
old_build_exttinitialize_optionstNonet	fcompiler(tself((sG/usr/lib64/python2.7/site-packages/numpy/distutils/command/build_ext.pyR*s
cCsE|j}tj|�|dk	rA|jj|jjp:g�ndS(N(tinclude_dirsRtfinalize_optionsRtextendtdistribution(Rt	incl_dirs((sG/usr/lib64/python2.7/site-packages/numpy/distutils/command/build_ext.pyR.s	
cCs?|js
dS|jd�|jj�r�|jr�|jjjd�ritjd�|jj	d�}q�|jj	d�}d|_|j
�|j�d|jjd<n|jd�|jd�}|j
j|j�nd}ddlm}ddlm}|j}|d|d	|jd
|jd|j�|_|jj|j�|jj|�|jj�i}|dk	r�x{|jp�gD]g\}}||kr�|||kr�tjd|t||�d
 t|�d
 f�n|||<q�Wnx<|jjpgD](\}}||kr*qn|||<qWt�}x~|jD]s}	t�}
g}g}g}
x�|	jD]�}||kr�||}||jdg�7}||jdg�7}x9|jdg�D]"}||
kr�|
j|�q�q�Wnx3|j|i�jdg�D]}|
j|�qWqvW|r�|	j|}tj d|	j!|	j|f�||	_|	j
||	_
n|
r�tj d|	j!|
f�|	j"|
|	_"nt#|	j$�r�|
jd�nt%|	j$�r�|
jd�n|	j&p|jj'|	j$�}|r(|
j|�nd|
kr=d}n0d|
krRd}nd|
krgd}nd}|r�||kr�|	j&r�tjd|	j!||f�n||	_&|j(|
�qKWd|k}d|k}d|k}|ra|d|d	|jd
|jd|j�|_)|j)}|j|jd|�|j|�|j�|j*�|_)n	d|_)|r,|j+}|d|j+d	|jd
|jd|jdt,d|j�|_-|j-}|r�|j.}|j|j�n|r|j/�r|j|�|j�q5|jd|�d|_-n	d|_-|r�|j+}|d|j+d	|jd
|jd|jdt0d|j�|_1|j1}|r�|j.}|j|j�n|r�|j/�r�|j|�|j�q|jd|�d|_1n	d|_1|j2�|jr.|j3d�}d|_n|jd�dS(Nt	build_srct
build_clibsMbuild_clib already run, it is too late to ensure in-place build of build_clibii����(tnew_compiler(t
new_fcompilertcompilertverbosetdry_runtforcesKlibrary %r defined more than once, overwriting build_info
%s... 
with
%s...i,t	librariestlibrary_dirstmacrostsource_languagess-updating extension %r libraries from %r to %rs-extending extension %r defined_macros with %rtf77sc++tf90tcs.resetting extension %r language from %r to %r.tneed_cxxt
requiref90t
c_compilers!f77_compiler=%s is not available.s!f90_compiler=%s is not available.tscons(4t
extensionstrun_commandRthas_c_librariestinplacethave_runtgetRtwarntget_command_objtensure_finalizedtruntget_finalized_commandR'tappendRRtdistutils.ccompilerR tnumpy.distutils.fcompilerR!R"R#R$R%t	customizet
customize_cmdtshow_customizationR&treprtsettaddtinfotnamet
define_macrosRtsourcesRtlanguagetdetect_languagetupdatet
_cxx_compilertcxx_compilerRtFalset
_f77_compilert
compiler_typetget_versiontTruet
_f90_compilertbuild_extensionstreinitialize_command(RRR R!RPtclibstlibnamet
build_infot
all_languagestextt
ext_languagestc_libst
c_lib_dirsR(tbinfotmtlt
new_c_libstext_languagetneed_f90_compilertneed_f77_compilertneed_cxx_compilerR"tctypeRtcmd((sG/usr/lib64/python2.7/site-packages/numpy/distutils/command/build_ext.pyR:4s	
	
	


			
	,		
%
											

							

								

		
	cCs|S(N((RRH((sG/usr/lib64/python2.7/site-packages/numpy/distutils/command/build_ext.pytswig_sources�sc# CsC|j}|dks"t|�r@tddd|j��nt|�}|sVdS|j|j�}|jr�|jd�}dj	|dd!�}|d}|j
d�}|j|�}tj
j	||j|��}	n!tj
j	|j|j|��}	||j}
|jp%t|
|	d�s?tjd	|j�dStjd
|j�|jp^g}|j}x!|jD]}
|j|
f�quWt|j�\}}}}|jjdkr�|r�|jd�n||7}g}n|jd
kr|j}n-|jdkr|j}n|jp*|j}|dk	r`|j pEg|_ |j!pWg|_!n|j"}|r�|dkr�t#d|j��n|s�|r�|dkr�t#d|j��n|jd(kr�|dkr�|j$d|j�n|jdkr#|dkr#|j$d|j�ni|jd6}|j%}|j&t'�}g}|r�tjd�|jj(|d|d|d|d|jd||�}n|r�tjd�||j(|d|d|d|d|jd||�7}ng}g}|r�tjd�|j)}tj
j	|j%tj
j*|j|���}|j+|�|j,dkrlt-d�}n||j.||�7}||j(|d|j%d|d|d|jd|d|j�7}|j,dkr�x�t-d�D]�}||kr�q�ntj
j	||�}tj
j/|�tj
j/|�kr5q�ntj
j0|�rWtj1|�ny|j2||�Wq�t3k
r�tj$d||f�q�Xq�Wq�n|r�tjd�||j(|d|j%d|d|d|jd|d|j�7}n||}|j4r|j5|j4�n|j6p(g}|j7|�} |j8}!|jj9}"|jjdkry|j:|| |!�n'|jd)kr�|dk	r�|j9}"n|jdkr�|dk	r�|j9}"nt;j<d  d!kr�i|jd"6}ni}|"||	d#| d$|!d%|j=d|d&|j>|�d|jd'|j%|�dS(*Ns*in 'ext_modules' option (extension '%s'), s&'sources' must be present and must be sa list of source filenamest.ii����tbuild_pytnewers$skipping '%s' extension (up-to-date)sbuilding '%s' extensiontmsvcs/Zm1000R+R*s5extension %r has C++ sourcesbut no C++ compiler founds>extension %r has Fortran sources but no Fortran compiler foundsTextension %r has Fortran libraries but no Fortran linker found, using default linkersc++sLextension %r has C++ libraries but no C++ linker found, using default linkertdependsscompiling C sourcest
output_dirR(Rtdebugtextra_postargsscompiling C++ sourcess#compiling Fortran 90 module sourcess*.modsfailed to move %r to %rscompiling Fortran sourcesis2.3ttarget_langR&R'truntime_library_dirstexport_symbolst
build_temp(sf77sf90(sf77sf90(?RHRRRRFtlisttget_ext_fullnameR4tsplittjoinR;tget_package_dirtostpathtget_ext_filenamet	build_libRmR%RRRoREtextra_compile_argsRGtundef_macrosR<R
R"RPRIRSROtextra_f77_compile_argstextra_f90_compile_argsRLRR7RtRRtcompiletmodule_dirstdirnametmkpathtmodule_dir_switchRtmodule_optionstabspathtisfiletremovet	move_fileRt
extra_objectsRtextra_link_argst
get_librariesR'tlink_shared_objectt_libs_with_msvc_and_fortrantsystversionRrtget_export_symbols(#RRZRHtfullnametmodpathtpackagetbaseRjtpackage_dirtext_filenameRmt
extra_argsR(tundeft	c_sourcestcxx_sourcest	f_sourcestfmodule_sourcesRRMtkwsRnRt	c_objectsRpt	f_objectsR�tmodule_build_dirtexisting_modulestftttobjectsR&R'tlinker((sG/usr/lib64/python2.7/site-packages/numpy/distutils/command/build_ext.pytbuild_extension�s 		



					
	
	


	
	
		
$
	
		
	
		cCsw|jd�j}|jd�j}|jjtjj|d�gd|j�}|jj	|dd|d|j
�dS(NRRsgfortran_vs2003_hack.cRnt_gfortran_workaroundRo(R;RRR"R�RzR{RxRttcreate_static_libRo(RR�RRR�((sG/usr/lib64/python2.7/site-packages/numpy/distutils/command/build_ext.pyt_add_dummy_mingwex_sym�scCs|dkrdSx;|D]3}|jd�r2qnt}xI|pDgD];}tjj|d|�}tjj|�rEt}PqEqEW|r�qnt}x�|D]�}tjj|d|�}tjj|�r�tjj|j|d�}t	||�|j|kr|j
|j�nt}Pq�q�W|r3qntjd||f�qWg}	x`|j
D]U}
|
jd�r�tdd|
gd	t�\}}|s�|}
q�n|	j
|
�q^W|j|	�x�|jD]�}
|
jd�s�|j
|
�t|	d
|
d�}|rwtjj|j|
d�}tjj|�sOt	|d|�n|j|krt|j
|j�qtqwq�q�WdS(
NRls%s.libslib%s.as.libs+could not find library %r in directories %ss/usr/libtcygpaths-wtuse_teetlibs.ai(Rt
startswithRNRzR{RxR�RRRtRR<RR7R'RRR&R	(RRtc_librariestc_library_dirsRWt
fileexiststlibdirtlibfiletlibfile2t
f_lib_dirstdirtstoR�tptdst_name((sG/usr/lib64/python2.7/site-packages/numpy/distutils/command/build_ext.pyR��sZ


	!

cCsA|j|j�g}x$|jD]}|jt|��q W|S(N(tcheck_extensions_listR1RR
(Rt	filenamesRZ((sG/usr/lib64/python2.7/site-packages/numpy/distutils/command/build_ext.pytget_source_files�s
cCsw|j|j�g}xZ|jD]O}|js5q n|j|j�}|jtjj|j	|j
|���q W|S(N(R�R1RHRvRFR<RzR{RxR}R|(RtoutputsRZR�((sG/usr/lib64/python2.7/site-packages/numpy/distutils/command/build_ext.pytget_outputs�s	N(s
fcompiler=Ns!specify the Fortran compiler type(t__name__t
__module__tdescriptionRtuser_optionsRthelp_optionsRRRR:RhR�R�R�R�R�(((sG/usr/lib64/python2.7/site-packages/numpy/distutils/command/build_ext.pyRs 
	
			�		�		6	($t__doc__RzR�Rtdistutils.dep_utilRtdistutils.command.build_extRRtdistutils.errorsRRRtdistutils.file_utilRtnumpy.distutilsRtnumpy.distutils.exec_commandRtnumpy.distutils.system_infoR	tnumpy.distutils.misc_utilR
RRR
RRRRt'numpy.distutils.command.config_compilerRRCt	NameErrortsetsR(((sG/usr/lib64/python2.7/site-packages/numpy/distutils/command/build_ext.pyt<module>s":