本文整理汇总了Python中easybuild.framework.application.Application类的典型用法代码示例。如果您正苦于以下问题:Python Application类的具体用法?Python Application怎么用?Python Application使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Application类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: make
def make(self):
"""
Build with make and correct make options
"""
for envvar in ["MPICC", "LIBLAPACK_MT", "CPPFLAGS", "LDFLAGS", "CFLAGS"]:
if not os.getenv(envvar):
self.log.error("Required environment variable %s not found (no toolkit used?)." % envvar)
# build dir
extra_makeopts = 'TOPdir="%s" ' % self.getcfg("startfrom")
# compilers
extra_makeopts += 'CC="%(mpicc)s" MPICC="%(mpicc)s" LINKER="%(mpicc)s" ' % {"mpicc": os.getenv("MPICC")}
# libraries: LAPACK and FFTW
extra_makeopts += 'LAlib="%s %s" ' % (os.getenv("LIBFFT"), os.getenv("LIBLAPACK_MT"))
# HPL options
extra_makeopts += 'HPL_OPTS="%s -DUSING_FFTW" ' % os.getenv("CPPFLAGS")
# linker flags
extra_makeopts += 'LINKFLAGS="%s" ' % os.getenv("LDFLAGS")
# C compilers flags
extra_makeopts += "CCFLAGS='$(HPL_DEFS) %s' " % os.getenv("CFLAGS")
# set options and build
self.updatecfg("makeopts", extra_makeopts)
Application.make(self)
示例2: sanitycheck
def sanitycheck(self):
"""Custom sanity check for OpenFOAM"""
if not self.getcfg('sanityCheckPaths'):
odir = "%s-%s" % (self.name(), self.version())
psubdir = "linux64%sDPOpt" % self.wm_compiler
if LooseVersion(self.version()) < LooseVersion("2"):
toolsdir = os.path.join(odir, "applications", "bin", psubdir)
else:
toolsdir = os.path.join(odir, "platforms", psubdir, "bin")
pdirs = []
if LooseVersion(self.version()) >= LooseVersion("2"):
pdirs = [toolsdir, os.path.join(odir, "platforms", psubdir, "lib")]
# some randomly selected binaries
# if one of these is missing, it's very likely something went wrong
bins = [os.path.join(odir, "bin", x) for x in []] + \
[os.path.join(toolsdir, "buoyant%sSimpleFoam" % x) for x in ["", "Boussinesq"]] + \
[os.path.join(toolsdir, "%sFoam" % x) for x in ["bubble", "engine", "sonic"]] + \
[os.path.join(toolsdir, "surface%s" % x) for x in ["Add", "Find", "Smooth"]] + \
[os.path.join(toolsdir, x) for x in ["deformedGeom", "engineSwirl", "modifyMesh", "refineMesh", "vorticity"]]
self.setcfg('sanityCheckPaths',{'files':["%s/etc/%s" % (odir, x) for x in ["bashrc", "cshrc"]] + bins,
'dirs':pdirs
})
self.log.info("Customized sanity check paths: %s" % self.getcfg('sanityCheckPaths'))
Application.sanitycheck(self)
示例3: sanitycheck
def sanitycheck(self):
"""
Custom sanity check for HDF5
"""
if not self.getcfg('sanityCheckPaths'):
if self.toolkit().opts['usempi']:
extra_binaries = ["bin/%s" % x for x in ["h5perf", "h5pcc", "h5pfc", "ph5diff"]]
else:
extra_binaries = ["bin/%s" % x for x in ["h5cc", "h5fc"]]
self.setcfg('sanityCheckPaths',{
'files': ["bin/h5%s" % x for x in ["2gif", "c++", "copy",
"debug", "diff", "dump",
"import", "jam","ls",
"mkgrp", "perf_serial",
"redeploy", "repack",
"repart", "stat", "unjam"]] +
["bin/gif2h5"] + extra_binaries +
["lib/libhdf5%s.so" % x for x in ["_cpp", "_fortran",
"_hl_cpp", "_hl",
"hl_fortran", ""]],
'dirs': ['include']
})
self.log.info("Customized sanity check paths: %s" % self.getcfg('sanityCheckPaths'))
Application.sanitycheck(self)
示例4: configure
def configure(self):
"""Configure build: <single-line description how this deviates from standard configure>"""
# set generic make options
self.updatecfg('makeopts', 'CC="%s" OPTFLAGS="%s"' % (os.getenv('MPICC'), os.getenv('CFLAGS')))
if LooseVersion(self.version()) >= LooseVersion("3.2"):
# set correct startfrom dir, and change into it
self.setcfg('startfrom', os.path.join(self.getcfg('startfrom'),'src'))
try:
os.chdir(self.getcfg('startfrom'))
except OSError, err:
self.log.error("Failed to change to correct source dir %s: %s" % (self.getcfg('startfrom'), err))
# run autoconf to generate configure script
cmd = "autoconf"
run_cmd(cmd)
# set config opts
beagle = get_software_root('BEAGLE')
if beagle:
self.updatecfg('configopts', '--with-beagle=%s' % beagle)
else:
self.log.error("BEAGLE module not loaded?")
if self.toolkit().opts['usempi']:
self.updatecfg('configopts', '--enable-mpi')
# configure
Application.configure(self)
示例5: configure
def configure(self):
"""Configure build: set require config and make options, and run configure script."""
# configure options
deps = ["Szip", "zlib"]
for dep in deps:
root = get_software_root(dep)
if root:
self.updatecfg('configopts', '--with-%s=%s' % (dep.lower(), root))
else:
self.log.error("Dependency module %s not loaded." % dep)
fcomp = 'FC="%s"' % os.getenv('F77')
self.updatecfg('configopts', "--with-pic --with-pthread --enable-shared")
self.updatecfg('configopts', "--enable-cxx --enable-fortran %s" % fcomp)
# MPI and C++ support enabled requires --enable-unsupported, because this is untested by HDF5
if self.toolkit().opts['usempi']:
self.updatecfg('configopts', "--enable-unsupported")
# make options
self.updatecfg('makeopts', fcomp)
Application.configure(self)
示例6: __init__
def __init__(self,*args,**kwargs):
"""Add extra config options specific to WRF."""
Application.__init__(self, *args, **kwargs)
self.build_in_installdir = True
self.wrfsubdir = None
self.comp_fam = None
示例7: sanitycheck
def sanitycheck(self):
"""Custom sanity check for g2clib."""
if not self.getcfg("sanityCheckPaths"):
self.setcfg("sanityCheckPaths", {"files": ["lib/libgrib2c.a"], "dirs": ["include"]})
Application.sanitycheck(self)
示例8: sanitycheck
def sanitycheck(self):
"""
Custom sanity check for netCDF
"""
if not self.getcfg('sanityCheckPaths'):
incs = ["netcdf.h"]
libs = ["libnetcdf.so", "libnetcdf.a"]
# since v4.2, the non-C libraries have been split off in seperate packages
# see netCDF-Fortran and netCDF-C++
if LooseVersion(self.version()) < LooseVersion("4.2"):
incs += ["netcdf%s" % x for x in ["cpp.h", ".hh", ".inc", ".mod"]] + \
["ncvalues.h", "typesizes.mod"]
libs += ["libnetcdf_c++.so", "libnetcdff.so",
"libnetcdf_c++.a", "libnetcdff.a"]
self.setcfg('sanityCheckPaths',{
'files': ["bin/nc%s" % x for x in ["-config", "copy", "dump",
"gen", "gen3"]] +
["lib/%s" % x for x in libs] +
["include/%s" % x for x in incs],
'dirs': []
})
self.log.info("Customized sanity check paths: %s" % self.getcfg('sanityCheckPaths'))
Application.sanitycheck(self)
示例9: __init__
def __init__(self,*args,**kwargs):
"""Specify building in install dir, initialize custom variables."""
Application.__init__(self, *args, **kwargs)
self.build_in_installdir = True
self.fsldir = None
示例10: setparallelism
def setparallelism(self, nr=None):
"""
Parallel build of ATLAS doesn't make sense (and doesn't work),
because it collects timing etc., so disable it.
"""
if not nr:
self.log.warning("Ignoring requested parallelism, it breaks ATLAS, so setting to 1")
self.log.info("Disabling parallel build, makes no sense for ATLAS.")
Application.setparallelism(self, 1)
示例11: cleanup
def cleanup(self):
"""Cleanup leftover mess
- clean home dir
- generic cleanup (get rid of build dir)
"""
self.clean_homedir()
Application.cleanup(self)
示例12: sanitycheck
def sanitycheck(self):
"""Custom sanity check for g2lib."""
if not self.getcfg('sanityCheckPaths'):
self.setcfg('sanityCheckPaths', {
'files': ["lib/libg2.a"],
'dirs': []
})
Application.sanitycheck(self)
示例13: make
def make(self):
"""
Only build when we're not testing.
"""
if self.getcfg('test_only'):
return
else:
# default make suffices (for now)
Application.make(self)
示例14: sanitycheck
def sanitycheck(self):
"""
Custom sanity check for HPL
"""
if not self.getcfg("sanityCheckPaths"):
self.setcfg("sanityCheckPaths", {"files": ["bin/xhpl"], "dirs": []})
self.log.info("Customized sanity check paths: %s" % self.getcfg("sanityCheckPaths"))
Application.sanitycheck(self)
示例15: __init__
def __init__(self,*args,**kwargs):
"""Specify that OpenFOAM should be built in install dir."""
Application.__init__(self, *args, **kwargs)
self.build_in_installdir = True
self.wm_compiler= None
self.wm_mplib = None
self.mpipath = None
self.thrdpartydir = None