<s> import autoinstall_lib as atl <EOL> from waflib import Logs <EOL> import os . path as osp <EOL> from waflib import Logs <EOL> from waflib import Context <EOL> from waflib import Errors <EOL> import sys <EOL> import waflib <EOL> version = "<STR_LIT>" <EOL> tool = "<STR_LIT>" <EOL> lapack_funcs = "<STR_LIT>" <EOL> def options ( ctx ) : <EOL> atl . add_lib_option ( "<STR_LIT>" , ctx , install = True ) <EOL> grp = ctx . parser . get_option_group ( "<STR_LIT>" ) <EOL> grp . add_option ( "<STR_LIT>" , action = "<STR_LIT:store>" , default = "<STR_LIT>" , help = "<STR_LIT>" ) <EOL> grp . add_option ( "<STR_LIT>" , action = "<STR_LIT:store>" , default = "<STR_LIT>" , help = "<STR_LIT>" ) <EOL> grp . add_option ( "<STR_LIT>" , action = "<STR_LIT:store_true>" , default = False , help = "<STR_LIT>" ) <EOL> def do_include ( ctx , ptrn = "<STR_LIT>" ) : <EOL> f = open ( osp . join ( ctx . env . PREFIX , "<STR_LIT>" ) , "<STR_LIT:w>" ) <EOL> for fnc in lapack_funcs . split ( ) : <EOL> print >> f , ( "<STR_LIT>" + ptrn ) % ( fnc , fnc ) <EOL> print >> f , extra_inc <EOL> f . close ( ) <EOL> def configure ( ctx ) : <EOL> if ctx . options . lapack_apple : <EOL> ctx . start_msg ( "<STR_LIT>" ) <EOL> if sys . platform . lower ( ) != "<STR_LIT>" : <EOL> ctx . end_msg ( "<STR_LIT>" % sys . platform , color = "<STR_LIT>" ) <EOL> raise Errors . WafError ( "<STR_LIT>" ) <EOL> ctx . end_msg ( "<STR_LIT>" ) <EOL> lapack_extradefs = [ "<STR_LIT>" ] <EOL> lapack_libs = [ "<STR_LIT>" , "<STR_LIT>" ] <EOL> lapack_includes = [ "<STR_LIT>" ] <EOL> lapack_extradefs += [ "<STR_LIT>" ] <EOL> ctx . options . lapack_include = osp . join ( ctx . env . PREFIX , "<STR_LIT>" ) <EOL> ctx . options . lapack_lib = "<STR_LIT>" <EOL> do_include ( ctx , "<STR_LIT>" ) <EOL> elif ctx . options . lapack_mkl : <EOL> ctx . start_msg ( "<STR_LIT>" ) <EOL> if ctx . options . lapack_mkl_version . strip ( ) [ : <NUM_LIT:4> ] not in ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) : <EOL> ctx . end_msg ( ctx . options . lapack_mkl_version . strip ( ) , color = "<STR_LIT>" ) <EOL> raise Errors . WafError ( "<STR_LIT>" % ctx . options . lapack_mkl_version . strip ( ) ) <EOL> version = int ( ctx . options . lapack_mkl_version . strip ( ) [ : <NUM_LIT:4> ] . split ( "<STR_LIT:.>" ) [ <NUM_LIT:1> ] ) <EOL> ctx . end_msg ( "<STR_LIT>" % version ) <EOL> lapack_extradefs = [ "<STR_LIT>" ] <EOL> lapack_extradefs += [ "<STR_LIT>" ] <EOL> lapack_includes = [ "<STR_LIT>" , "<STR_LIT>" ] <EOL> lapack_libs = [ ] <EOL> tag = sys . platform . lower ( ) <EOL> if tag == "<STR_LIT>" : <EOL> pass <EOL> elif "<STR_LIT>" in tag : <EOL> tag = "<STR_LIT>" <EOL> else : <EOL> raise Errors . WafError ( "<STR_LIT>" % tag ) <EOL> tag += "<STR_LIT>" % version <EOL> mopt = ctx . env . mopt <EOL> if "<STR_LIT>" in mopt : <EOL> tag += "<STR_LIT>" <EOL> else : <EOL> tag += "<STR_LIT>" <EOL> if sys . platform . lower ( ) != '<STR_LIT>' : <EOL> cmdline = """<STR_LIT>""" <EOL> cmdlist = { } <EOL> cmdlist [ "<STR_LIT>" ] = "<STR_LIT:U+0020>" . join ( [ "<STR_LIT>" % v for v in lapack_funcs . split ( ) ] ) <EOL> cmdlist [ "<STR_LIT>" ] = "<STR_LIT:U+0020>" . join ( [ osp . join ( mkl_options [ tag ] [ <NUM_LIT:0> ] % ( ctx . options . lapack_mkl ) , "<STR_LIT>" % v . strip ( ) ) for v in mkl_options [ tag ] [ <NUM_LIT:1> ] . split ( "<STR_LIT>" ) if v . strip ( ) and v . strip ( ) [ : <NUM_LIT:3> ] == "<STR_LIT>" ] ) <EOL> cmdlist [ "<STR_LIT>" ] = "<STR_LIT:U+0020>" . join ( "<STR_LIT>" % v . strip ( ) for v in ctx . env . LIBPATH_fc_runtime if v . strip ( ) ) <EOL> cmdlist [ "<STR_LIT>" ] = "<STR_LIT:U+0020>" . join ( [ v . strip ( ) for v in mkl_options [ tag ] [ <NUM_LIT:1> ] . split ( ) if v . strip ( ) and "<STR_LIT>" not in v ] ) <EOL> cmdlist [ "<STR_LIT>" ] = osp . join ( ctx . env . LIBDIR , ctx . env . cshlib_PATTERN % "<STR_LIT>" ) <EOL> cmdline = cmdline % cmdlist <EOL> ctx . start_msg ( "<STR_LIT>" ) <EOL> llgo , llge = ctx . cmd_and_log ( cmdline , output = waflib . Context . BOTH ) <EOL> ctx . end_msg ( cmdlist [ "<STR_LIT>" ] ) <EOL> ctx . options . lapack_link = "<STR_LIT>" + cmdlist [ "<STR_LIT>" ] <EOL> ctx . options . lapack_lib = ctx . env . LIBDIR + "<STR_LIT::>" . join ( [ "<STR_LIT>" ] + ctx . env . LIBPATH_fc_runtime ) <EOL> ctx . options . lapack_include = ctx . options . lapack_mkl + "<STR_LIT>" <EOL> else : <EOL> ctx . options . lapack_link = mkl_options [ tag ] [ <NUM_LIT:1> ] <EOL> ctx . options . lapack_lib = mkl_options [ tag ] [ <NUM_LIT:0> ] % ( ctx . options . lapack_mkl ) + "<STR_LIT::>" . join ( [ "<STR_LIT>" ] + ctx . env . LIBPATH_fc_runtime ) <EOL> if "<STR_LIT>" in ctx . options . lapack_mkl . lower ( ) : <EOL> ctx . options . lapack_include = ctx . options . lapack_mkl + "<STR_LIT>" <EOL> else : <EOL> ctx . options . lapack_include = ctx . options . lapack_mkl + "<STR_LIT>" <EOL> elif atl . upgrade ( ctx , "<STR_LIT>" ) or ctx . options . lapack_islocal or ctx . options . lapack_forceinstall or atl . shouldIinstall_all ( ctx , "<STR_LIT>" ) : <EOL> ctx . env . append_value ( "<STR_LIT>" , ctx . env . LIBPATH_fc_runtime ) <EOL> ctx . env . append_value ( "<STR_LIT>" , ctx . env . RPATH_fc_runtime ) <EOL> ctx . env . append_value ( "<STR_LIT>" , ctx . env . LIB_fc_runtime ) <EOL> lapack_libs = [ "<STR_LIT>" , "<STR_LIT>" ] <EOL> lapack_includes = [ "<STR_LIT>" ] <EOL> lapack_extradefs = [ "<STR_LIT>" ] <EOL> lapack_extradefs += [ "<STR_LIT>" ] <EOL> else : <EOL> lapack_libs = [ ] <EOL> lapack_includes = [ "<STR_LIT>" ] <EOL> lapack_extradefs = [ "<STR_LIT>" ] <EOL> lapack_extradefs += [ "<STR_LIT>" ] <EOL> do_include ( ctx ) <EOL> atl . conf_lib ( ctx , "<STR_LIT>" , lapack_libs , lapack_funcs . split ( ) , lapack_includes , defines = lapack_extradefs , install = installlapack ) <EOL> def installlapack ( ctx ) : <EOL> filen = version + "<STR_LIT>" <EOL> atl . installsmthg_pre ( ctx , "<STR_LIT>" + filen , filen ) <EOL> from waflib import Utils , Errors <EOL> dii = { "<STR_LIT>" : ctx . env . FC , "<STR_LIT>" : "<STR_LIT:U+0020>" . join ( ctx . env . FCFLAGS + ctx . env . FCFLAGS_fcshlib ) , "<STR_LIT>" : "<STR_LIT:U+0020>" . join ( ctx . env . FCFLAGS + ctx . env . LINKFLAGS_fcshlib ) , "<STR_LIT>" : ctx . env . shsuffix , "<STR_LIT>" : "<STR_LIT:U+0020>" . join ( ctx . env . FCFLAGS ) } <EOL> Logs . pprint ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> f = open ( "<STR_LIT>" % version , "<STR_LIT:w>" ) <EOL> print >> f , make_inc_blas % dii <EOL> f . close ( ) <EOL> cmdline = "<STR_LIT>" % version <EOL> if ctx . exec_command ( cmdline ) != <NUM_LIT:0> : <EOL> raise Errors . WafError ( "<STR_LIT>" % version ) <EOL> Logs . pprint ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> f = open ( "<STR_LIT>" % version , "<STR_LIT:w>" ) <EOL> print >> f , make_inc_lapack % dii <EOL> f . close ( ) <EOL> cmdline = "<STR_LIT>" % version <EOL> if ctx . exec_command ( cmdline ) != <NUM_LIT:0> : <EOL> raise Errors . WafError ( "<STR_LIT>" % version ) <EOL> import shutil <EOL> shutil . copyfile ( "<STR_LIT>" % ( version , ctx . env . shsuffix ) , osp . join ( ctx . env . LIBDIR , "<STR_LIT>" % ctx . env . shsuffix ) ) <EOL> shutil . copyfile ( "<STR_LIT>" % ( version , ctx . env . shsuffix ) , osp . join ( ctx . env . LIBDIR , "<STR_LIT>" % ctx . env . shsuffix ) ) <EOL> do_include ( ctx ) <EOL> make_inc_lapack = """<STR_LIT>""" <EOL> make_inc_blas = """<STR_LIT>""" <EOL> extra_inc = """<STR_LIT>""" <EOL> mkl_options = { <EOL> "<STR_LIT>" : ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> "<STR_LIT>" : ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> "<STR_LIT>" : ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> "<STR_LIT>" : ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> "<STR_LIT>" : ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> "<STR_LIT>" : ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> "<STR_LIT>" : ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> "<STR_LIT>" : ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> "<STR_LIT>" : ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> "<STR_LIT>" : ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> "<STR_LIT>" : ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> "<STR_LIT>" : ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> } </s>
