本文整理汇总了Python中easybuild.easyblocks.generic.pythonpackage.PythonPackage类的典型用法代码示例。如果您正苦于以下问题:Python PythonPackage类的具体用法?Python PythonPackage怎么用?Python PythonPackage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PythonPackage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, *args, **kwargs):
"""
Constructor: initialize via PythonPackage,
to ensure everything is set up as needed to build with Python bindings
"""
PythonPackage.__init__(self, *args, **kwargs)
self.with_python_bindings = False
示例2: install_step
def install_step(self):
"""Custom install procedure for EggLib: first build/install C++ library, then build Python library."""
# build/install C++ library
cpp_subdir = os.path.join(self.builddir, 'egglib-cpp-%s' % self.version)
try:
os.chdir(cpp_subdir)
except OSError as err:
raise EasyBuildError("Failed to move to: %s", err)
ConfigureMake.configure_step(self)
ConfigureMake.build_step(self)
ConfigureMake.install_step(self)
# header files and libraries must be found when building Python library
for varname, subdir in [('CPATH', 'include'), ('LIBRARY_PATH', 'lib')]:
env.setvar(varname, '%s:%s' % (os.path.join(self.installdir, subdir), os.environ.get(varname, '')))
# build/install Python package
py_subdir = os.path.join(self.builddir, 'egglib-py-%s' % self.version)
try:
os.chdir(py_subdir)
except OSError as err:
raise EasyBuildError("Failed to move to: %s", err)
PythonPackage.build_step(self)
self.cfg.update('installopts', "--install-lib %s" % os.path.join(self.installdir, self.pylibdir))
self.cfg.update('installopts', "--install-scripts %s" % os.path.join(self.installdir, 'bin'))
PythonPackage.install_step(self)
示例3: install_step
def install_step(self):
"""
Install libxml2 and install python bindings
"""
ConfigureMake.install_step(self)
try:
os.chdir('python')
PythonPackage.install_step(self)
os.chdir('..')
except OSError, err:
self.log.error("Failed to install libxml2 Python bindings: %s" % err)
示例4: configure_step
def configure_step(self):
"""
Configure and
Test if python module is loaded
"""
if not get_software_root('Python'):
raise EasyBuildError("Python module not loaded")
# We will do the python bindings ourselves so force them off
self.cfg.update('configopts', '--without-python')
ConfigureMake.configure_step(self)
# prepare for installing Python package
PythonPackage.prepare_python(self)
示例5: build_step
def build_step(self):
"""
Make libxml2 first, then make python bindings
"""
ConfigureMake.build_step(self)
try:
os.chdir('python')
# set cflags to point to include folder
env.setvar('CFLAGS', "-I../include")
PythonPackage.build_step(self)
os.chdir('..')
except OSError, err:
self.log.error("Failed to build libxml2 Python bindings: %s" % err)
示例6: __init__
def __init__(self, *args, **kwargs):
"""Initialize PythonBundle easyblock."""
super(PythonBundle, self).__init__(*args, **kwargs)
self.cfg['exts_defaultclass'] = 'PythonPackage'
# need to disable templating to ensure that actual value for exts_default_options is updated...
prev_enable_templating = self.cfg.enable_templating
self.cfg.enable_templating = False
# set default options for extensions according to relevant top-level easyconfig parameters
pypkg_keys = PythonPackage.extra_options().keys()
for key in pypkg_keys:
if key not in self.cfg['exts_default_options']:
self.cfg['exts_default_options'][key] = self.cfg[key]
self.cfg['exts_default_options']['download_dep_fail'] = True
self.log.info("Detection of downloaded extension dependencies is enabled")
self.cfg.enable_templating = prev_enable_templating
self.log.info("exts_default_options: %s", self.cfg['exts_default_options'])
self.pylibdir = None
# figure out whether this bundle of Python packages is being installed for multiple Python versions
self.multi_python = 'Python' in self.cfg['multi_deps']
示例7: extra_options
def extra_options():
"""Define custom easyconfig parameters for TensorRT."""
# Combine extra variables from Binary and PythonPackage easyblocks
extra_vars = Binary.extra_options()
extra_vars = PythonPackage.extra_options(extra_vars)
return EasyBlock.extra_options(extra_vars)
示例8: configure_step
def configure_step(self):
"""
Configure and
Test if python module is loaded
"""
if not get_software_root('Python'):
self.log.error("Python module not loaded")
ConfigureMake.configure_step(self)
try:
os.chdir('python')
PythonPackage.configure_step(self)
os.chdir('..')
except OSError, err:
self.log.error("Failed to configure libxml2 Python bindings: %s" % err)
示例9: extra_options
def extra_options(extra_vars=None):
"""Easyconfig parameters specific to bundles of Python packages."""
if extra_vars is None:
extra_vars = {}
# combine custom easyconfig parameters of Bundle & PythonPackage
extra_vars = Bundle.extra_options(extra_vars)
return PythonPackage.extra_options(extra_vars)
示例10: extra_options
def extra_options():
extra_vars = {
# see https://developer.nvidia.com/cuda-gpus
'cuda_compute_capabilities': [[], "List of CUDA compute capabilities to build with", CUSTOM],
'with_jemalloc': [True, "Make TensorFlow use jemalloc", CUSTOM],
'with_mkl_dnn': [None, "Make TensorFlow use Intel MKL-DNN (enabled unless cuDNN is used)", CUSTOM],
}
return PythonPackage.extra_options(extra_vars)
示例11: extra_options
def extra_options():
extra_vars = {
# see https://developer.nvidia.com/cuda-gpus
'cuda_compute_capabilities': [[], "List of CUDA compute capabilities to build with", CUSTOM],
'path_filter': [[], "List of patterns to be filtered out in paths in $CPATH and $LIBRARY_PATH", CUSTOM],
'with_jemalloc': [None, "Make TensorFlow use jemalloc (usually enabled by default)", CUSTOM],
'with_mkl_dnn': [None, "Make TensorFlow use Intel MKL-DNN (enabled unless cuDNN is used)", CUSTOM],
}
return PythonPackage.extra_options(extra_vars)
示例12: __init__
def __init__(self, *args, **kwargs):
"""Initialize custom class variables."""
super(EB_MXNet, self).__init__(*args, **kwargs)
self.mxnet_src_dir = None
self.py_ext = PythonPackage(self, {'name': self.name, 'version': self.version})
self.py_ext.module_generator = self.module_generator
self.r_ext = RPackage(self, {'name': self.name, 'version': self.version})
self.r_ext.module_generator = self.module_generator
示例13: make_module_extra
def make_module_extra(self):
"""
Add python bindings to the pythonpath
"""
if self.with_python_bindings:
txt = PythonPackage.make_module_extra(self)
else:
txt = super(EB_libxml2, self).make_module_extra()
txt += self.module_generator.prepend_paths('CPATH', [os.path.join('include', 'libxml2')])
return txt
示例14: configure_step
def configure_step(self):
"""
Configure libxml2 build
"""
# only build with Python bindings if Python is listed as a dependency
python = get_software_root('Python')
if python:
self.with_python_bindings = True
if self.toolchain.name != DUMMY_TOOLCHAIN_NAME:
self.cfg.update('configopts', "CC='%s' CXX='%s'" % (os.getenv('CC'), os.getenv('CXX')))
if self.toolchain.options.get('pic', False):
self.cfg.update('configopts', '--with-pic')
zlib = get_software_root('zlib')
if zlib:
self.cfg.update('configopts', '--with-zlib=%s' % zlib)
# enable building of Python bindings if Python is a dependency (or build them ourselves for old versions)
# disable building of Python bindings if Python is not a dependency
if self.with_python_bindings and LooseVersion(self.version) >= LooseVersion('2.9.2'):
libxml2_pylibdir = os.path.join(self.installdir, self.pylibdir)
self.cfg.update('configopts', "--with-python=%s" % os.path.join(python, 'bin', 'python'))
self.cfg.update('configopts', "--with-python-install-dir=%s" % libxml2_pylibdir)
else:
self.cfg.update('configopts', '--without-python')
ConfigureMake.configure_step(self)
if self.with_python_bindings:
# prepare for installing Python package
PythonPackage.prepare_python(self)
# test using 'make check' (done via test_step)
self.cfg['runtest'] = 'check'
示例15: install_step
def install_step(self):
"""
Install libxml2 and install python bindings
"""
ConfigureMake.install_step(self)
try:
# We can only do the python bindings after the initial installation
# since setup.py expects to find the include dir in the installation path
# and that only exists after installation
os.chdir('python')
PythonPackage.configure_step(self)
# set cflags to point to include folder for the compilation step to succeed
env.setvar('CFLAGS', "-I../include")
PythonPackage.build_step(self)
PythonPackage.install_step(self)
os.chdir('..')
except OSError, err:
raise EasyBuildError("Failed to install libxml2 Python bindings: %s", err)