本文整理汇总了Python中easybuild.framework.application.Application.make方法的典型用法代码示例。如果您正苦于以下问题:Python Application.make方法的具体用法?Python Application.make怎么用?Python Application.make使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类easybuild.framework.application.Application
的用法示例。
在下文中一共展示了Application.make方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: make
# 需要导入模块: from easybuild.framework.application import Application [as 别名]
# 或者: from easybuild.framework.application.Application import make [as 别名]
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: make
# 需要导入模块: from easybuild.framework.application import Application [as 别名]
# 或者: from easybuild.framework.application.Application import make [as 别名]
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)
示例3: make
# 需要导入模块: from easybuild.framework.application import Application [as 别名]
# 或者: from easybuild.framework.application.Application import make [as 别名]
def make(self):
"""Build by supplying required make options, and running make."""
jasper = get_software_root('JASPER')
if not jasper:
self.log.error("JasPer module not loaded?")
makeopts = 'CC="%s" FC="%s" INCDIR="-I%s/include"' % (os.getenv('CC'), os.getenv('F90'), jasper)
self.updatecfg('makeopts', makeopts)
Application.make(self)
示例4: make
# 需要导入模块: from easybuild.framework.application import Application [as 别名]
# 或者: from easybuild.framework.application.Application import make [as 别名]
def make(self, verbose=False):
# default make is fine
Application.make(self, verbose=verbose)
# optionally also build shared libs
if self.getcfg('sharedlibs'):
try:
os.chdir('lib')
except OSError, err:
self.log.error("Failed to change to 'lib' directory for building the shared libs." % err)
self.log.debug("Building shared libraries")
cmd = "make shared cshared ptshared cptshared"
run_cmd(cmd, log_all=True, simple=True)
try:
os.chdir('..')
except OSError, err:
self.log.error("Failed to get back to previous dir after building shared libs: %s " % err)
示例5: make
# 需要导入模块: from easybuild.framework.application import Application [as 别名]
# 或者: from easybuild.framework.application.Application import make [as 别名]
def make(self):
"""Build ScaLAPACK using make after setting make options."""
# MPI compiler commands
if os.getenv('MPICC') and os.getenv('MPIF77') and os.getenv('MPIF90'):
mpicc = os.getenv('MPICC')
mpif77 = os.getenv('MPIF77')
mpif90 = os.getenv('MPIF90')
elif self.toolkit().mpi_type() in [toolkit.OPENMPI, toolkit.MVAPICH2]:
mpicc = 'mpicc'
mpif77 = 'mpif77'
mpif90 = 'mpif90'
else:
self.log.error("Don't know which compiler commands to use.")
# set BLAS and LAPACK libs
extra_makeopts = [
'BLASLIB="%s -lpthread"' % get_blas_lib(self.log),
'LAPACKLIB=%s/lib/liblapack.a' % get_software_root('LAPACK')
]
# build procedure changed in v2.0.0
if self.loosever < LooseVersion("2.0.0"):
blacs = get_software_root('BLACS')
# determine interface
interface = det_interface(self.log, os.path.join(blacs, 'bin'))
# set build and BLACS dir correctly
extra_makeopts.append('home=%s BLACSdir=%s' % (self.getcfg('startfrom'), blacs))
# set BLACS libs correctly
for (var, lib) in [
('BLACSFINIT', "F77init"),
('BLACSCINIT', "Cinit"),
('BLACSLIB', "")
]:
extra_makeopts.append('%s=%s/lib/libblacs%s.a' % (var, blacs, lib))
# set compilers and options
noopt = ''
if self.toolkit().opts['noopt']:
noopt += " -O0"
if self.toolkit().opts['pic']:
noopt += " -fPIC"
extra_makeopts += [
'F77="%s"' % mpif77,
'CC="%s"' % mpicc,
'NOOPT="%s"' % noopt,
'CCFLAGS="-O3"'
]
# set interface
extra_makeopts.append("CDEFS='-D%s -DNO_IEEE $(USEMPI)'" % interface)
else:
# determine interface
if self.toolkit().mpi_type() in [toolkit.OPENMPI, toolkit.MVAPICH2]:
interface = 'Add_'
else:
self.log.error("Don't know which interface to pick for the MPI library being used.")
# set compilers and options
extra_makeopts += [
'FC="%s"' % mpif90,
'CC="%s"' % mpicc
]
# set interface
extra_makeopts.append('CDEFS="-D%s"' % interface)
# update make opts, and make
self.updatecfg('makeopts', ' '.join(extra_makeopts))
Application.make(self)
示例6: make_install
# 需要导入模块: from easybuild.framework.application import Application [as 别名]
# 或者: from easybuild.framework.application.Application import make [as 别名]
os.chdir(cwd)
except OSError, err:
self.log.error("Failed to determine interface and transcomm settings: %s" % err)
opts.update({
'comm': comm,
'int': interface,
'base': base
})
add_makeopts = ' MPICC=%(mpicc)s MPIF77=%(mpif77)s %(comm)s ' % opts
add_makeopts += ' INTERFACE=%(int)s MPIdir=%(base)s BTOPdir=%(builddir)s mpi ' % opts
self.updatecfg('makeopts', add_makeopts)
Application.make(self)
def make_install(self):
"""Install by copying files to install dir."""
# include files
src = os.path.join(self.getcfg('startfrom'), 'LIB')
# include files and libraries
for (srcdir, destdir, ext) in [
(os.path.join("SRC", "MPI"), "include", ".h"), # include files
("LIB", "lib", ".a"), # libraries
]:
src = os.path.join(self.getcfg('startfrom'), srcdir)
dest = os.path.join(self.installdir, destdir)