Esempio n. 1
0
 def test_platform_name_darwin(self):
     """Test getting platform name (mocked for Darwin)."""
     st.get_os_type = lambda: st.DARWIN
     self.assertTrue(re.match('.*-apple-darwin$', get_platform_name()))
     self.assertTrue(
         re.match('.*-apple-darwin.*$',
                  get_platform_name(withversion=True)))
Esempio n. 2
0
 def test_platform_name_linux(self):
     """Test getting platform name (mocked for Linux)."""
     st.get_os_type = lambda: st.LINUX
     self.assertTrue(re.match('.*-unknown-linux$', get_platform_name()))
     self.assertTrue(
         re.match('.*-unknown-linux-gnu$',
                  get_platform_name(withversion=True)))
    def test_platform_name_native(self):
        """Test getting platform name."""
        platform_name_nover = get_platform_name()
        self.assertTrue(isinstance(platform_name_nover, basestring))
        len_nover = len(platform_name_nover.split('-'))
        self.assertTrue(len_nover >= 3)

        platform_name_ver = get_platform_name(withversion=True)
        self.assertTrue(isinstance(platform_name_ver, basestring))
        len_ver = len(platform_name_ver.split('-'))
        self.assertTrue(platform_name_ver.startswith(platform_name_ver))
        self.assertTrue(len_ver >= len_nover)
Esempio n. 4
0
    def test_platform_name(self):
        """Test getting platform name."""
        platform_name_nover = get_platform_name()
        self.assertTrue(isinstance(platform_name_nover, basestring))
        len_nover = len(platform_name_nover.split('-'))
        self.assertTrue(len_nover >= 3)

        platform_name_ver = get_platform_name(withversion=True)
        self.assertTrue(isinstance(platform_name_ver, basestring))
        len_ver = len(platform_name_ver.split('-'))
        self.assertTrue(platform_name_ver.startswith(platform_name_ver))
        self.assertTrue(len_ver >= len_nover)
Esempio n. 5
0
    def install_step(self):
        """
        Actual installation
        - create silent cfg file
        - execute command
        """

        platform_name = get_platform_name()
        if platform_name.startswith('x86_64'):
            self.arch = "intel64"
        elif platform_name.startswith('i386') or platform_name.startswith('i686'):
            self.arch = 'ia32'
        else:
            raise EasyBuildError("Failed to determine system architecture based on %s", platform_name)

        silent_cfg_names_map = None
        silent_cfg_extras = None

        if LooseVersion(self.version) < LooseVersion('8.0'):
            silent_cfg_names_map = {
                'activation_name': ACTIVATION_NAME_2012,
                'license_file_name': LICENSE_FILE_NAME_2012,
            }

        # in case of IPP 9.x, we have to specify ARCH_SELECTED in silent.cfg
        if LooseVersion(self.version) >= LooseVersion('9.0'):
            silent_cfg_extras = {
                'ARCH_SELECTED': self.arch.upper()
            }

        super(EB_ipp, self).install_step(silent_cfg_names_map=silent_cfg_names_map, silent_cfg_extras=silent_cfg_extras)
    def __init__(self, *args, **kwargs):
        """Initialisation of custom class variables for tbb"""
        super(EB_tbb, self).__init__(*args, **kwargs)

        platform_name = get_platform_name()
        myarch = get_cpu_architecture()
        if platform_name.startswith('x86_64'):
            self.arch = "intel64"
        elif platform_name.startswith('i386') or platform_name.startswith(
                'i686'):
            self.arch = 'ia32'
        elif myarch == POWER:
            self.arch = 'ppc64'
        else:
            raise EasyBuildError(
                "Failed to determine system architecture based on %s",
                platform_name)

        if not self.toolchain.is_system_toolchain():
            # open-source TBB version
            self.build_in_installdir = True
            self.cfg['requires_runtime_license'] = False

        if self.toolchain.is_system_toolchain():
            self.tbb_subdir = 'tbb'
        else:
            self.tbb_subdir = ''
