• File: build_src.pyo
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_src.pyo
  • Date Modified: 12/19/2017 2:16 PM
  • File size: 23.04 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit

9Zc@`sdZddlmZmZmZddlZddlZddlZddlZddl	Z	ddl
mZddlm
Z
mZddlmZddlmZmZddlmZdd	lmZmZmZmZmZdd
lmZdd
lmZ dZ!dejfd
YZ"ej#dej$j%Z&ej#dej$j%Z'ej#dej$j%Z(ej#dej$j)Z*ej#dej$j)Z+dZ,dZ-dZ.ej#dej$j%Z/ej#dej$j%Z0dZ1dS(s Build swig and f2py sources.
i(tdivisiontabsolute_importtprint_functionN(t	build_ext(tnewer_grouptnewer(tget_platform(tDistutilsErrortDistutilsSetupError(tlog(tfortran_ext_matcht
appendpatht	is_stringtis_sequencetget_cmd(tprocess_filecC`stjd}t|d}zt|d}zmxf|D]^}|j|}|r|j|jd|jd||jdq:|j|q:WWd|jXWd|jXdS(sOSubstitute any occurence of @foo@ by d['foo'] from source file into
    target.s@([a-zA-Z_]+)@trtws@%s@iN(tretcompiletopentsearchtwritetreplacetgrouptclose(ttargettsourcetdtvartfstfttltm((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_src.pyt
subst_varss
6t	build_srccB`seZdZd*d,d-d.d/d0d1d2ddddfg	ZddgZgZdZdZdZ	dZ
dZdZdZ
dZdZd Zd!Zd"Zd#Zgd$Zd%Zd&Zd'Zd(Zd)ZRS(3s1build sources from SWIG, F2PY files or a functions
build-src=Rsdirectory to "build" sources tos
f2py-opts=s!list of f2py command line optionssswig=spath to the SWIG executables
swig-opts=s!list of SWIG command line optionssswig-cppsAmake SWIG create C++ files (default is autodetected from sources)s
f2pyflags=s3additional flags to f2py (use --f2py-opts= instead)s
swigflags=s3additional flags to swig (use --swig-opts= instead)tforcetfs2forcibly build everything (ignore file timestamps)tinplacetis=ignore build-lib and put compiled extensions into the source s,directory alongside your pure Python modulescC`sd|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_dS(N(tNonet
extensionstpackaget
py_modulestpy_modules_dictR#t	build_libt
build_baseR$R&tpackage_dirt	f2pyflagst	f2py_optst	swigflagst	swig_optstswig_cpptswig(tself((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_src.pytinitialize_optionsCs 															cC`s|jdddd|jdkr7|jj|_n|jj|_|jjpUg|_|jjpjg|_|jj	pg|_	|j
dkrdttj
dd!f}tjj|jd||_
ni|_|jr|jrtjd	n|j|_d|_n|jdkr1g|_ntj|j|_|jr|jrhtjd
n|j|_d|_n|jdkrg|_ntj|j|_|jd}|jdkr|j|_n|jdkr|j|_nxdd
gD]}d|jdd}t||d}|rt||r_tjd|qtj d||ft!|||qqWdS(NtbuildR.R-R$s.%s-%siitsrcs0ignoring --f2pyflags as --f2py-opts already useds0ignoring --swigflags as --swig-opts already usedRR5tswig_opts--t_t-s-both build_src and build_ext define %s options+using "%s=%s" option from build_ext command(R.R.(R-R-(R$R$("tset_undefined_optionsR*R(tdistributiontext_packagetext_modulesR)t	librariesR+t
data_filesR#RtsystversiontostpathtjoinR.R,R0R1R	twarntshlextsplitR2R3tget_finalized_commandR&R4Rtgetattrtinfotsetattr(R6tplat_specifierRtctotv((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_src.pytfinalize_optionsUsV	"					cC`s1tjd|jp|js#dS|jdS(NR#(R	RMR)RAt
build_sources(R6((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_src.pytruns
cC`s|jr!|jdj|_n|jx|jD]}|j|q5W|jr|j|jx!|jD]}|j|qoWn|j	|j
dS(Ntbuild_py(R&RKtget_package_dirtbuild_py_modules_sourcesRAtbuild_library_sourcesR)tcheck_extensions_listtbuild_extension_sourcestbuild_data_files_sourcestbuild_npy_pkg_config(R6tlibname_infotext((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_src.pyRTs	
	
cC`s|js
dStjdddlm}g}x|jD]}t|tr_|j|q:t|tr|\}}|j	r|j
dj|jt
j}nt
jj|j|}g|D]}t|dr|^q}g|D]}t|ds|^q}x|D]}|jjdkr@||}	n	|}	|	dk	rt|	trt|j|	qt|	tr|j|	qtt|	qqW|||f}
|j||
fq:tt|q:W||j(dS(Nsbuilding data_files sourcesi(tget_data_filest.t__call__i(RBR	RMtnumpy.distutils.misc_utilR`t
isinstancetstrtappendttupleR&RWRGRJREtsepRFR#thasattrt__code__tco_argcountR(tlisttextendt	TypeErrortrepr(R6R`tnew_data_filestdataRtfilest	build_dirR%tfuncstst	filenames((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_src.pyR\s:	
	'((
	cC`sddl}|\}}}tjj|}x$|jD]\}}	|	||<q:W|jdkr{tjj||}
ntjj|j||}
tjjtjj	|d}tjj|
|}tjj
|
stj|
nt|||tjj||}
|
|fS(Nii(
tshutilRERFtdirnametitemsR&RGR#tbasenametsplitexttexiststmakedirsR"(R6RMtgdRwttemplatetinstall_dirt
subst_dictttemplate_dirtkRRt
generated_dirt	generatedtgenerated_pathtfull_install_dir((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_src.pyt_build_npy_pkg_configs 	"c
C`s<tjdtjtd}|jdks>|jnt}i}|jdkrhd}t}n!t	|dr|j
}t}n|r8x|jjj
D]\}}|jj|}tjjtjj||}i|d6}	xB|D]:}
|j|
|	\}}|jjj||gfqWqWndS(Ns(build_src: building npy-pkg config filestinstalliRatinstall_libbasetprefix(R	RMtcopyRt	finalizedRStFalseR&tTrueRiRR>tinstalled_pkg_configRyR/RERFRGtabspathRRBRf(
R6tinstall_cmdt
build_npkgR~t
top_prefixtpkgtinfostpkg_pathRRRMRR((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_src.pyR]s*

			!

cC`sT|js
dStjdg}x#|jD]}t|r5t|dkr5|\}}}|jrx|j|}n-tjj	|j
tjj	|jd}t|drtjj	||d}||}n|dkrq*n|||fg}||jkrg|j|<n|j|c|7<q*|j|q*W||j(dS(Nsbuilding py_modules sourcesiRaRbs.py(R+R	RMR
tlenR&RWRERFRGR#RJRiR(R,Rf(R6tnew_py_modulesRR*tmodule_baseRsRtmodules((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_src.pyRXs,	
	cC`st|jdg}|s"dStjd||j|||f}|j|||f}|j|\}}|rtjd|j|n||d<dS(Ntsourcessbuilding library "%s" sourcess#%s - nothing done with h_files = %s(RltgetR	RMtgenerate_sourcesttemplate_sourcestfilter_h_filesR*(R6tlib_namet
build_infoRth_files((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_src.pyRYs	
cC`st|j}tjd|j|j|j}|jd}dj|dd!}|jrx|j	||_
n|j||}|j||}|j
||}|j||}|j||}|j|\}}||jkrg|j|<ng}xF|D]>}tjjtjj|d}	|j||	|fqW|j|c|7<|j|\}}
|
rtjd||
n||_dS(Nsbuilding extension "%s" sourcesRaiis#%s - nothing done with h_files = %s(RlRR	RMtnametget_ext_fullnameRJRGR&RWtext_target_dirRRtswig_sourcestf2py_sourcest
pyrex_sourcestfilter_py_filesR,RERFR{RzRfR(R6R_RtfullnametmodpathR*tpy_filesRR%tmoduleR((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_src.pyR[5s2	
"	
c
C`s^g}g}x7|D]/}t|r5|j|q|j|qW|sP|S|jrrt|rr|j}nKt|r|d}n	|j}tjj|j	g|j
dd }|j|x|D]}|||}|sqnt|r5g|D]}	tj
d|	f^q|j|qtj
d|f|j|qW|S(NiRais  adding '%s' to sources.(RRfR&R
RRRERFRGR#RJtmkpathR	RMRm(
R6Rt	extensiontnew_sourcestfunc_sourcesRRsRtfuncRu((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_src.pyR]s4

	

'cC`s|j|dgS(Ns.py(tfilter_files(R6R((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_src.pyRscC`s|j|dddgS(Ns.hs.hpps.inc(R(R6R((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_src.pyRscC`shg}g}xO|D]G}tjj|\}}||krM|j|q|j|qW||fS(N(RERFR{Rf(R6RtextsRRrRtbaseR_((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_src.pyRs
cC`sg}t|r;|djd}|djd}n|j}|j}x|D]}tjj|\}}|dkr|jrtjj|}	nt	|j
tjj|}	|j|	tjj|	tjj
|}
|jst|g||
ryt|r3tjd|
t|}ntjd|
t|}t|
d}|j||jnt|
rtjj|
}
|
|krtjd|
|j|
qn|j|
qT|j|qTW|S(	Nitdependstinclude_dirss.srcsfrom_template:> %ssconv_template:> %sRs  adding '%s' to include_dirs.(R
RRRRERFR{R&RxRR#RRGRzR$Rt_f_pyf_ext_matchR	RMtprocess_f_filetprocess_c_fileRRRt_header_ext_matchRf(R6RRRRRRRR_t
target_dirttarget_filetoutstrtfidR((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_src.pyRs>		
	
!

c	C`sg}|jjdd}xg|D]_}tjj|\}}|dkru|j||||}|j|q#|j|q#W|S(s@Pyrex not supported; this remains for Cython support (see below)Rais.pyx(RRJRERFR{tgenerate_a_pyrex_sourceRf(	R6RRRtext_nameRRR_R((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_src.pyRs
	cC`sgS(sPyrex is not supported, but some projects monkeypatch this method.

        That allows compiling Cython code, see gh-6955.
        This method will remain here for compatibility reasons.
        ((R6RRRR((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_src.pyRscC`sg}g}g}i}g}|jjdd}d}	x|D]}
