Exemple #1
0
    def handle_jemalloc(self):
        """Figure out whether jemalloc support should be enabled or not."""
        if self.cfg['with_jemalloc'] is None:
            if LooseVersion(self.version) > LooseVersion('1.6'):
                # jemalloc bundled with recent versions of TensorFlow does not work on RHEL 6 or derivatives,
                # so disable it automatically if with_jemalloc was left unspecified
                os_name = get_os_name().replace(' ', '')
                rh_based_os = any(
                    os_name.startswith(x)
                    for x in ['centos', 'redhat', 'rhel', 'sl'])
                if rh_based_os and get_os_version().startswith('6.'):
                    self.log.info(
                        "Disabling jemalloc since bundled jemalloc does not work on RHEL 6 and derivatives"
                    )
                    self.cfg['with_jemalloc'] = False

            # if the above doesn't disable jemalloc support, then enable it by default
            if self.cfg['with_jemalloc'] is None:
                self.log.info(
                    "Enabling jemalloc support by default, since it was left unspecified"
                )
                self.cfg['with_jemalloc'] = True

        else:
            # if with_jemalloc was specified, stick to that
            self.log.info(
                "with_jemalloc was specified as %s, so sticking to it",
                self.cfg['with_jemalloc'])
Exemple #2
0
 def check_readiness_step(self):
     """Fail early on RHEL 5.x and derivatives because of known bug in libc."""
     super(EB_Clang, self).check_readiness_step()
     # RHEL 5.x have a buggy libc.  Building stage 2 will fail.
     if get_os_name() in ['redhat', 'RHEL', 'centos', 'SL'] and get_os_version().startswith('5.'):
         raise EasyBuildError("Can not build Clang on %s v5.x: libc is buggy, building stage 2 will fail. "
                              "See http://stackoverflow.com/questions/7276828/", get_os_name())
 def check_readiness_step(self):
     """Fail early on RHEL 5.x and derivatives because of known bug in libc."""
     super(EB_Clang, self).check_readiness_step()
     # RHEL 5.x have a buggy libc.  Building stage 2 will fail.
     if get_os_name() in ['redhat', 'RHEL', 'centos', 'SL'] and get_os_version().startswith('5.'):
         self.log.error(("Can not build clang on %s v5.x: libc is buggy, building stage 2 will fail.  " +
                         "See http://stackoverflow.com/questions/7276828/") % get_os_name())
    def test_os_version(self):
        """Test getting OS version."""
        os_version = get_os_version()
        self.assertTrue(isinstance(os_version, string_type) or os_version == UNKNOWN)

        # make sure that bug fixed in https://github.com/easybuilders/easybuild-framework/issues/3952
        # does not surface again, by mocking what's needed to make get_os_version fall into SLES-specific path

        if hasattr(st.platform, 'dist'):
            st.platform.dist = lambda: (None, None)
        st.HAVE_DISTRO = False

        st.get_os_name = lambda: 'SLES'
        fake_etc_os_release = os.path.join(self.test_prefix, 'os-release')
        write_file(fake_etc_os_release, 'VERSION="15-SP1"')
        st.ETC_OS_RELEASE = fake_etc_os_release

        os_version = get_os_version()
        self.assertEqual(os_version, '15-SP1')
 def check_readiness_step(self):
     """Fail early on RHEL 5.x and derivatives because of known bug in libc."""
     super(EB_Clang, self).check_readiness_step()
     # RHEL 5.x have a buggy libc.  Building stage 2 will fail.
     if get_os_name() in ["redhat", "RHEL", "centos", "SL"] and get_os_version().startswith("5."):
         raise EasyBuildError(
             "Can not build Clang on %s v5.x: libc is buggy, building stage 2 will fail. "
             "See http://stackoverflow.com/questions/7276828/",
             get_os_name(),
         )
    def __init__(self, *args, **kwargs):
        """Initialize custom class variables for Clang."""

        super(EB_Clang, self).__init__(*args, **kwargs)
        self.llvm_src_dir = None
        self.llvm_obj_dir_stage1 = None
        self.llvm_obj_dir_stage2 = None
        self.llvm_obj_dir_stage3 = None
        self.make_parallel_opts = ""

        # RHEL 5.x have a buggy libc.  Building stage 2 will fail.
        if get_os_name() in ['redhat', 'RHEL', 'centos', 'SL'] and get_os_version().startswith('5.'):
            self.log.error(("Can not build clang on %s v5.x: libc is buggy, building stage 2 will fail.  " +
                            "See http://stackoverflow.com/questions/7276828/") % get_os_name()) 
    def __init__(self, *args, **kwargs):
        """Initialize custom class variables for Clang."""

        super(EB_Clang, self).__init__(*args, **kwargs)
        self.llvm_src_dir = None
        self.llvm_obj_dir_stage1 = None
        self.llvm_obj_dir_stage2 = None
        self.llvm_obj_dir_stage3 = None
        self.make_parallel_opts = ""

        # RHEL 5.x have a buggy libc.  Building stage 2 will fail.
        if get_os_name() in ['redhat', 'RHEL', 'centos', 'SL'
                             ] and get_os_version().startswith('5.'):
            self.log.error((
                "Can not build clang on %s v5.x: libc is buggy, building stage 2 will fail.  "
                + "See http://stackoverflow.com/questions/7276828/") %
                           get_os_name())
    def handle_jemalloc(self):
        """Figure out whether jemalloc support should be enabled or not."""
        if self.cfg['with_jemalloc'] is None:
            if LooseVersion(self.version) > LooseVersion('1.6'):
                # jemalloc bundled with recent versions of TensorFlow does not work on RHEL 6 or derivatives,
                # so disable it automatically if with_jemalloc was left unspecified
                rh_based_os = get_os_name().split(' ')[0] in ['centos', 'redhat', 'rhel', 'sl']
                if rh_based_os and get_os_version().startswith('6.'):
                    self.log.info("Disabling jemalloc since bundled jemalloc does not work on RHEL 6 and derivatives")
                    self.cfg['with_jemalloc'] = False

            # if the above doesn't disable jemalloc support, then enable it by default
            if self.cfg['with_jemalloc'] is None:
                self.log.info("Enabling jemalloc support by default, since it was left unspecified")
                self.cfg['with_jemalloc'] = True

        else:
            # if with_jemalloc was specified, stick to that
            self.log.info("with_jemalloc was specified as %s, so sticking to it", self.cfg['with_jemalloc'])
