ó É9Zc@`sVdZddlmZmZmZddlZddlZddlmZddlm Z ddl m Z ddl mZmZmZddlmZdd lmZdd lmZdd lmZdd lmZmZmZmZmZmZm Z m!Z!dd l"m#Z#ye$Wn!e%k r;ddl&m'Z$nXde fd„ƒYZ dS(sC Modified version of build_ext that handles fortran source files. i(tdivisiontabsolute_importtprint_functionN(tglob(t newer_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_dirst is_sequencetget_build_architecturet msvc_version(tshow_fortran_compilers(tSetRcB`sŽeZdZejddgZejdddefgZd„Zd „Z d „Z d „Z d „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 types parallel=tjsnumber of parallel jobsshelp-fcompilers list available Fortran compilerscC`s#tj|ƒd|_d|_dS(N(t old_build_exttinitialize_optionstNonet fcompilertparallel(tself((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_ext.pyR.s  cC`sß|jrByt|jƒ|_WqBtk r>tdƒ‚qBXnt|jtƒro|jjtjƒ|_n|jp{g}|j jdkrŸg|j _n|j j|_|jj |ƒt j |ƒ|jddƒdS(Ns)--parallel/-j argument must be an integertbuildR(RR(Rtintt ValueErrort isinstancet include_dirststrtsplittostpathsept distributionRtextendRtfinalize_optionstset_undefined_options(Rt incl_dirs((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_ext.pyR)3s    c C`s|js dS|jdƒ|jjƒrÝ|jr«|jjjdƒritjdƒ|jj dƒ}qÇ|jj dƒ}d|_|j ƒ|j ƒd|jjdextension %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_dirR6R"tdebugtextra_postargsscompiling C++ sourcess#compiling Fortran 90 module sourcess*.modsfailed to move %r to %rscompiling Fortran sourcestintelwtintelemwR4R5truntime_library_dirstexport_symbolst build_tempt target_lang(R8R9(RwR~R(R8R9(>RURRRRStlisttget_ext_fullnameRAR$tjoinRHtget_package_dirR%tpathtget_ext_filenamet build_libRzR3RR R|RRtextra_compile_argsRTt undef_macrosRIR R0R]RVR`R\thasattrRxRyRYRRDR‚R"Rtcompilet module_dirstdirnametmkpathtmodule_dir_switchRtmodule_optionstabspathtisfiletremovet move_fileRt extra_objectsR(textra_link_argst get_librariesR5tlink_shared_objectt_libs_with_msvc_and_fortranR€tget_export_symbols(#RRfRUtfullnametmodpathtpackagetbaseRut package_dirt ext_filenameRzt extra_argsR6tundeft c_sourcest cxx_sourcest f_sourcestfmodule_sourcesRRZtkwsR{R"t c_objectsR}t f_objectsRtmodule_build_dirtexisting_modulestftttobjectsR4R5tlinker((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_ext.pytbuild_extensions            '*                    $               cC`sw|jdƒj}|jdƒj}|jjtjj|dƒgd|jƒ}|jj |dd|d|j ƒdS(NR,R-sgfortran_vs2003_hack.cR{t_gfortran_workaroundR|( RHR,R-R0RŽR%RˆR†R‚tcreate_static_libR|(RR¦R,R-R±((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_ext.pyt_add_dummy_mingwex_sym»s   cC`s|dkrdSx;|D]3}|jdƒr2qnt}xI|pDgD];}tjj|d|ƒ}tjj|ƒrEt}PqEqEW|rqnt}xŽ|D]†}tjj|d|ƒ}tjj|ƒrtjj|j|dƒ}t ||ƒ|j|kr|j |jƒnt}PqqW|r3qnt j 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( NRws%s.libslib%s.as.libs+could not find library %r in directories %ss/usr/libtcygpaths-wtuse_teetlibs.ai(Rt startswithR[R%RˆR†R•R_R‚R RIR RDR5R R(R4R (RRt c_librariestc_library_dirsRct fileexiststlibdirtlibfiletlibfile2t f_lib_dirstdirtstoR¹tptdst_name((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_ext.pyRœÃsZ     !   cC`sA|j|jƒg}x$|jD]}|jt|ƒƒq W|S(N(tcheck_extensions_listR>R(R(Rt filenamesRf((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_ext.pytget_source_filesùs cC`sw|j|jƒg}xZ|jD]O}|js5q n|j|jƒ}|jtjj|j |j |ƒƒƒq W|S(N( RÇR>RUR…RSRIR%RˆR†RŠR‰(RtoutputsRfRž((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_ext.pyt get_outputss N(s fcompiler=Ns!specify the Fortran compiler type(s parallel=Rsnumber of parallel jobs(t__name__t __module__t descriptionRt user_optionsRt help_optionsRRR)RGRsR³R¶RœRÉRË(((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_ext.pyRs$      ·  ³  6 ((t__doc__t __future__RRRR%tsysRtdistutils.dep_utilRtdistutils.command.build_extRRtdistutils.errorsRRRtdistutils.file_utilR tnumpy.distutilsR tnumpy.distutils.exec_commandR tnumpy.distutils.system_infoR tnumpy.distutils.misc_utilR RRRRRRRt'numpy.distutils.command.config_compilerRRPt NameErrortsetsR(((sT/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/command/build_ext.pyts$  :