Esempio n. 7
0
    def __init__(self, *args, **kwargs):
        super(EB_GCC, self).__init__(*args, **kwargs)

        self.stagedbuild = False

        # need to make sure version is an actual version
        # required because of support in SystemCompiler generic easyblock to specify 'system' as version,
        # which results in deriving the actual compiler version
        # comparing a non-version like 'system' with an actual version like '2016' fails with TypeError in Python 3.x
        if re.match(r'^[0-9]+\.[0-9]+.*', self.version):
            version = LooseVersion(self.version)

            if version >= LooseVersion('4.8.0') and self.cfg[
                    'clooguseisl'] and not self.cfg['withisl']:
                raise EasyBuildError(
                    "Using ISL bundled with CLooG is unsupported in >=GCC-4.8.0. "
                    "Use a seperate ISL: set withisl=True")

            # I think ISL without CLooG has no purpose in GCC < 5.0.0 ...
            if version < LooseVersion('5.0.0') and self.cfg[
                    'withisl'] and not self.cfg['withcloog']:
                raise EasyBuildError(
                    "Activating ISL without CLooG is pointless")

        # unset some environment variables that are known to may cause nasty build errors when bootstrapping
        self.cfg.update('unwanted_env_vars', [
            'CPATH', 'C_INCLUDE_PATH', 'CPLUS_INCLUDE_PATH',
            'OBJC_INCLUDE_PATH'
        ])
        # ubuntu needs the LIBRARY_PATH env var to work apparently (#363)
        if get_os_name() not in ['ubuntu', 'debian']:
            self.cfg.update('unwanted_env_vars', ['LIBRARY_PATH'])

        self.platform_lib = get_platform_name(withversion=True)
Esempio n. 8
0
    def __init__(self, *args, **kwargs):
        super(EB_GCC, self).__init__(*args, **kwargs)

        self.stagedbuild = False

        if LooseVersion(self.version) >= LooseVersion("4.8.0") and self.cfg[
                'clooguseisl'] and not self.cfg['withisl']:
            raise EasyBuildError(
                "Using ISL bundled with CLooG is unsupported in >=GCC-4.8.0. "
                "Use a seperate ISL: set withisl=True")

        # I think ISL without CLooG has no purpose in GCC < 5.0.0 ...
        if LooseVersion(self.version) < LooseVersion(
                "5.0.0") and self.cfg['withisl'] and not self.cfg['withcloog']:
            raise EasyBuildError("Activating ISL without CLooG is pointless")

        # unset some environment variables that are known to may cause nasty build errors when bootstrapping
        self.cfg.update('unwanted_env_vars', [
            'CPATH', 'C_INCLUDE_PATH', 'CPLUS_INCLUDE_PATH',
            'OBJC_INCLUDE_PATH'
        ])
        # ubuntu needs the LIBRARY_PATH env var to work apparently (#363)
        if get_os_name() not in ['ubuntu', 'debian']:
            self.cfg.update('unwanted_env_vars', ['LIBRARY_PATH'])

        self.platform_lib = get_platform_name(withversion=True)
Esempio n. 9
0
 def __init__(self, *args, **kwargs):
     """Initialisation of custom class variables for tbb"""
     super(EB_tbb, self).__init__(*args, **kwargs)
     self.libpath = 'UNKNOWN'
     platform_name = get_platform_name()
     if platform_name.startswith('x86_64'):
         self.arch = "intel64"
     elif platform_name.startswith('i386') or platform_name.startswith('i686'):
         self.arch = 'ia32'
     else:
         raise EasyBuildError("Failed to determine system architecture based on %s", platform_name)
Esempio n. 10
0
 def __init__(self, *args, **kwargs):
     """Initialisation of custom class variables for tbb"""
     super(EB_tbb, self).__init__(*args, **kwargs)
     self.libpath = 'UNKNOWN'
     platform_name = get_platform_name()
     if platform_name.startswith('x86_64'):
         self.arch = "intel64"
     elif platform_name.startswith('i386') or platform_name.startswith('i686'):
         self.arch = 'ia32'
     else:
         raise EasyBuildError("Failed to determine system architecture based on %s", platform_name)
Esempio n. 11
0
    def __init__(self, *args, **kwargs):
        """Initialisation of custom class variables for tbb"""
        super(EB_tbb, self).__init__(*args, **kwargs)

        self.libpath = 'UNKNOWN'
        platform_name = get_platform_name()
        if platform_name.startswith('x86_64'):
            self.arch = "intel64"
        elif platform_name.startswith('i386') or platform_name.startswith('i686'):
            self.arch = 'ia32'
        else:
            raise EasyBuildError("Failed to determine system architecture based on %s", platform_name)

        if self.toolchain.name != DUMMY_TOOLCHAIN_NAME:
            # open-source TBB version
            self.build_in_installdir = True
            self.cfg['requires_runtime_license'] = False
