本文整理汇总了Python中easybuild.easyblocks.generic.cmakemake.CMakeMake.configure_step方法的典型用法代码示例。如果您正苦于以下问题:Python CMakeMake.configure_step方法的具体用法?Python CMakeMake.configure_step怎么用?Python CMakeMake.configure_step使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类easybuild.easyblocks.generic.cmakemake.CMakeMake
的用法示例。
在下文中一共展示了CMakeMake.configure_step方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: configure_step
# 需要导入模块: from easybuild.easyblocks.generic.cmakemake import CMakeMake [as 别名]
# 或者: from easybuild.easyblocks.generic.cmakemake.CMakeMake import configure_step [as 别名]
def configure_step(self):
"""Configure build: set config options and configure"""
if LooseVersion(self.version) < LooseVersion("4.3"):
self.cfg.update('configopts', "--enable-shared")
if self.toolchain.options['pic']:
self.cfg.update('configopts', '--with-pic')
# tup = (os.getenv('FFLAGS'), os.getenv('MPICC'), os.getenv('F90'))
tup = (os.getenv('FFLAGS'), os.getenv('CC'), os.getenv('F90'))
self.cfg.update('configopts', 'FCFLAGS="%s" CC="%s" FC="%s"' % tup)
# add -DgFortran to CPPFLAGS when building with GCC
if self.toolchain.comp_family() == toolchain.GCC: #@UndefinedVariable
self.cfg.update('configopts', 'CPPFLAGS="%s -DgFortran"' % os.getenv('CPPFLAGS'))
ConfigureMake.configure_step(self)
else:
hdf5 = get_software_root('HDF5')
if hdf5:
env.setvar('HDF5_ROOT', hdf5)
CMakeMake.configure_step(self)
示例2: configure_step
# 需要导入模块: from easybuild.easyblocks.generic.cmakemake import CMakeMake [as 别名]
# 或者: from easybuild.easyblocks.generic.cmakemake.CMakeMake import configure_step [as 别名]
def configure_step(self):
"""Custom configuration procedure for Eigen."""
# start using CMake for Eigen 3.3.4 and newer versions
# not done for older versions, since this implies using (a dummy-built) CMake as a build dependency,
# which is a bit strange for a header-only library like Eigen...
if LooseVersion(self.version) >= LooseVersion('3.3.4'):
self.cfg['separate_build_dir'] = True
# avoid that include files are installed into include/eigen3/Eigen, should be include/Eigen
self.cfg.update('configopts', "-DINCLUDE_INSTALL_DIR=%s" % os.path.join(self.installdir, 'include'))
CMakeMake.configure_step(self)
示例3: configure_step
# 需要导入模块: from easybuild.easyblocks.generic.cmakemake import CMakeMake [as 别名]
# 或者: from easybuild.easyblocks.generic.cmakemake.CMakeMake import configure_step [as 别名]
def configure_step(self):
"""Custom configuration for ROOT, add configure options."""
# using ./configure is deprecated/broken in recent versions, need to use CMake instead
if LooseVersion(self.version.lstrip('v')) >= LooseVersion('6.10'):
if self.cfg['arch']:
raise EasyBuildError("Specified value '%s' for 'arch' is not used, should not be set", self.cfg['arch'])
cfitsio_root = get_software_root('CFITSIO')
if cfitsio_root:
self.cfg.update('configopts', '-DCFITSIO=%s' % cfitsio_root)
fftw_root = get_software_root('FFTW')
if fftw_root:
self.cfg.update('configopts', '-Dbuiltin_fftw3=OFF -DFFTW_DIR=%s' % fftw_root)
gsl_root = get_software_root('GSL')
if gsl_root:
self.cfg.update('configopts', '-DGSL_DIR=%s' % gsl_root)
mesa_root = get_software_root('Mesa')
if mesa_root:
self.cfg.update('configopts', '-DDOPENGL_INCLUDE_DIR=%s' % os.path.join(mesa_root, 'include'))
self.cfg.update('configopts', '-DOPENGL_gl_LIBRARY=%s' % os.path.join(mesa_root, 'lib', 'libGL.so'))
python_root = get_software_root('Python')
if python_root:
pyshortver = '.'.join(get_software_version('Python').split('.')[:2])
self.cfg.update('configopts', '-DPYTHON_EXECUTABLE=%s' % os.path.join(python_root, 'bin', 'python'))
python_inc_dir = os.path.join(python_root, 'include', 'python%s' % pyshortver)
self.cfg.update('configopts', '-DPYTHON_INCLUDE_DIR=%s' % python_inc_dir)
python_lib = os.path.join(python_root, 'lib', 'libpython%s.so' % pyshortver)
self.cfg.update('configopts', '-DPYTHON_LIBRARY=%s' % python_lib)
if get_software_root('X11'):
self.cfg.update('configopts', '-Dx11=ON')
self.cfg['separate_build_dir'] = True
CMakeMake.configure_step(self)
else:
if self.cfg['arch'] is None:
raise EasyBuildError("No architecture specified to pass to configure script")
self.cfg.update('configopts', "--etcdir=%s/etc/root " % self.installdir)
cmd = "%s ./configure %s --prefix=%s %s" % (self.cfg['preconfigopts'],
self.cfg['arch'],
self.installdir,
self.cfg['configopts'])
run_cmd(cmd, log_all=True, log_ok=True, simple=True)
示例4: configure_step
# 需要导入模块: from easybuild.easyblocks.generic.cmakemake import CMakeMake [as 别名]
# 或者: from easybuild.easyblocks.generic.cmakemake.CMakeMake import configure_step [as 别名]
def configure_step(self):
"""Configure build: set config options and configure"""
shlib_ext = get_shared_lib_ext()
if LooseVersion(self.version) < LooseVersion("4.3"):
self.cfg.update('configopts', "--enable-shared")
if self.toolchain.options['pic']:
self.cfg.update('configopts', '--with-pic')
tup = (os.getenv('FFLAGS'), os.getenv('MPICC'), os.getenv('F90'))
self.cfg.update('configopts', 'FCFLAGS="%s" CC="%s" FC="%s"' % tup)
# add -DgFortran to CPPFLAGS when building with GCC
if self.toolchain.comp_family() == toolchain.GCC: #@UndefinedVariable
self.cfg.update('configopts', 'CPPFLAGS="%s -DgFortran"' % os.getenv('CPPFLAGS'))
ConfigureMake.configure_step(self)
else:
self.cfg.update('configopts', '-DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG " ')
for (dep, libname) in [('cURL', 'curl'), ('HDF5', 'hdf5'), ('Szip', 'sz'), ('zlib', 'z')]:
dep_root = get_software_root(dep)
dep_libdir = get_software_libdir(dep)
if dep_root:
incdir = os.path.join(dep_root, 'include')
self.cfg.update('configopts', '-D%s_INCLUDE_DIR=%s ' % (dep.upper(), incdir))
if dep == 'HDF5':
env.setvar('HDF5_ROOT', dep_root)
libhdf5 = os.path.join(dep_root, dep_libdir, 'libhdf5.%s' % shlib_ext)
self.cfg.update('configopts', '-DHDF5_LIB=%s ' % libhdf5)
libhdf5_hl = os.path.join(dep_root, dep_libdir, 'libhdf5_hl.%s' % shlib_ext)
self.cfg.update('configopts', '-DHDF5_HL_LIB=%s ' % libhdf5_hl)
else:
libso = os.path.join(dep_root, dep_libdir, 'lib%s.%s' % (libname, shlib_ext))
self.cfg.update('configopts', '-D%s_LIBRARY=%s ' % (dep.upper(), libso))
CMakeMake.configure_step(self)
示例5: configure_step
# 需要导入模块: from easybuild.easyblocks.generic.cmakemake import CMakeMake [as 别名]
# 或者: from easybuild.easyblocks.generic.cmakemake.CMakeMake import configure_step [as 别名]
def configure_step(self):
"""
Configure build outside of source directory.
"""
try:
objdir = os.path.join(self.builddir, 'obj')
os.makedirs(objdir)
os.chdir(objdir)
except OSError as err:
raise EasyBuildError("Failed to prepare for configuration of PSI build: %s", err)
env.setvar('F77FLAGS', os.getenv('F90FLAGS'))
# In order to create new plugins with PSI, it needs to know the location of the source
# and the obj dir after install. These env vars give that information to the configure script.
self.psi_srcdir = os.path.basename(self.cfg['start_dir'].rstrip(os.sep))
self.install_psi_objdir = os.path.join(self.installdir, 'obj')
self.install_psi_srcdir = os.path.join(self.installdir, self.psi_srcdir)
env.setvar('PSI_OBJ_INSTALL_DIR', self.install_psi_objdir)
env.setvar('PSI_SRC_INSTALL_DIR', self.install_psi_srcdir)
# explicitely specify Python binary to use
pythonroot = get_software_root('Python')
if not pythonroot:
raise EasyBuildError("Python module not loaded.")
# pre 4.0b5, they were using autotools, on newer it's CMake
if LooseVersion(self.version) <= LooseVersion("4.0b5") and self.name == "PSI":
# Use EB Boost
boostroot = get_software_root('Boost')
if not boostroot:
raise EasyBuildError("Boost module not loaded.")
self.log.info("Using configure based build")
env.setvar('PYTHON', os.path.join(pythonroot, 'bin', 'python'))
env.setvar('USE_SYSTEM_BOOST', 'TRUE')
if self.toolchain.options.get('usempi', None):
# PSI doesn't require a Fortran compiler itself, but may require it to link to BLAS/LAPACK correctly
# we should always specify the sequential Fortran compiler,
# to avoid problems with -lmpi vs -lmpi_mt during linking
fcompvar = 'F77_SEQ'
else:
fcompvar = 'F77'
# update configure options
# using multi-threaded BLAS/LAPACK is important for performance,
# cfr. http://sirius.chem.vt.edu/psi4manual/latest/installfile.html#sec-install-iii
opt_vars = [
('cc', 'CC'),
('cxx', 'CXX'),
('fc', fcompvar),
('libdirs', 'LDFLAGS'),
('blas', 'LIBBLAS_MT'),
('lapack', 'LIBLAPACK_MT'),
]
for (opt, var) in opt_vars:
self.cfg.update('configopts', "--with-%s='%s'" % (opt, os.getenv(var)))
# -DMPICH_IGNORE_CXX_SEEK dances around problem with order of stdio.h and mpi.h headers
# both define SEEK_SET, this makes the one for MPI be ignored
self.cfg.update('configopts', "--with-opt='%s -DMPICH_IGNORE_CXX_SEEK'" % os.getenv('CFLAGS'))
# specify location of Boost
self.cfg.update('configopts', "--with-boost=%s" % boostroot)
# enable support for plugins
self.cfg.update('configopts', "--with-plugins")
ConfigureMake.configure_step(self, cmd_prefix=self.cfg['start_dir'])
else:
self.log.info("Using CMake based build")
self.cfg.update('configopts', ' -DPYTHON_INTERPRETER=%s' % os.path.join(pythonroot, 'bin', 'python'))
if self.name == 'PSI4' and LooseVersion(self.version) >= LooseVersion("1.2"):
self.log.info("Remove the CMAKE_BUILD_TYPE test in PSI4 source and the downloaded dependencies!")
self.log.info("Use PATCH_COMMAND in the corresponding CMakeLists.txt")
self.cfg.update('configopts', ' -DCMAKE_BUILD_TYPE=EasyBuildRelease')
else:
self.cfg.update('configopts', ' -DCMAKE_BUILD_TYPE=Release')
if self.toolchain.options.get('usempi', None):
self.cfg.update('configopts', " -DENABLE_MPI=ON")
if get_software_root('imkl'):
self.cfg.update('configopts', " -DENABLE_CSR=ON -DBLAS_TYPE=MKL")
if self.name == 'PSI4':
pcmsolverroot = get_software_root('PCMSolver')
if pcmsolverroot:
self.cfg.update('configopts', " -DENABLE_PCMSOLVER=ON")
if LooseVersion(self.version) < LooseVersion("1.2"):
self.cfg.update('configopts', " -DPCMSOLVER_ROOT=%s" % pcmsolverroot)
else:
self.cfg.update('configopts', " -DCMAKE_INSIST_FIND_PACKAGE_PCMSolver=ON "
"-DPCMSolver_DIR=%s/share/cmake/PCMSolver" % pcmsolverroot)
chempsroot = get_software_root('CheMPS2')
if chempsroot:
self.cfg.update('configopts', " -DENABLE_CHEMPS2=ON")
if LooseVersion(self.version) < LooseVersion("1.2"):
#.........这里部分代码省略.........
示例6: configure_step
# 需要导入模块: from easybuild.easyblocks.generic.cmakemake import CMakeMake [as 别名]
# 或者: from easybuild.easyblocks.generic.cmakemake.CMakeMake import configure_step [as 别名]
def configure_step(self, *args, **kwargs):
"""Main configuration using cmake"""
PythonPackage.configure_step(self, *args, **kwargs)
return CMakeMake.configure_step(self, *args, **kwargs)