tjj|
\}}|dkr|jrtjj|}
nt|jtjj|}
tjj	|
r	t
|
}||krtd|
||fntjj|
|d}nt
jd|
|}d}	tjj|
|d}tjj	|st
jd	||ftjj|}
tjj|
|d}tjj	|std
|fnt
jd|n|j|
|j|
|||
<|j|qAt|r|j|
qA|j|
qAW|p9|s@|Sx|D]}|j|qGW|j|j}|jjrxH|jjD]7\}}||jkr|j|jdgqqWnt
jd
||rt|dkrtd|fn|d}
||
}tjj|p-d}
|
g|j}|js[t||dr|	rt
jd|
ddl}|jj |d|
|
gqt
jd|
n	t!|r|d}n	|j}tjj|jg|jdd }
tjj|
|d}|j|||j}|jsLt||dr|	rt
jd||j|
ddl}|jj |dd|
gd|g|nt
jd|tjj	|st"d|fntjj|jd}tjj|jd}t
jd||j||j|j#krnt
jd|j|j#j|jn|	s%ddl}tjj|jj$}tjj|dd}tjj|dd}t%||st%||ru|jtjj||j&|||j&||qunPtjj	|sMtd|fntjj	|sutd|fnx`dd gD]R}tjj|
||}tjj	|rt
jd||j|qqW||S(!NRaiis.pyfs;mismatch of extension names: %s provides %r but expected %rsmodule.cs.  source %s does not exist: skipping f2py'ing.isd  target %s does not exist:
   Assuming %smodule.c was generated with "build_src --inplace" command.s
%r missings&   Yes! Using %r as up-to-date target.tf2py_optionssf2py options: %ssConly one .pyf file is allowed per extension module but got more: %rRsf2py: %ss--build-dirs+  skipping '%s' f2py interface (up-to-date)s	f2py:> %ss--lowers-ms3  skipping f2py fortran files for '%s' (up-to-date)s!f2py target file %r not generatedsfortranobject.csfortranobject.hs  adding '%s' to sources.s  adding '%s' to include_dirs.R9sf2py target_c file %r not foundsf2py target_h file %r not founds-f2pywrappers.fs-f2pywrappers2.f90('RRJRERFR{R&RxRR#tisfiletget_f2py_modulenameRRGR	tdebugRHRMRfR
RRR1R>RARmRRRR$Rt
numpy.f2pytf2pytrun_mainR
RRt__file__Rt	copy_file(R6RRRRt	f_sourcestf2py_targetsttarget_dirsRt	skip_f2pyRRR_RRRRRRRtnumpyttarget_cttarget_htsource_ctsource_htname_exttfilename((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_src.pyRs
				



#


	


	%	
	cC`sg}g}i}g}g}d}d|jkrRd}	t}
|jjdn$|jrjd}	t}
nd}	t}
d}|jjdd}x|D]}
tj	j
|
\}}|dkrP|jrtj	j|}|j
}n$t|jtj	j|}|}tj	j|
rBt|
}||dkr\td	|
||dfn|	dkrt|
}	|	dk}
nt|
}|dkrtjd
|
|	fn\|	|krtjd|	|
|f|dkrtjdt}
qtjd
|
n|
r d}ntj	j|d||f}ntjd|
|d}d}t||}tj	j|stjd||ftj	j|}t||}tj	j|std|fntjd|n|j||j||jtj	j||d|j|
|d||
<q|j|
qW|sk|S|ry||Sx|D]}|j|qW|jp|j}|dg|j}|
r|jdnx"|jD]}|jd|qWx|D]}
||
}|
g|j}|js<t||drtj dtj	j!||
r`dpcd|
f|j"||jd|d||
gqtj#d|
qW||S(Ns.cs-c++sc++iRais.iis;mismatch of extension names: %s provides %r but expected %rs>source %r does not define swig target, assuming %s swig targets0expected %r but source %r defines %r swig targetsAresetting swig target to c++ (some targets may have .c extension)s$assuming that %r has c++ swig targets.cpps	%s_wrap%ss.  source %s does not exist: skipping swig'ing.si  target %s does not exist:
   Assuming %s_wrap.{c,cpp} was generated with "build_src --inplace" command.s
%r missings&   Yes! Using %r as up-to-date target.s.pys-pythons-IRs%s: %ss++ts-os-outdirs+  skipping '%s' swig interface (up-to-date)($R3RtremoveR4R(RRRJRERFR{R&RxRRR#Rtget_swig_modulenameRtget_swig_targetR	RHRGt_find_swig_targetRfRR5t	find_swigRRR$RRMRztspawnR(R6RRRRtswig_targetsRRt
target_extttyptis_cppt	skip_swigRRRR_Rt
py_target_dirRttyp2RRR5tswig_cmdRR((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_src.pyR[s		
			
			
		

 



$	(s
build-src=Rsdirectory to "build" sources toN(s
f2py-opts=Ns!list of f2py command line options(sswig=Nspath to the SWIG executable(s
swig-opts=Ns!list of SWIG command line options(sswig-cppNsAmake SWIG create C++ files (default is autodetected from sources)(s
f2pyflags=Ns3additional flags to f2py (use --f2py-opts= instead)(s
swigflags=Ns3additional flags to swig (use --swig-opts= instead)(R$R%s2forcibly build everything (ignore file timestamps)(t__name__t
__module__tdescriptionR(tuser_optionstboolean_optionsthelp_optionsR7RSRURTR\RR]RXRYR[RRRRRRRRR(((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_src.pyR#-sB
		:			$					(	'			%			s".*[.](f90|f95|f77|for|ftn|f|pyf)\Zs.*[.](inc|h|hpp)\ZsQ\s*%module\s*(.*\(\s*package\s*=\s*"(?P<package>[\w_]+)".*\)|)\s*(?P<name>[\w_]+)s-[*]-\s*c\s*-[*]-s-[*]-\s*c[+][+]\s*-[*]-cC`sYt|d}d}|j}t|r6d}nt|rKd}n|j|S(NRsc++RP(RR(treadlinet_has_cpp_headert
_has_c_headerR(RR%tresulttline((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_src.pyRs		
cC`sYt|d}d}x3|D]+}t|}|r|jd}PqqW|j|S(NRR(RR(t_swig_module_name_matchRR(RR%RRR!((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_src.pyRs

cC`sPxIddgD];}tjj|d||f}tjj|r
Pq
q
W|S(Ns.cpps.cs	%s_wrap%s(RERFRGR(RRR_R((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_src.pyRs
s%\s*python\s*module\s*(?P<name>[\w_]+)s4\s*python\s*module\s*(?P<name>[\w_]*?__user__[\w_]*)cC`shd}t|}xE|D]=}t|}|rt|rCqn|jd}PqqW|j|S(NR(R(Rt_f2py_module_name_matcht_f2py_user_module_name_matchRR(RRR%RR!((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_src.pyRs

(2t__doc__t
__future__RRRRERRCRIRtdistutils.commandRtdistutils.dep_utilRRtdistutils.utilRtdistutils.errorsRRtnumpy.distutilsR	RcR
RRR
Rtnumpy.distutils.from_templateRRtnumpy.distutils.conv_templateRR"R#RtItmatchRRRRRRRRRRRR(((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_src.pyt<module>s@(