Esempio n. 12
0
    def __init__(self, *args, **kwargs):
        """Initialisation of custom class variables for tbb"""
        super(EB_tbb, self).__init__(*args, **kwargs)

        self.libpath = 'UNKNOWN'
        platform_name = get_platform_name()
        if platform_name.startswith('x86_64'):
            self.arch = "intel64"
        elif platform_name.startswith('i386') or platform_name.startswith(
                'i686'):
            self.arch = 'ia32'
        else:
            raise EasyBuildError(
                "Failed to determine system architecture based on %s",
                platform_name)

        if self.toolchain.name != DUMMY_TOOLCHAIN_NAME:
            # open-source TBB version
            self.build_in_installdir = True
            self.cfg['requires_runtime_license'] = False
Esempio n. 13
0
    def __init__(self, *args, **kwargs):
        super(EB_GCC, self).__init__(*args, **kwargs)

        self.stagedbuild = False

        if LooseVersion(self.version) >= LooseVersion("4.8.0") and self.cfg['clooguseisl'] and not self.cfg['withisl']:
            raise EasyBuildError("Using ISL bundled with CLooG is unsupported in >=GCC-4.8.0. "
                                 "Use a seperate ISL: set withisl=True")

        # I think ISL without CLooG has no purpose in GCC < 5.0.0 ...
        if LooseVersion(self.version) < LooseVersion("5.0.0") and self.cfg['withisl'] and not self.cfg['withcloog']:
            raise EasyBuildError("Activating ISL without CLooG is pointless")

        # unset some environment variables that are known to may cause nasty build errors when bootstrapping
        self.cfg.update('unwanted_env_vars', ['CPATH', 'C_INCLUDE_PATH', 'CPLUS_INCLUDE_PATH', 'OBJC_INCLUDE_PATH'])
        # ubuntu needs the LIBRARY_PATH env var to work apparently (#363)
        if get_os_name() not in ['ubuntu', 'debian']:
            self.cfg.update('unwanted_env_vars', ['LIBRARY_PATH'])

        self.platform_lib = get_platform_name(withversion=True)
    def configure_step(self):
        """Configure GAMESS-US build via provided interactive 'config' script."""

        # machine type
        platform_name = get_platform_name()
        x86_64_linux_re = re.compile('^x86_64-.*$')
        if x86_64_linux_re.match(platform_name):
            machinetype = "linux64"
        else:
            raise EasyBuildError("Build target %s currently unsupported",
                                 platform_name)

        # compiler config
        comp_fam = self.toolchain.comp_family()
        fortran_comp, fortran_ver = None, None
        if comp_fam == toolchain.INTELCOMP:
            fortran_comp = 'ifort'
            (out, _) = run_cmd("ifort -v", simple=False)
            res = re.search(r"^ifort version ([0-9]+)\.[0-9.]+$", out)
            if res:
                fortran_ver = res.group(1)
            else:
                raise EasyBuildError(
                    "Failed to determine ifort major version number")
        elif comp_fam == toolchain.GCC:
            fortran_comp = 'gfortran'
            fortran_ver = '.'.join(get_software_version('GCC').split('.')[:2])
        else:
            raise EasyBuildError("Compiler family '%s' currently unsupported.",
                                 comp_fam)

        # math library config
        known_mathlibs = ['imkl', 'OpenBLAS', 'ATLAS', 'ACML']
        mathlib, mathlib_root = None, None
        for mathlib in known_mathlibs:
            mathlib_root = get_software_root(mathlib)
            if mathlib_root is not None:
                break
        if mathlib_root is None:
            raise EasyBuildError(
                "None of the known math libraries (%s) available, giving up.",
                known_mathlibs)
        if mathlib == 'imkl':
            mathlib = 'mkl'
            mathlib_root = os.path.join(mathlib_root, 'mkl')
        else:
            mathlib = mathlib.lower()

        # verify selected DDI communication layer
        known_ddi_comms = ['mpi', 'mixed', 'shmem', 'sockets']
        if not self.cfg['ddi_comm'] in known_ddi_comms:
            raise EasyBuildError(
                "Unsupported DDI communication layer specified (known: %s): %s",
                known_ddi_comms, self.cfg['ddi_comm'])

        # MPI library config
        mpilib, mpilib_root, mpilib_path = None, None, None
        if self.cfg['ddi_comm'] == 'mpi':

            known_mpilibs = ['impi', 'OpenMPI', 'MVAPICH2', 'MPICH2']
            for mpilib in known_mpilibs:
                mpilib_root = get_software_root(mpilib)
                if mpilib_root is not None:
                    break
            if mpilib_root is None:
                raise EasyBuildError(
                    "None of the known MPI libraries (%s) available, giving up.",
                    known_mpilibs)
            mpilib_path = mpilib_root
            if mpilib == 'impi':
                mpilib_path = os.path.join(mpilib_root, 'intel64')
            else:
                mpilib = mpilib.lower()
        else:
            mpilib, mpilib_root = '', ''

        # run interactive 'config' script to generate install.info file
        cmd = "%(preconfigopts)s ./config %(configopts)s" % {
            'preconfigopts': self.cfg['preconfigopts'],
            'configopts': self.cfg['configopts'],
        }
        qa = {
            "After the new window is open, please hit <return> to go on.":
            '',
            "please enter your target machine name: ":
            machinetype,
            "Version? [00] ":
            self.version,
            "Please enter your choice of FORTRAN: ":
            fortran_comp,
            "hit <return> to continue to the math library setup.":
            '',
            "MKL pathname? ":
            mathlib_root,
            "MKL version (or 'skip')? ":
            'skip',
            "MKL version (or 'proceed')? ":
            'proceed',  # changed in gamess-20170420R1
            "please hit <return> to compile the GAMESS source code activator":
            '',
            "please hit <return> to set up your network for Linux clusters.":
            '',
            "communication library ('sockets' or 'mpi')? ":
            self.cfg['ddi_comm'],
            "Enter MPI library (impi, mvapich2, mpt, sockets):":
            mpilib,
            "Enter MPI library (impi, mpich, mpich2, mvapich2, mpt, sockets):":
            mpilib,  # changed in gamess-20170420R1
            "Please enter your %s's location: " % mpilib:
            mpilib_root,
            "Do you want to try LIBCCHEM?  (yes/no): ":
            'no',
            "Enter full path to OpenBLAS libraries (without 'lib' subdirectory):":
            mathlib_root,
            "Optional: Build Michigan State University CCT3 & CCSD3A methods?  (yes/no): ":
            'no',
        }
        stdqa = {
            r"GAMESS directory\? \[.*\] ":
            self.builddir,
            r"GAMESS build directory\? \[.*\] ":
            self.installdir,  # building in install directory
            r"Enter only the main version number, such as .*\nVersion\? ":
            fortran_ver,
            r".+gfortran version.\n( \n)?Please enter only the first decimal place, such as .*:":
            fortran_ver,
            "Enter your choice of 'mkl' or .* 'none': ":
            mathlib,
        }
        run_cmd_qa(cmd, qa=qa, std_qa=stdqa, log_all=True, simple=True)

        self.log.debug("Contents of install.info:\n%s" %
                       read_file(os.path.join(self.builddir, 'install.info')))

        # patch hardcoded settings in rungms to use values specified in easyconfig file
        rungms = os.path.join(self.builddir, 'rungms')
        extra_gmspath_lines = "set ERICFMT=$GMSPATH/auxdata/ericfmt.dat\nset MCPPATH=$GMSPATH/auxdata/MCP\n"
        try:
            for line in fileinput.input(rungms, inplace=1, backup='.orig'):
                line = re.sub(r"^(\s*set\s*TARGET)=.*",
                              r"\1=%s" % self.cfg['ddi_comm'], line)
                line = re.sub(
                    r"^(\s*set\s*GMSPATH)=.*",
                    r"\1=%s\n%s" % (self.installdir, extra_gmspath_lines),
                    line)
                line = re.sub(r"(null\) set VERNO)=.*",
                              r"\1=%s" % self.version, line)
                line = re.sub(r"^(\s*set DDI_MPI_CHOICE)=.*",
                              r"\1=%s" % mpilib, line)
                line = re.sub(
                    r"^(\s*set DDI_MPI_ROOT)=.*%s.*" % mpilib.lower(),
                    r"\1=%s" % mpilib_path, line)
                line = re.sub(r"^(\s*set GA_MPI_ROOT)=.*%s.*" % mpilib.lower(),
                              r"\1=%s" % mpilib_path, line)
                # comment out all adjustments to $LD_LIBRARY_PATH that involves hardcoded paths
                line = re.sub(r"^(\s*)(setenv\s*LD_LIBRARY_PATH\s*/.*)",
                              r"\1#\2", line)
                if self.cfg['scratch_dir']:
                    line = re.sub(r"^(\s*set\s*SCR)=.*",
                                  r"\1=%s" % self.cfg['scratch_dir'], line)
                    line = re.sub(r"^(\s*set\s*USERSCR)=.*",
                                  r"\1=%s" % self.cfg['scratch_dir'], line)
                sys.stdout.write(line)
        except IOError as err:
            raise EasyBuildError("Failed to patch %s: %s", rungms, err)
