\Kc@sddkZddkZddkZddklZlZddklZddkl Z l Z ddk l Z ddklZlZddklZlZddklZdd klZdd klZlZdd klZd Zd ZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZdZ'dZ(dZ)dZ*dZ+dZ,dZ-dZ.dZ/d Z0d!Z1d"Z2d#Z3d$Z4d%Z5d&e fd'YZ6dS((iN(tjointdirname(tDistutilsPlatformError(tDistutilsExecErrortDistutilsSetupError(t build_ext(t CCompilert new_compiler(t FCompilert new_fcompiler(tfind_executable(tlog(tis_bootstrappingtget_cmd(tget_numpy_include_dirscCsddkl}|S(sqReturn the top path where everything produced by scons will be put. The path is relative to the top setup.pyi(tget_scons_build_dir(tnumsconsR(R((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pyRscCs&ddkl}tt||S(siReturn the build directory for the given package (foo.bar). The path is relative to the top setup.pyi(t pkg_to_path(tnumscons.core.utilsRtpjoinR(tpkgR((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pytget_scons_pkg_build_dirscCsddkl}|S(sqReturn the top path where everything produced by scons will be put. The path is relative to the top setup.pyi(tget_scons_configres_dir(RR(R((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pyR$scCsddkl}|S(sqReturn the top path where everything produced by scons will be put. The path is relative to the top setup.pyi(tget_scons_configres_filename(RR(R((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pyR+scCsddkl}|S(sEThis returns the full path where scons.py for scons-local is located.i(tget_scons_path(RR(R((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pytget_scons_local_path2scCsddkl}ddkl}t|||}|iti}tiig}t |dD]}|ti qh~S(Ni(R(Ri( RRRRRtcounttostsepRtrangetpardir(RRRtscdirtnt_[1]ti((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pyt _get_top_dir7s cCstt||iS(s`Returns the path where distutils install libraries, relatively to the scons build directory.(RR#t build_lib(tcmdR((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pytget_distutils_libdirBscCstt||iS(s6Returns the path where distutils put pure C libraries.(RR#t build_clib(R%R((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pytget_distutils_clibdirGscCsWddkl}|djo ||Stdid}t|i||SdS(s6Returns the installation path for the current package.i(RitinstallN(RRR tget_finalized_commandRtinstall_libbase(RtinplaceRt install_cmd((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pytget_distutils_install_prefixKs   cCstiS(sEThis returns the python executable from which this file is invocated.(tsyst executable(((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pytget_python_exec_invocTsc Csddkl}t|t|}|iti}t}g}xX|D]P}|ittii g}t |dD]}|ti q}~|qPW|S(sYReturn include dirs for numpy. The paths are relatively to the setup.py script path.i(Ri( RRRtpdirnameRRRt_incdirtappendRRR( tsconscript_pathRRR tdirstrdirstdR!R"((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pyR^s NcCstii|S(sGiven a list of directories, returns a string where the paths are concatenated by the path separator. example: ['foo/bar', 'bar/foo'] will return 'foo/bar:bar/foo'.(RtpathsepR(tdirlist((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pyt dirl_to_strlscCs<|i}|djodS|djodS|idSdS(sThis converts the name passed to distutils to scons name convention (C compiler). compiler should be a CCompiler instance. Example: --compiler=intel -> intelctmsvctinteltintelciN(t compiler_typetcompiler(R@R?((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pyt dist2sconsccss    cCs\|idjodS|idjodS|idjodS|idjodSd Sd S( sThis converts the name passed to distutils to scons name convention (Fortran compiler). The argument should be a FCompiler instance. Example: --fcompiler=intel -> ifort on linux, ifl on windowsR=tiforttgnutg77tgnu95tgfortrantsuntsunf77tfortranN(R?(R@((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pyt dist2sconsfcscCs#|idjo|iS|idS(sThis converts the name passed to distutils to scons name convention (C++ compiler). The argument should be a Compiler instance.R<i(R?t compiler_cxx(R@((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pyt dist2sconscxxscCs$|idjodS|idSdS(sFor any give CCompiler instance, this gives us the name of C compiler (the actual executable). NOTE: does NOT work with FCompiler instances.R<scl.exeiN(R?R@(R@((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pytget_compiler_executablescCs |idS(sdFor any give FCompiler instance, this gives us the name of F77 compiler (the actual executable).i(t compiler_f77(R@((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pytget_f77_compiler_executablescCs$|idjodS|idSdS(sFor any give CCompiler instance, this gives us the name of CXX compiler (the actual executable). NOTE: does NOT work with FCompiler instances.R<scl.exeiN(R?RK(R@((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pytget_cxxcompiler_executablescCs9tt|}|ot|}n td|S(sjGiven a distutils.ccompiler.CCompiler class, returns the path of the toolset related to C compilation.s1Could not find compiler executable info for scons(R RMR2R(R@t fullpath_exectfullpath((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pyt get_tool_paths  cCs9tt|}|ot|}n td|S(slGiven a distutils.ccompiler.FCompiler class, returns the path of the toolset related to F77 compilation.s5Could not find F77 compiler executable info for scons(R ROR2R(R@RQRR((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pytget_f77_tool_paths  cCs9tt|}|ot|}n td|S(sjGiven a distutils.ccompiler.CCompiler class, returns the path of the toolset related to C compilation.s1Could not find compiler executable info for scons(R RPR2R(R@RQRR((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pytget_cxx_tool_paths  cCs|o d|dSdSdS(sxConvert path (given as a string) to something the shell will have no problem to understand (space, etc... problems).t"s""N((tpath((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pyt protect_paths cCs |idS(Nt,(tsplit(tpkglist((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pytparse_package_listscCsptg}|D]}||dfq~}g}tt|D]%}|i||o ||qDqD~S(sGiven two list, return the index of the common items. The index are relative to seq1. Note: do not handle duplicate items.N(tdicttNoneRtlenthas_key(tseq1tseq2R!R"tdict2t_[2]((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pyt find_commons-cCsFt||}t|t|jpd|}t|n|S(s[Given a list of packages in pkglist, return the list of packages which match this list.sYthe package list contains a package not found in the current list. The current list is %s(ReR_t ValueError(tsconspkgR[tcommontmsg((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pytselect_packagess cCsyddk}Wn+tj o}tdt|nXyddkl}t|dtotdt|nt|}|d |jo*tdt|t|d fnWn,tj o td ||ifnXdS( s`Check that we can use numscons. minver is a 3 integers tuple which defines the min version.iNslimporting numscons failed (error was %s), using scons within distutils is not possible without this package (t version_infois/Numscons %s or above expected (detected 0.10.0)is'Numscons %s or above expected (got %s) sTYou need numscons >= %s to build numpy with numscons (imported numscons path is %s).( Rt ImportErrort RuntimeErrortstrRkt isinstanceRfttuplet__file__(tminverRteRk((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pytcheck_numsconss" (tsconscBseZdZd/d0d1d2d3d4d5gZd6d7d8d9d:d;d<d=d>d?d@dAg eZd'Zd(Zd)Zd*Z d+Z d,Z d-Z RS(Bs Scons builders with-perflib=sdSpecify which performance library to use for BLAS/LAPACK/etc...Examples: mkl/atlas/sunper/accelerates with-mkl-lib=tTODOswith-mkl-include=swith-mkl-libraries=swith-atlas-lib=swith-atlas-include=swith-atlas-libraries=sjobs=tjs4specify number of worker threads when executingsconsR,R"sIf specified, build in place.s import-envRss<If specified, import user environment into scons env["ENV"].tbypasstbs3Bypass distutils compiler detection (experimental).sscons-tool-path=s:specify additional path (absolute) to look for scons toolsssilent=sespecify whether scons output should less verbose(1), silent (2), super silent (3) or not (0, default)s log-level=sVspecify log level for numscons. Any value valid for the logging python module is valids package-list=syIf specified, only run scons on the given packages (example: --package-list=scipy.cluster). If empty, no package is builts fcompiler=s!specify the Fortran compiler types compiler=sspecify the C compiler types cxxcompiler=s4specify the C++ compiler type (same as C by default)tdebugtgs'compile/link with debugging informationcCsti|d|_d|_d|_d|_d|_d|_d|_ d|_ d|_ t |_ d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_g|_g|_g|_g|_g|_g|_g|_dS(Niti2(t old_build_exttinitialize_optionsR^R'RzR@t cxxcompilert fcompilertjobstsilentt import_envtscons_tool_pathtFalset_bypass_distutils_cctscons_compilertscons_compiler_pathtscons_fcompilertscons_fcompiler_pathtscons_cxxcompilertscons_cxxcompiler_patht package_listR,Rxt log_levelt with_perflibt with_mkl_libtwith_mkl_includetwith_mkl_librariestwith_atlas_libtwith_atlas_includetwith_atlas_libraries(tself((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pyR~Js8                           c Cs|djo t|_nytd|d|id|id|i}|i|it|do|i nt ||_ t t ||_Wn2tj o&}|ip |q||_ nXdS(NR<R@tverbosetdry_runtforcet initialize(tTrueRRRRRt customizet distributionthasattrRRARRXRSRR(RR?tdistutils_compilerRs((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pyt_init_ccompilerus         c Cstd|d|id|id|i|_|idj oA|ii|it|i|_ t t |i|_ ndS(NR@RRR( R RRRRR^RRRJRRXRTR(RR?((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pyt_init_fcompilers   c Cstd|d|id|id|i}|dj o|i|idd|i||i|_ yt |i Wnt j od|_ nX|i o.t |i |_ tt |i |_qndS(NR@RRRtneed_cxxi(RRRRR^RRt customize_cmdt cxx_compilerRRURRLRRXR(RR?R((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pyt_init_cxxcompilers       cCsti|g|_g|_g|_g|_g|_|iioxs|ii D]e}|ii |i |ii |i |ii |i |ii |i|ii |iqWWtdid}|i|_n|ip|i|_nt|idjof|io(|i|_|i|_|i|_q{|i|i|i|i|i|in|iot|i|_ndS(NR'i( R}tfinalize_optionst sconscriptst pre_hookst post_hookst pkg_namest pkg_pathsRthas_scons_scriptst scons_dataR4t scons_pathtpre_hookt post_hookt parent_nametpkg_pathR R*R'RR@R_RxRRRRRRRRR\(RR"tbuild_clib_cmd((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pyRs8             c Cso|d|dg}|io|idt|in|io|idn|id|i|idt||id||id||id |i|id tt|||id tt ||t ||i}|id t||i p|id |i n|i o|id|i n|id |i |id|i|io|id|in|io|id|in|io|id|in|io|id|in|idtt||id|i|id|i|ioRt|idjo|idqt|idjo|idqn|idt|i|id|di|}t|idjotid||ntid |ti|} | o*d!} | d"7} | d#7} t| ndS($Ns-fs-I.s --jobs=%ds inplace=1sscons_tool_path="%s"s src_dir="%s"s pkg_path="%s"s pkg_name="%s"s log_level=%ssdistutils_libdir=%ssdistutils_clibdir=%ssdistutils_install_prefix=%ss cc_opt=%sscc_opt_path=%ssdebug=%ss f77_opt=%ssf77_opt_path=%ss cxx_opt=%sscxx_opt_path=%ssinclude_bootstrap=%ss bypass=%ss import_env=%sis-Qis-ss silent=%dsbootstrapping=%dt is(Executing scons command (pkg is %s): %s s5======== Executing scons command for pkg %s =========s$Error while executing scons command.s! See above for more information. sIf you think it is a problem in numscons, you can also try executing the scons command with --log-level option for more detailed output of what numscons is doing, for example --log-level=0; the lowest the level is, the more detailed the output it.(RR4tintR,RR2RRXR&R(R.RRRRzRRRRR;RRxRRRR tinfoRtsystemR( Rt scons_exect sconscripttpkg_nameRt bootstrappingR%tprefixtcmdstrtstRi((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pyt _call_sconssf             cCst|idjodStdd |idj ot|i|i}g}|D]}||i|qX~}g}|D]}||i|q~}g}|D]}||i|q~}g} |D]}| |i|q~ } g} |D]}| |i |q~ } n.|i}|i}|i}|i} |i } t o d} nd} t }|dt t td7}xt|||| | D]n\}}}}}|o |n|o|i||||| n|o|h|d6|d6qqWdS( NiRrii Rsscons.pyRt scons_cmd(ii i(R_RRtRR^RjRRRRR R1RXRRtzipR(RtidR!R"RRdRt_[3]Rt_[4]Rt_[5]RRRRRRRR((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pytrun"s< ((((,            N(s with-perflib=NsdSpecify which performance library to use for BLAS/LAPACK/etc...Examples: mkl/atlas/sunper/accelerate(s with-mkl-lib=NRv(swith-mkl-include=NRv(swith-mkl-libraries=NRv(swith-atlas-lib=NRv(swith-atlas-include=NRv(swith-atlas-libraries=NRv(sjobs=Rws4specify number of worker threads when executingscons(sinplaceR"sIf specified, build in place.(s import-envRss<If specified, import user environment into scons env["ENV"].(sbypassRys3Bypass distutils compiler detection (experimental).(sscons-tool-path=Ns:specify additional path (absolute) to look for scons tools(ssilent=Nsespecify whether scons output should less verbose(1), silent (2), super silent (3) or not (0, default)(s log-level=NsVspecify log level for numscons. Any value valid for the logging python module is valid(s package-list=NsyIf specified, only run scons on the given packages (example: --package-list=scipy.cluster). If empty, no package is built(s fcompiler=Ns!specify the Fortran compiler type(s compiler=Nsspecify the C compiler type(s cxxcompiler=Ns4specify the C++ compiler type (same as C by default)(sdebugR{s'compile/link with debugging information( t__name__t __module__t descriptionR^tlibrary_optionst user_optionsR~RRRRRR(((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pyRu#s@  +   1 J(7RR/tos.pathRRRR2tdistutils.errorsRRRt!numpy.distutils.command.build_extRR}tnumpy.distutils.ccompilerRRtnumpy.distutils.fcompilerRR tnumpy.distutils.exec_commandR tnumpy.distutilsR tnumpy.distutils.misc_utilR R RR3RRRRRR#R&R(R.R1R;RARJRLRMRORPRSRTRURXR\ReRjRtRu(((sC/usr/lib64/python2.6/site-packages/numpy/distutils/command/scons.pytsN