diff --git a/easybuild/easyblocks/generic/cmakemake.py b/easybuild/easyblocks/generic/cmakemake.py index 79235a644e..0401f872e4 100644 --- a/easybuild/easyblocks/generic/cmakemake.py +++ b/easybuild/easyblocks/generic/cmakemake.py @@ -267,9 +267,10 @@ def configure_step(self, srcdir=None, builddir=None): self.log.info("Using absolute path to compiler command: %s", value) options[option] = value - if build_option('rpath'): + if build_option('rpath') and LooseVersion(self.cmake_version) < LooseVersion('3.5.0'): # instruct CMake not to fiddle with RPATH when --rpath is used, since it will undo stuff on install... - # https://github.com/LLNL/spack/blob/0f6a5cd38538e8969d11bd2167f11060b1f53b43/lib/spack/spack/build_environment.py#L416 + # this is only required for CMake < 3.5.0, since newer version are more careful w.r.t. RPATH, + # see https://github.com/Kitware/CMake/commit/3ec9226779776811240bde88a3f173c29aa935b5 options['CMAKE_SKIP_RPATH'] = 'ON' # show what CMake is doing by default diff --git a/easybuild/easyblocks/generic/modulerc.py b/easybuild/easyblocks/generic/modulerc.py index aa67e90fe3..c6bd4b988c 100644 --- a/easybuild/easyblocks/generic/modulerc.py +++ b/easybuild/easyblocks/generic/modulerc.py @@ -30,6 +30,7 @@ import os from easybuild.framework.easyblock import EasyBlock +from easybuild.framework.easyconfig import CUSTOM from easybuild.framework.easyconfig.easyconfig import ActiveMNS from easybuild.tools.build_log import EasyBuildError, print_msg from easybuild.tools.config import install_path @@ -41,6 +42,16 @@ class ModuleRC(EasyBlock): Generic easyblock to create a software-specific .modulerc file """ + @staticmethod + def extra_options(extra_vars=None): + """Define extra easyconfig parameters specific to ModuleRC""" + if extra_vars is None: + extra_vars = {} + extra_vars.update({ + 'check_version': [True, "Check version is prefix of dependency", CUSTOM], + }) + return EasyBlock.extra_options(extra_vars) + def configure_step(self): """Do nothing.""" pass @@ -67,7 +78,8 @@ def make_module_step(self, fake=False): raise EasyBuildError("Name does not match dependency name: %s vs %s", self.name, deps[0]['name']) # ensure version to alias to is a prefix of the version of the dependency - if not deps[0]['version'].startswith(self.version) and not self.version == "default": + if self.cfg['check_version'] and \ + not deps[0]['version'].startswith(self.version) and not self.version == "default": raise EasyBuildError("Version is not 'default' and not a prefix of dependency version: %s vs %s", self.version, deps[0]['version']) @@ -85,7 +97,7 @@ def make_module_step(self, fake=False): module_version_specs = { 'modname': alias_modname, - 'sym_version': self.version, + 'sym_version': self.version + self.cfg['versionsuffix'], 'version': deps[0]['version'], } self.module_generator.modulerc(module_version=module_version_specs, filepath=modulerc) diff --git a/easybuild/easyblocks/generic/perlbundle.py b/easybuild/easyblocks/generic/perlbundle.py index fcb5ce48f8..43cd4545c1 100644 --- a/easybuild/easyblocks/generic/perlbundle.py +++ b/easybuild/easyblocks/generic/perlbundle.py @@ -25,7 +25,7 @@ """ EasyBuild support for installing a bundle of Perl modules, implemented as a generic easyblock -@author: Mikael Öhman (Chalmers University of Technology) +@author: Mikael Oehman (Chalmers University of Technology) """ import os diff --git a/easybuild/easyblocks/i/imkl.py b/easybuild/easyblocks/i/imkl.py index 978b42137c..a342a4686c 100644 --- a/easybuild/easyblocks/i/imkl.py +++ b/easybuild/easyblocks/i/imkl.py @@ -546,11 +546,13 @@ def make_module_req_guess(self): os.path.join(self.mkl_basedir, 'include'), os.path.join(self.mkl_basedir, 'include', 'fftw'), ] + cmake_prefix_path = [self.mkl_basedir] guesses.update({ 'PATH': [], 'LD_LIBRARY_PATH': library_path, 'LIBRARY_PATH': library_path, 'CPATH': cpath, + 'CMAKE_PREFIX_PATH': cmake_prefix_path, 'PKG_CONFIG_PATH': pkg_config_path, }) if self.cfg['flexiblas']: diff --git a/easybuild/easyblocks/o/openmpi.py b/easybuild/easyblocks/o/openmpi.py index cf7c73151f..e76dd131bf 100644 --- a/easybuild/easyblocks/o/openmpi.py +++ b/easybuild/easyblocks/o/openmpi.py @@ -211,8 +211,18 @@ def sanity_check_step(self): mpi_cmd_tmpl, params = get_mpi_cmd_template(toolchain.OPENMPI, dict(), mpi_version=self.version) # Limit number of ranks to 8 to avoid it failing due to hyperthreading ranks = min(8, self.cfg['parallel']) - for src, compiler in (('hello_c.c', 'mpicc'), ('hello_mpifh.f', 'mpifort'), ('hello_usempi.f90', 'mpif90')): - src_path = os.path.join(self.cfg['start_dir'], 'examples', src) + for srcdir, src, compiler in ( + ('examples', 'hello_c.c', 'mpicc'), + ('examples', 'hello_mpifh.f', 'mpifort'), + ('examples', 'hello_usempi.f90', 'mpif90'), + ('examples', 'ring_c.c', 'mpicc'), + ('examples', 'ring_mpifh.f', 'mpifort'), + ('examples', 'ring_usempi.f90', 'mpif90'), + ('test/simple', 'thread_init.c', 'mpicc'), + ('test/simple', 'intercomm1.c', 'mpicc'), + ('test/simple', 'mpi_barrier.c', 'mpicc'), + ): + src_path = os.path.join(self.cfg['start_dir'], srcdir, src) if os.path.exists(src_path): test_exe = os.path.join(self.builddir, 'mpi_test_' + os.path.splitext(src)[0]) self.log.info("Adding minimal MPI test program to sanity checks: %s", test_exe) diff --git a/easybuild/easyblocks/p/palm.py b/easybuild/easyblocks/p/palm.py new file mode 100644 index 0000000000..6674be5c7a --- /dev/null +++ b/easybuild/easyblocks/p/palm.py @@ -0,0 +1,76 @@ +## +# Copyright 2023 Ghent University +# +# This file is part of EasyBuild, +# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), +# with support of Ghent University (http://ugent.be/hpc), +# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), +# Flemish Research Foundation (FWO) (http://www.fwo.be/en) +# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). +# +# https://github.com/easybuilders/easybuild +# +# EasyBuild is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation v2. +# +# EasyBuild is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with EasyBuild. If not, see . +## +""" +EasyBuild support for building and installing PALM, implemented as an easyblock + +@author: Viktor Rehnberg (Chalmers University of Technology) +""" +import os + +from easybuild.framework.easyblock import EasyBlock +from easybuild.tools.filetools import find_glob_pattern +from easybuild.tools.run import run_cmd + + +class EB_PALM(EasyBlock): + """Support for building/installing PALM.""" + + def __init__(self, *args, **kwargs): + """Initialise PALM easyblock.""" + super().__init__(*args, **kwargs) + + def configure_step(self): + """No configuration procedure for PALM.""" + pass + + def build_step(self): + """No build procedure for PALM.""" + pass + + def install_step(self): + """Custom install procedure for PALM.""" + + install_script_pattern = "install" + if self.dry_run: + install_script = install_script_pattern + else: + install_script = find_glob_pattern(install_script_pattern) + + cmd = ' '.join([ + self.cfg['preinstallopts'], + "bash", + install_script, + "-p %s" % self.installdir, + self.cfg['installopts'], + ]) + run_cmd(cmd, log_all=True, simple=True) + + def sanity_check_step(self): + """Custom sanity check for PALM.""" + custom_paths = { + 'files': [os.path.join(self.installdir, 'bin', 'palmrun')], + 'dirs': [], + } + super().sanity_check_step(custom_paths=custom_paths) diff --git a/easybuild/easyblocks/p/perl.py b/easybuild/easyblocks/p/perl.py index d96505ce7d..11542473cf 100644 --- a/easybuild/easyblocks/p/perl.py +++ b/easybuild/easyblocks/p/perl.py @@ -75,7 +75,7 @@ def configure_step(self): configopts = [ self.cfg['configopts'], '-Dcc="{0}"'.format(os.getenv('CC')), - '-Dccflags="{0}"'.format(os.getenv('CFLAGS')), + '-Dccflags="{0}"'.format(os.getenv('CFLAGS')) if '-Dccflags' not in self.cfg['configopts'] else '', '-Dinc_version_list=none', '-Dprefix=%(installdir)s', # guarantee that scripts are installed in /bin in the installation directory (and not in a guessed path) @@ -116,7 +116,7 @@ def configure_step(self): if os.getenv('COLUMNS', None) == '0': unset_env_vars(['COLUMNS']) - cmd = './Configure -de %s' % configopts + cmd = '%s ./Configure -de %s' % (self.cfg['preconfigopts'], configopts) run_cmd(cmd, log_all=True, simple=True) def test_step(self): diff --git a/easybuild/easyblocks/p/pytorch.py b/easybuild/easyblocks/p/pytorch.py index 40c116b197..58a5e9bdb8 100644 --- a/easybuild/easyblocks/p/pytorch.py +++ b/easybuild/easyblocks/p/pytorch.py @@ -318,7 +318,7 @@ def get_count_for_pattern(regex, text): return 0 # Create clear summary report - failure_report = "" + failure_report = [] failure_cnt = 0 error_cnt = 0 failed_test_suites = [] @@ -337,9 +337,9 @@ def get_count_for_pattern(regex, text): # E.g. 'failures=3, errors=10, skipped=190, expected failures=6' failure_summary = m.group('failure_summary') total, test_suite = m.group('test_cnt', 'failed_test_suite_name') - failure_report += "{test_suite} ({total} total tests, {failure_summary})\n".format( + failure_report.append("{test_suite} ({total} total tests, {failure_summary})".format( test_suite=test_suite, total=total, failure_summary=failure_summary - ) + )) failure_cnt += get_count_for_pattern(r"(?= LooseVersion('4.5.1'): + wrf_subdir = 'WRFV%s' % wrf_version else: wrf_subdir = 'WRF-%s' % wrf_version diff --git a/easybuild/easyblocks/w/wxpython.py b/easybuild/easyblocks/w/wxpython.py index 35b22b1867..939e2718a1 100644 --- a/easybuild/easyblocks/w/wxpython.py +++ b/easybuild/easyblocks/w/wxpython.py @@ -127,6 +127,9 @@ def sanity_check_step(self): files.extend([os.path.join('bin', 'wxrc')]) dirs.extend(['include', 'share']) py_bins.extend(['alacarte', 'alamode', 'wrap']) + elif LooseVersion(self.version) >= LooseVersion("4.2"): + majver = '3.2' # this is 3.2 in ver 4.2.x + py_bins.extend(['slices', 'slicesshell']) elif LooseVersion(self.version) >= LooseVersion("4.1"): majver = '3.1' # this is 3.1 in ver 4.1.x py_bins.extend(['slices', 'slicesshell'])