Esempio n. 15
0
 def test_platform_name_linux(self):
     """Test getting platform name (mocked for Linux)."""
     st.get_os_type = lambda: st.LINUX
     self.assertTrue(re.match('.*-unknown-linux$', get_platform_name()))
     self.assertTrue(re.match('.*-unknown-linux-gnu$', get_platform_name(withversion=True)))
Esempio n. 16
0
    def configure_step(self):
        """Configure GAMESS-US build via provided interactive 'config' script."""

        # machine type
        platform_name = get_platform_name()
        x86_64_linux_re = re.compile('^x86_64-.*$')
        if x86_64_linux_re.match(platform_name):
            machinetype = "linux64"
        else:
            raise EasyBuildError("Build target %s currently unsupported", platform_name)

        # compiler config
        comp_fam = self.toolchain.comp_family()
        fortran_comp, fortran_ver = None, None
        if comp_fam == toolchain.INTELCOMP:
            fortran_comp = 'ifort'
            (out, _) = run_cmd("ifort -v", simple=False)
            res = re.search(r"^ifort version ([0-9]+)\.[0-9.]+$", out)
            if res:
                fortran_ver = res.group(1)
            else:
                raise EasyBuildError("Failed to determine ifort major version number")
        elif comp_fam == toolchain.GCC:
            fortran_comp = 'gfortran'
            fortran_ver = '.'.join(get_software_version('GCC').split('.')[:2])
        else:
            raise EasyBuildError("Compiler family '%s' currently unsupported.", comp_fam)

        # math library config
        known_mathlibs = ['imkl', 'OpenBLAS', 'ATLAS', 'ACML']
        mathlib, mathlib_root = None, None
        for mathlib in known_mathlibs:
            mathlib_root = get_software_root(mathlib)
            if mathlib_root is not None:
                break
        if mathlib_root is None:
            raise EasyBuildError("None of the known math libraries (%s) available, giving up.", known_mathlibs)
        if mathlib == 'imkl':
            mathlib = 'mkl'
            mathlib_root = os.path.join(mathlib_root, 'mkl')
        else:
            mathlib = mathlib.lower()

        # verify selected DDI communication layer
        known_ddi_comms = ['mpi', 'mixed', 'shmem', 'sockets']
        if not self.cfg['ddi_comm'] in known_ddi_comms:
            raise EasyBuildError("Unsupported DDI communication layer specified (known: %s): %s",
                                 known_ddi_comms, self.cfg['ddi_comm'])

        # MPI library config
        mpilib, mpilib_root, mpilib_path = None, None, None
        if self.cfg['ddi_comm'] == 'mpi':

            known_mpilibs = ['impi', 'OpenMPI', 'MVAPICH2', 'MPICH2']
            for mpilib in known_mpilibs:
                mpilib_root = get_software_root(mpilib)
                if mpilib_root is not None:
                    break
            if mpilib_root is None:
                raise EasyBuildError("None of the known MPI libraries (%s) available, giving up.", known_mpilibs)
            mpilib_path = mpilib_root
            if mpilib == 'impi':
                mpilib_path = os.path.join(mpilib_root, 'intel64')
            else:
                mpilib = mpilib.lower()

        # run interactive 'config' script to generate install.info file
        cmd = "%(preconfigopts)s ./config %(configopts)s" % {
            'preconfigopts': self.cfg['preconfigopts'],
            'configopts': self.cfg['configopts'],
        }
        qa = {
            "After the new window is open, please hit <return> to go on.": '',
            "please enter your target machine name: ": machinetype,
            "Version? [00] ": self.version,
            "Please enter your choice of FORTRAN: ": fortran_comp,
            "hit <return> to continue to the math library setup.": '',
            "MKL pathname? ": mathlib_root,
            "MKL version (or 'skip')? ": 'skip',
            "please hit <return> to compile the GAMESS source code activator": '',
            "please hit <return> to set up your network for Linux clusters.": '',
            "communication library ('sockets' or 'mpi')? ": self.cfg['ddi_comm'],
            "Enter MPI library (impi, mvapich2, mpt, sockets):": mpilib,
            "Please enter your %s's location: " % mpilib: mpilib_root,
            "Do you want to try LIBCCHEM?  (yes/no): ": 'no',
            "Enter full path to OpenBLAS libraries (without 'lib' subdirectory):": mathlib_root,
        }
        stdqa = {
            r"GAMESS directory\? \[.*\] ": self.builddir,
            r"GAMESS build directory\? \[.*\] ": self.installdir,  # building in install directory
            r"Enter only the main version number, such as .*\nVersion\? ": fortran_ver,
            r"gfortran version.\nPlease enter only the first decimal place, such as .*:": fortran_ver,
            "Enter your choice of 'mkl' or .* 'none': ": mathlib,
        }
        run_cmd_qa(cmd, qa=qa, std_qa=stdqa, log_all=True, simple=True)

        self.log.debug("Contents of install.info:\n%s" % read_file(os.path.join(self.builddir, 'install.info')))

        # patch hardcoded settings in rungms to use values specified in easyconfig file
        rungms = os.path.join(self.builddir, 'rungms')
        extra_gmspath_lines = "set ERICFMT=$GMSPATH/auxdata/ericfmt.dat\nset MCPPATH=$GMSPATH/auxdata/MCP\n"
        try:
            for line in fileinput.input(rungms, inplace=1, backup='.orig'):
                line = re.sub(r"^(\s*set\s*TARGET)=.*", r"\1=%s" % self.cfg['ddi_comm'], line)
                line = re.sub(r"^(\s*set\s*GMSPATH)=.*", r"\1=%s\n%s" % (self.installdir, extra_gmspath_lines), line)
                line = re.sub(r"(null\) set VERNO)=.*", r"\1=%s" % self.version, line)
                line = re.sub(r"^(\s*set DDI_MPI_CHOICE)=.*", r"\1=%s" % mpilib, line)
                line = re.sub(r"^(\s*set DDI_MPI_ROOT)=.*%s.*" % mpilib.lower(), r"\1=%s" % mpilib_path, line)
                line = re.sub(r"^(\s*set GA_MPI_ROOT)=.*%s.*" % mpilib.lower(), r"\1=%s" % mpilib_path, line)
                # comment out all adjustments to $LD_LIBRARY_PATH that involves hardcoded paths
                line = re.sub(r"^(\s*)(setenv\s*LD_LIBRARY_PATH\s*/.*)", r"\1#\2", line)
                if self.cfg['scratch_dir']:
                    line = re.sub(r"^(\s*set\s*SCR)=.*", r"\1=%s" % self.cfg['scratch_dir'], line)
                    line = re.sub(r"^(\s*set\s*USERSCR)=.*", r"\1=%s" % self.cfg['scratch_dir'], line)
                sys.stdout.write(line)
        except IOError, err:
            raise EasyBuildError("Failed to patch %s: %s", rungms, err)
Esempio n. 17
0
 def test_platform_name_darwin(self):
     """Test getting platform name (mocked for Darwin)."""
     st.get_os_type = lambda: st.DARWIN
     self.assertTrue(re.match('.*-apple-darwin$', get_platform_name()))
     self.assertTrue(re.match('.*-apple-darwin.*$', get_platform_name(withversion=True)))