Exemple #9
0
 def test_os_version(self):
     """Test getting OS version."""
     os_version = get_os_version()
     self.assertTrue(
         isinstance(os_version, basestring) or os_version == UNKNOWN)
#

"""
Easyconfig constants module that provides all constants that can
be used within an Easyconfig file.

:author: Stijn De Weirdt (Ghent University)
:author: Kenneth Hoste (Ghent University)
"""
import os
import platform
from vsc.utils import fancylogger

from easybuild.tools.systemtools import get_shared_lib_ext, get_os_name, get_os_type, get_os_version


_log = fancylogger.getLogger('easyconfig.constants', fname=False)


EXTERNAL_MODULE_MARKER = 'EXTERNAL_MODULE'

# constants that can be used in easyconfig
EASYCONFIG_CONSTANTS = {
    'EXTERNAL_MODULE': (EXTERNAL_MODULE_MARKER, "External module marker"),
    'HOME': (os.path.expanduser('~'), "Home directory ($HOME)"),
    'OS_TYPE': (get_os_type(), "System type (e.g. 'Linux' or 'Darwin')"),
    'OS_NAME': (get_os_name(), "System name (e.g. 'fedora' or 'RHEL')"),
    'OS_VERSION': (get_os_version(), "System version"),
    'SYS_PYTHON_VERSION': (platform.python_version(), "System Python version (platform.python_version())"),
}
    if arch not in KNOWN_ARCH_CONSTANTS:
        print_warning("Using unknown value for ARCH constant: %s", arch)

    return arch


# constants that can be used in easyconfig
EASYCONFIG_CONSTANTS = {
    'ARCH':
    (_get_arch_constant(),
     "CPU architecture of current system (aarch64, x86_64, ppc64le, ...)"),
    'EXTERNAL_MODULE': (EXTERNAL_MODULE_MARKER, "External module marker"),
    'HOME': (os.path.expanduser('~'), "Home directory ($HOME)"),
    'OS_TYPE': (get_os_type(), "System type (e.g. 'Linux' or 'Darwin')"),
    'OS_NAME': (get_os_name(), "System name (e.g. 'fedora' or 'RHEL')"),
    'OS_VERSION': (get_os_version(), "System version"),
    'SYS_PYTHON_VERSION':
    (platform.python_version(),
     "System Python version (platform.python_version())"),
    'SYSTEM': ({
        'name': 'system',
        'version': 'system'
    }, "System toolchain"),
    'OS_PKG_IBVERBS_DEV':
    (('libibverbs-dev', 'libibverbs-devel', 'rdma-core-devel'),
     "OS packages providing ibverbs/infiniband development support"),
    'OS_PKG_OPENSSL_BIN': (('openssl'),
                           "OS packages providing the openSSL binary"),
    'OS_PKG_OPENSSL_LIB': (('libssl', 'libopenssl'),
                           "OS packages providing openSSL libraries"),
    'OS_PKG_OPENSSL_DEV':
 def test_os_version(self):
     """Test getting OS version."""
     os_version = get_os_version()
     self.assertTrue(isinstance(os_version, basestring) or os_version == UNKNOWN)