Skip to content

Commit

Permalink
Merge branch 'develop' into 5.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
boegel committed Dec 18, 2024
2 parents 9b92197 + c222061 commit 82effda
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 6 deletions.
9 changes: 8 additions & 1 deletion easybuild/easyblocks/g/gromacs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down Expand Up @@ -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')
Expand Down
13 changes: 13 additions & 0 deletions easybuild/easyblocks/generic/cmakemake.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions easybuild/easyblocks/m/matlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down
9 changes: 9 additions & 0 deletions easybuild/easyblocks/n/numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Expand Down
6 changes: 3 additions & 3 deletions easybuild/easyblocks/o/openfoam.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down Expand Up @@ -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)

Expand Down
3 changes: 3 additions & 0 deletions easybuild/easyblocks/w/wps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down

0 comments on commit 82effda

Please sign in to comment.