diff --git a/easybuild/easyblocks/g/gromacs.py b/easybuild/easyblocks/g/gromacs.py index e1b49b557d..bb7c5137e6 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': [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], 'mpiexec_numproc_flag': ['-np', "Flag to introduce the number of MPI tasks when running tests", CUSTOM], @@ -745,10 +747,15 @@ def run_all_steps(self, *args, **kwargs): 'mpi': 'install' } - precisions = ['single'] + precisions = [] + 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') + 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') diff --git a/easybuild/easyblocks/generic/cmakemake.py b/easybuild/easyblocks/generic/cmakemake.py index 5465bff70d..b9208d2d40 100644 --- a/easybuild/easyblocks/generic/cmakemake.py +++ b/easybuild/easyblocks/generic/cmakemake.py @@ -349,6 +349,19 @@ 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, CUDA compiler, and CUDA architectures to the CUDA compiler + cuda_root = get_software_root('CUDA') + if cuda_root: + options['CMAKE_CUDA_HOST_COMPILER'] = which(os.getenv('CXX', 'g++')) + 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]) + 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') if boost_root: diff --git a/easybuild/easyblocks/m/matlab.py b/easybuild/easyblocks/m/matlab.py index 97263b0b86..bcf2f3eb4c 100644 --- a/easybuild/easyblocks/m/matlab.py +++ b/easybuild/easyblocks/m/matlab.py @@ -205,8 +205,8 @@ def install_step(self): regex.pattern, cmd, res.output) 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.""" diff --git a/easybuild/easyblocks/n/numpy.py b/easybuild/easyblocks/n/numpy.py index 50ee42c76c..4b8dbfe86c 100644 --- a/easybuild/easyblocks/n/numpy.py +++ b/easybuild/easyblocks/n/numpy.py @@ -204,6 +204,15 @@ def get_libs_for_mkl(varname): 'includes': includes, } + 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. + # 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'): diff --git a/easybuild/easyblocks/o/openfoam.py b/easybuild/easyblocks/o/openfoam.py index efeb53a126..52f31aa8df 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,8 +371,8 @@ def build_step(self): if self.looseversion >= LooseVersion('2406'): # Also build the plugins - cmd += ' && %s %s -log' % (self.cfg['prebuildopts'], - os.path.join(self.builddir, self.openfoamdir, 'Allwmake-plugins')) + cmd += ' && %s bash %s -log' % (self.cfg['prebuildopts'], + os.path.join(self.builddir, self.openfoamdir, 'Allwmake-plugins')) run_shell_cmd(cmd_tmpl % cmd) diff --git a/easybuild/easyblocks/w/wps.py b/easybuild/easyblocks/w/wps.py index 1643582692..762105613c 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'