From 539af08cece2eaca471569276575e8822315b422 Mon Sep 17 00:00:00 2001 From: Ake Sandgren Date: Thu, 7 Nov 2024 12:41:17 +0100 Subject: [PATCH 01/15] gromacs: make it possible to disable single precision as build target. --- easybuild/easyblocks/g/gromacs.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/easybuild/easyblocks/g/gromacs.py b/easybuild/easyblocks/g/gromacs.py index b73f36ce18..b48f60cc0f 100644 --- a/easybuild/easyblocks/g/gromacs.py +++ b/easybuild/easyblocks/g/gromacs.py @@ -63,6 +63,8 @@ def extra_options(): extra_vars.update({ 'double_precision': [None, "Build with double precision enabled (-DGMX_DOUBLE=ON), " + "default is to build double precision unless CUDA is enabled", CUSTOM], + 'single_precision': [None, "Build with single precision enabled (-DGMX_DOUBLE=OFF), " + + "default is to build single precision", CUSTOM], 'mpisuffix': ['_mpi', "Suffix to append to MPI-enabled executables (only for GROMACS < 4.6)", CUSTOM], 'mpiexec': ['mpirun', "MPI executable to use when running tests", CUSTOM], 'mpiexec_numproc_flag': ['-np', "Flag to introduce the number of MPI tasks when running tests", CUSTOM], @@ -744,10 +746,15 @@ def run_all_steps(self, *args, **kwargs): 'mpi': 'install' } - precisions = ['single'] + precisions = [] + if self.cfg.get('single_precision') is None or self.cfg.get('single_precision'): + precisions.append('single') if self.cfg.get('double_precision') is None or self.cfg.get('double_precision'): precisions.append('double') + if precisions == []: + raise EasyBuildError("No precision selected. At least one of single/double_precision must be unset or True") + mpitypes = ['nompi'] if self.toolchain.options.get('usempi', None): mpitypes.append('mpi') From 2739cf0a4f720797140a748fbbc51c126c29d9df Mon Sep 17 00:00:00 2001 From: Ake Sandgren Date: Mon, 11 Nov 2024 07:46:10 +0100 Subject: [PATCH 02/15] gromacs: make single precision default value True. --- easybuild/easyblocks/g/gromacs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/easybuild/easyblocks/g/gromacs.py b/easybuild/easyblocks/g/gromacs.py index b48f60cc0f..4450448b86 100644 --- a/easybuild/easyblocks/g/gromacs.py +++ b/easybuild/easyblocks/g/gromacs.py @@ -63,7 +63,7 @@ def extra_options(): extra_vars.update({ 'double_precision': [None, "Build with double precision enabled (-DGMX_DOUBLE=ON), " + "default is to build double precision unless CUDA is enabled", CUSTOM], - 'single_precision': [None, "Build with single precision enabled (-DGMX_DOUBLE=OFF), " + + 'single_precision': [True, "Build with single precision enabled (-DGMX_DOUBLE=OFF), " + "default is to build single precision", CUSTOM], 'mpisuffix': ['_mpi', "Suffix to append to MPI-enabled executables (only for GROMACS < 4.6)", CUSTOM], 'mpiexec': ['mpirun', "MPI executable to use when running tests", CUSTOM], @@ -747,7 +747,7 @@ def run_all_steps(self, *args, **kwargs): } precisions = [] - if self.cfg.get('single_precision') is None or self.cfg.get('single_precision'): + if self.cfg.get('single_precision'): precisions.append('single') if self.cfg.get('double_precision') is None or self.cfg.get('double_precision'): precisions.append('double') From 2a963bb1b623b42164c9c0125edf2a8bedd100e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 26 Nov 2024 17:16:56 +0100 Subject: [PATCH 03/15] force use of bash for Allwmake scripts --- easybuild/easyblocks/o/openfoam.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/easybuild/easyblocks/o/openfoam.py b/easybuild/easyblocks/o/openfoam.py index 88ae377417..fd9d892c7a 100644 --- a/easybuild/easyblocks/o/openfoam.py +++ b/easybuild/easyblocks/o/openfoam.py @@ -340,7 +340,7 @@ def build_step(self): cleancmd = "wcleanAll" # make directly in install directory - cmd_tmpl = "%(precmd)s && %(cleancmd)s && %(prebuildopts)s %(makecmd)s" % { + cmd_tmpl = "%(precmd)s && %(cleancmd)s && %(prebuildopts)s bash %(makecmd)s" % { 'precmd': precmd, 'cleancmd': cleancmd, 'prebuildopts': self.cfg['prebuildopts'], @@ -371,7 +371,7 @@ def build_step(self): if self.looseversion >= LooseVersion('2406'): # Also build the plugins - cmd += ' && %s %s -log' % (self.cfg['prebuildopts'], + cmd += ' && %s bash %s -log' % (self.cfg['prebuildopts'], os.path.join(self.builddir, self.openfoamdir, 'Allwmake-plugins')) run_cmd(cmd_tmpl % cmd, log_all=True, simple=True, log_output=True) From e4a3ff1932350d575dffc7597435609fad6dd691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 26 Nov 2024 17:18:58 +0100 Subject: [PATCH 04/15] fix indentation --- easybuild/easyblocks/o/openfoam.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/easyblocks/o/openfoam.py b/easybuild/easyblocks/o/openfoam.py index fd9d892c7a..4ffa5e98d6 100644 --- a/easybuild/easyblocks/o/openfoam.py +++ b/easybuild/easyblocks/o/openfoam.py @@ -372,7 +372,7 @@ def build_step(self): if self.looseversion >= LooseVersion('2406'): # Also build the plugins cmd += ' && %s bash %s -log' % (self.cfg['prebuildopts'], - os.path.join(self.builddir, self.openfoamdir, 'Allwmake-plugins')) + os.path.join(self.builddir, self.openfoamdir, 'Allwmake-plugins')) run_cmd(cmd_tmpl % cmd, log_all=True, simple=True, log_output=True) From b0f4de0982a09e3af40689641eb0dbc578b3f654 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Thu, 28 Nov 2024 09:40:35 +0100 Subject: [PATCH 05/15] fix detection of math library in numpy build --- easybuild/easyblocks/n/numpy.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/easybuild/easyblocks/n/numpy.py b/easybuild/easyblocks/n/numpy.py index 968cefa919..a29dda4ded 100644 --- a/easybuild/easyblocks/n/numpy.py +++ b/easybuild/easyblocks/n/numpy.py @@ -204,6 +204,17 @@ def get_libs_for_mkl(varname): 'includes': includes, } + numpy_version = LooseVersion(self.version) + + if numpy_version < '1.26': + # NumPy detects the required math by trying to link a minimal code containing a call to `log(0.)`. + # The first try is without any libraries, which works with `gcc -fno-math-errno` (our optimization default) + # because the call gets removed due to not having any effect. So it concludes that `-lm` is not required. + # This then fails to detect availability of functions such as `acosh` which do not get removed in the same + # way and so less exact replacements are used instead which e.g. fail the tests on PPC. + # This variable makes it try `-lm` first and is supported until the Meson backend is used in 1.26+. + env.setvar('MATHLIB', 'm') + super(EB_numpy, self).configure_step() if LooseVersion(self.version) < LooseVersion('1.21'): From 259051b07ac70b65ea2815cb717c4df2550ba8c5 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Thu, 28 Nov 2024 10:52:49 +0100 Subject: [PATCH 06/15] Remove `numpy_version` variable again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jan André Reuter --- easybuild/easyblocks/n/numpy.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/easybuild/easyblocks/n/numpy.py b/easybuild/easyblocks/n/numpy.py index a29dda4ded..e1b92eca55 100644 --- a/easybuild/easyblocks/n/numpy.py +++ b/easybuild/easyblocks/n/numpy.py @@ -204,9 +204,7 @@ def get_libs_for_mkl(varname): 'includes': includes, } - numpy_version = LooseVersion(self.version) - - if numpy_version < '1.26': + if LooseVersion(self.version) < LooseVersion('1.26'): # NumPy detects the required math by trying to link a minimal code containing a call to `log(0.)`. # The first try is without any libraries, which works with `gcc -fno-math-errno` (our optimization default) # because the call gets removed due to not having any effect. So it concludes that `-lm` is not required. From d1c3e886ad9aea87e3d15fbb5eb8c7302e0a32f5 Mon Sep 17 00:00:00 2001 From: Stefan Wolfsheimer Date: Fri, 29 Nov 2024 07:57:16 +0100 Subject: [PATCH 07/15] WRF: set NETCFF env variable --- easybuild/easyblocks/w/wrf.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/easybuild/easyblocks/w/wrf.py b/easybuild/easyblocks/w/wrf.py index 3c9c76f18e..76463fcb8f 100644 --- a/easybuild/easyblocks/w/wrf.py +++ b/easybuild/easyblocks/w/wrf.py @@ -95,8 +95,10 @@ def configure_step(self): wrfdir = os.path.join(self.builddir, self.wrfsubdir) - # define $NETCDF* for netCDF dependency (used when creating WRF module file) - set_netcdf_env_vars(self.log) + set_netcdf_env_vars(self.log) + netcdf_fortran = get_software_root('NETCDFMINFORTRAN') + if netcdf_fortran: + env.setvar('NETCDFF', netcdf_fortran) # HDF5 (optional) dependency hdf5 = get_software_root('HDF5') From df15a8daa45a22694b301528842e327aa68ddafc Mon Sep 17 00:00:00 2001 From: Stefan Wolfsheimer Date: Fri, 29 Nov 2024 09:48:54 +0100 Subject: [PATCH 08/15] wps.py: set NETCDFF_DIR --- easybuild/easyblocks/w/wps.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/easybuild/easyblocks/w/wps.py b/easybuild/easyblocks/w/wps.py index 6549d493d0..73f6359899 100644 --- a/easybuild/easyblocks/w/wps.py +++ b/easybuild/easyblocks/w/wps.py @@ -106,6 +106,9 @@ def configure_step(self): wrfdir = os.path.join(wrf, det_wrf_subdir(get_software_version('WRF'))) else: raise EasyBuildError("WRF module not loaded?") + netcdf_fortran = get_software_root('NETCDFMINFORTRAN') + if netcdf_fortran: + env.setvar('NETCDFF_DIR', netcdf_fortran) self.compile_script = 'compile' From 2c6f0e3e95bddc12e9f947c5bb9275876f1bfcfb Mon Sep 17 00:00:00 2001 From: Stefan Wolfsheimer Date: Fri, 29 Nov 2024 13:52:37 +0100 Subject: [PATCH 09/15] fix PEP8 --- easybuild/easyblocks/w/wrf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/easyblocks/w/wrf.py b/easybuild/easyblocks/w/wrf.py index 76463fcb8f..696237f551 100644 --- a/easybuild/easyblocks/w/wrf.py +++ b/easybuild/easyblocks/w/wrf.py @@ -95,7 +95,7 @@ def configure_step(self): wrfdir = os.path.join(self.builddir, self.wrfsubdir) - set_netcdf_env_vars(self.log) + set_netcdf_env_vars(self.log) netcdf_fortran = get_software_root('NETCDFMINFORTRAN') if netcdf_fortran: env.setvar('NETCDFF', netcdf_fortran) From 5d1651491a5c5136bdabb3da9f792a70ca946212 Mon Sep 17 00:00:00 2001 From: Stefan Wolfsheimer Date: Fri, 29 Nov 2024 18:01:25 +0100 Subject: [PATCH 10/15] revert change to wrf.py --- easybuild/easyblocks/w/wrf.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/easybuild/easyblocks/w/wrf.py b/easybuild/easyblocks/w/wrf.py index 696237f551..3c9c76f18e 100644 --- a/easybuild/easyblocks/w/wrf.py +++ b/easybuild/easyblocks/w/wrf.py @@ -95,10 +95,8 @@ def configure_step(self): wrfdir = os.path.join(self.builddir, self.wrfsubdir) + # define $NETCDF* for netCDF dependency (used when creating WRF module file) set_netcdf_env_vars(self.log) - netcdf_fortran = get_software_root('NETCDFMINFORTRAN') - if netcdf_fortran: - env.setvar('NETCDFF', netcdf_fortran) # HDF5 (optional) dependency hdf5 = get_software_root('HDF5') From ee216590a83315ab7e6deaddcdb1030502a3e9fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Sat, 30 Nov 2024 13:43:01 +0100 Subject: [PATCH 11/15] pass the preferred host compiler to the CUDA compiler --- easybuild/easyblocks/generic/cmakemake.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/easybuild/easyblocks/generic/cmakemake.py b/easybuild/easyblocks/generic/cmakemake.py index 797a504fb2..b5bd33f250 100644 --- a/easybuild/easyblocks/generic/cmakemake.py +++ b/easybuild/easyblocks/generic/cmakemake.py @@ -328,6 +328,11 @@ def configure_step(self, srcdir=None, builddir=None): # ensure CMake uses EB python, not system or virtualenv python options.update(get_cmake_python_config_dict()) + # pass the preferred host compiler to the CUDA compiler + cuda_root = get_software_root('CUDA') + if cuda_root: + self.cfg.update('preconfigopts', 'CUDAHOSTCXX=%s' % which(os.getenv('CXX', 'g++'))) + if not self.cfg.get('allow_system_boost', False): boost_root = get_software_root('Boost') if boost_root: From 0857b9fbcab2f975408aa59623d128aa75e00d5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Mon, 2 Dec 2024 14:15:07 +0100 Subject: [PATCH 12/15] also set CMAKE_CUDA_COMPILER and CMAKE_CUDA_ARCHITECTURES --- easybuild/easyblocks/generic/cmakemake.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/easybuild/easyblocks/generic/cmakemake.py b/easybuild/easyblocks/generic/cmakemake.py index b5bd33f250..296e6f26fe 100644 --- a/easybuild/easyblocks/generic/cmakemake.py +++ b/easybuild/easyblocks/generic/cmakemake.py @@ -328,10 +328,18 @@ def configure_step(self, srcdir=None, builddir=None): # ensure CMake uses EB python, not system or virtualenv python options.update(get_cmake_python_config_dict()) - # pass the preferred host compiler to the CUDA compiler + # pass the preferred host compiler, CUDA compiler, and CUDA architectures to the CUDA compiler cuda_root = get_software_root('CUDA') if cuda_root: - self.cfg.update('preconfigopts', 'CUDAHOSTCXX=%s' % which(os.getenv('CXX', 'g++'))) + options['CMAKE_CUDA_HOST_COMPILER'] = which(os.getenv('CXX', 'g++')) + options['CMAKE_CUDA_COMPILER'] = 'nvcc' + cuda_cc = build_option('cuda_compute_capabilities') or self.cfg['cuda_compute_capabilities'] + if cuda_cc: + options['CMAKE_CUDA_ARCHITECTURES'] = '"%s"' % ';'.join([cc.replace('.', '') for cc in cuda_cc]) + else: + raise EasyBuildError('List of CUDA compute capabilities must be specified, either via ' + 'cuda_compute_capabilities easyconfig parameter or via ' + '--cuda-compute-capabilities') if not self.cfg.get('allow_system_boost', False): boost_root = get_software_root('Boost') From 90495ed23d26b3d5fd8162bf5d7b4c073a0682fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Mon, 2 Dec 2024 14:48:16 +0100 Subject: [PATCH 13/15] use absolute path for nvcc Co-authored-by: ocaisa --- easybuild/easyblocks/generic/cmakemake.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/easyblocks/generic/cmakemake.py b/easybuild/easyblocks/generic/cmakemake.py index 296e6f26fe..3f8e591cd1 100644 --- a/easybuild/easyblocks/generic/cmakemake.py +++ b/easybuild/easyblocks/generic/cmakemake.py @@ -332,7 +332,7 @@ def configure_step(self, srcdir=None, builddir=None): cuda_root = get_software_root('CUDA') if cuda_root: options['CMAKE_CUDA_HOST_COMPILER'] = which(os.getenv('CXX', 'g++')) - options['CMAKE_CUDA_COMPILER'] = 'nvcc' + options['CMAKE_CUDA_COMPILER'] = which('nvcc') cuda_cc = build_option('cuda_compute_capabilities') or self.cfg['cuda_compute_capabilities'] if cuda_cc: options['CMAKE_CUDA_ARCHITECTURES'] = '"%s"' % ';'.join([cc.replace('.', '') for cc in cuda_cc]) From b6fedfe480eb3d6642b500aa8f86ed1734ce9bce Mon Sep 17 00:00:00 2001 From: Samuel Moors Date: Fri, 13 Dec 2024 16:53:25 +0100 Subject: [PATCH 14/15] show path of output file for matlab --- easybuild/easyblocks/m/matlab.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/easybuild/easyblocks/m/matlab.py b/easybuild/easyblocks/m/matlab.py index 56475545cd..8cf8aef6e8 100644 --- a/easybuild/easyblocks/m/matlab.py +++ b/easybuild/easyblocks/m/matlab.py @@ -206,8 +206,8 @@ def install_step(self): regex.pattern, cmd, out) with open(self.outputfile) as f: if regex.search(f.read()): - raise EasyBuildError("Found error pattern '%s' in output file of installer", - regex.pattern) + raise EasyBuildError("Found error pattern '%s' in output file of installer at %s", + regex.pattern, self.outputfile) def sanity_check_step(self): """Custom sanity check for MATLAB.""" From c0b5b5b4c7e697b7f813b47b22a3da4bb9042b7e Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Wed, 18 Dec 2024 16:56:37 +0100 Subject: [PATCH 15/15] bump version to 5.0.0beta1 --- easybuild/easyblocks/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/easyblocks/__init__.py b/easybuild/easyblocks/__init__.py index dbd03779f7..5eec3996b5 100644 --- a/easybuild/easyblocks/__init__.py +++ b/easybuild/easyblocks/__init__.py @@ -42,7 +42,7 @@ # recent setuptools versions will *TRANSFORM* something like 'X.Y.Zdev' into 'X.Y.Z.dev0', with a warning like # UserWarning: Normalizing '2.4.0dev' to '2.4.0.dev0' # This causes problems further up the dependency chain... -VERSION = '5.0.0.dev0' +VERSION = '5.0.0beta1' UNKNOWN = 'UNKNOWN'