Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync with develop (20240923) #3459

Merged
merged 37 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
92bb54f
Ignore Python from virtualenvs in GROMACS configure
Flamefire Apr 5, 2024
e6828f9
Remove blank line
Flamefire Apr 5, 2024
1a16588
Merge branch 'easybuilders:develop' into 20240405162525_new_pr_gromacs
Flamefire Jun 6, 2024
7fd6e9d
allow specifying a max version for the system python in pythonpackage…
Sep 4, 2024
fdf535b
Fix implementation of max_py_majver and max_py_minver in pythonpackag…
Sep 4, 2024
944872c
Fix hound issues
Sep 4, 2024
1d24517
Formatting
Sep 4, 2024
2194e64
Fix more formatting issues
Sep 4, 2024
7256a1c
Fix more formatting issues
Sep 4, 2024
8f2244f
Fix indent
Sep 4, 2024
beb99f5
Fix indent
Sep 4, 2024
40020d2
Add missing colon
Sep 4, 2024
debc72e
Renamed parameters to match argument names
Sep 4, 2024
1a6802b
Fix https://github.com/easybuilders/easybuild-easyblocks/pull/3430/fi…
Sep 5, 2024
191a691
Initialize variables, so that they are present when we check for them
Sep 5, 2024
4525a76
Move the complicated error reporting within the 'python is None' bloc…
Sep 5, 2024
9999bf1
Pull error inside block that is executed when using system python
Sep 5, 2024
1c2947c
Merge branch 'develop' into allow_specifying_max_python_ver_system_to…
bedroge Sep 6, 2024
d552094
No need to initialize the req/max python version variables
bedroge Sep 6, 2024
1a23bf3
Rephrase debug message
bedroge Sep 6, 2024
1e6f773
add two tests for pick_python_cmd that use max_py_majver and max_py_m…
bedroge Sep 6, 2024
0c5cc9d
deliberately try to break a test
bedroge Sep 6, 2024
53778ed
this indeed broke the test, so revert it
bedroge Sep 6, 2024
efddeb0
Merge pull request #4 from bedroge/tests_max_python_ver
casparvl Sep 16, 2024
6ca8a9e
GCC: Fix NVPTX mapping error when with no CC
Thyre Sep 16, 2024
652a532
Merge pull request #3449 from Thyre/gcc-fix-nvptx-mapping
branfosj Sep 16, 2024
1ca6dc3
Merge pull request #3431 from casparvl/allow_specifying_max_python_ve…
bedroge Sep 17, 2024
3040e10
Merge pull request #3283 from Flamefire/20240405162525_new_pr_gromacs
ocaisa Sep 18, 2024
012324e
add licence to NCCL installation
Sep 19, 2024
9193996
Merge pull request #3451 from laraPPr/NCCL
boegel Sep 19, 2024
2e19a28
prepare release notes for EasyBuild v4.9.4 + bump version to 4.9.4
boegel Sep 22, 2024
15e8d51
Merge pull request #3455 from boegel/eb494
jfgrimm Sep 22, 2024
601fe2c
Merge pull request #3456 from easybuilders/4.9.x
boegel Sep 22, 2024
1e6b9b3
bump version to 4.9.5dev
boegel Sep 22, 2024
81e08f1
Update RELEASE_NOTES
verdurin Sep 22, 2024
5cdeaef
Merge pull request #3457 from boegel/develop
verdurin Sep 22, 2024
3325301
Merge branch 'develop' into 5.0.x
boegel Sep 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions RELEASE_NOTES
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,25 @@ These release notes can also be consulted at http://easybuild.readthedocs.org/en
The latest version of easybuild-easyblocks provides 259 software-specific easyblocks and 43 generic easyblocks.


v4.9.4 (22 September 2024)
--------------------------

update/bugfix release

- various enhancements, including:
- allow Python bundles and packages to specify a maximum Python version for the system toolchain (#3431)
- copy EasyConfig instance in constructor of Bundle and Cargo easyblocks before making changes to it (#3448)
- fix crash in GCC easyblock when cuda-compute-capabilities EasyBuild configuration option is not set (#3449)
- various bug fixes, including:
- ignore Python from virtualenvs in GROMACS configure via -DPython3_FIND_VIRTUALENV=STANDARD (#3283)
- enhance custom easyblock for NCCL: add licence to NCCL installation (#3451)


v4.9.3 (14 September 2024)
--------------------------

update/bugfix release

- minor updates, including:
- update custom easyblock for Tensorflow for versions 2.14 + 2.15 (#3303)
- add support for versions >= 2024a to MCR easyblock (#3369)
Expand Down
2 changes: 1 addition & 1 deletion easybuild/easyblocks/g/gcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def map_nvptx_capability(self):
architecture_mappings_replacement = "misa=,"

# Determine which compute capabilities are configured. If there are none, return immediately.
if cuda_cc_list is None:
if not cuda_cc_list:
return None
cuda_sm_list = [f"sm_{cc.replace('.', '')}" for cc in cuda_cc_list]

Expand Down
35 changes: 21 additions & 14 deletions easybuild/easyblocks/g/gromacs.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ def prepare_step(self, *args, **kwargs):
def configure_step(self):
"""Custom configuration procedure for GROMACS: set configure options for configure or cmake."""

if LooseVersion(self.version) >= LooseVersion('4.6'):
gromacs_version = LooseVersion(self.version)

if gromacs_version >= '4.6':
cuda = get_software_root('CUDA')
if cuda:
# CUDA with double precision is currently not supported in GROMACS yet
Expand All @@ -188,10 +190,11 @@ def configure_step(self):
self.log.info("skipping configure step")
return

if LooseVersion(self.version) >= LooseVersion('2021'):
self.cfg.update('configopts', "-DGMX_GPU=CUDA -DCUDA_TOOLKIT_ROOT_DIR=%s" % cuda)
if gromacs_version >= '2021':
self.cfg.update('configopts', "-DGMX_GPU=CUDA")
else:
self.cfg.update('configopts', "-DGMX_GPU=ON -DCUDA_TOOLKIT_ROOT_DIR=%s" % cuda)
self.cfg.update('configopts', "-DGMX_GPU=ON")
self.cfg.update('configopts', "-DCUDA_TOOLKIT_ROOT_DIR=%s" % cuda)

# Set CUDA capabilities based on template value.
if '-DGMX_CUDA_TARGET_SM' not in self.cfg['configopts']:
Expand Down Expand Up @@ -237,14 +240,14 @@ def configure_step(self):
# Ensure that the GROMACS log files report how the code was patched
# during the build, so that any problems are easier to diagnose.
# The GMX_VERSION_STRING_OF_FORK feature is available since 2020.
if (LooseVersion(self.version) >= LooseVersion('2020') and
if (gromacs_version >= '2020' and
'-DGMX_VERSION_STRING_OF_FORK=' not in self.cfg['configopts']):
gromacs_version_string_suffix = 'EasyBuild-%s' % EASYBUILD_VERSION
if plumed_root:
gromacs_version_string_suffix += '-PLUMED-%s' % get_software_version('PLUMED')
self.cfg.update('configopts', '-DGMX_VERSION_STRING_OF_FORK=%s' % gromacs_version_string_suffix)

if LooseVersion(self.version) < LooseVersion('4.6'):
if gromacs_version < '4.6':
self.log.info("Using configure script for configuring GROMACS build.")

if self.cfg['build_shared_libs']:
Expand All @@ -260,7 +263,7 @@ def configure_step(self):
self.cfg.update('configopts', "--without-x")

# OpenMP is not supported for versions older than 4.5.
if LooseVersion(self.version) >= LooseVersion('4.5'):
if gromacs_version >= '4.5':
# enable OpenMP support if desired
if self.toolchain.options.get('openmp', None):
self.cfg.update('configopts', "--enable-threads")
Expand Down Expand Up @@ -311,22 +314,26 @@ def configure_step(self):
mpiexec_path, self.cfg.get('mpiexec_numproc_flag'),
mpi_numprocs)

if LooseVersion(self.version) >= LooseVersion('2019'):
if gromacs_version >= '2019':
# Building the gmxapi interface requires shared libraries,
# this is handled in the class initialisation so --module-only works
self.cfg.update('configopts', "-DGMXAPI=ON")

if LooseVersion(self.version) >= LooseVersion('2020'):
if gromacs_version >= '2020':
# build Python bindings if Python is loaded as a dependency
python_root = get_software_root('Python')
if python_root:
self.cfg.update('configopts', "-DGMX_PYTHON_PACKAGE=ON")
bin_python = os.path.join(python_root, 'bin', 'python')
# For find_package(PythonInterp)
self.cfg.update('configopts', "-DPYTHON_EXECUTABLE=%s" % bin_python)
self.cfg.update('configopts', "-DGMX_PYTHON_PACKAGE=ON")
if gromacs_version >= '2021':
# For find_package(Python3) - Ignore virtual envs
self.cfg.update('configopts', "-DPython3_FIND_VIRTUALENV=STANDARD")

# Now patch GROMACS for PLUMED before cmake
if plumed_root:
if LooseVersion(self.version) >= LooseVersion('5.1'):
if gromacs_version >= '5.1':
# Use shared or static patch depending on
# setting of self.cfg['build_shared_libs']
# and adapt cmake flags accordingly as per instructions
Expand Down Expand Up @@ -356,7 +363,7 @@ def configure_step(self):
if self.toolchain.toolchain_family() != toolchain.CRAYPE:
gmx_simd = self.get_gromacs_arch()
if gmx_simd:
if LooseVersion(self.version) < LooseVersion('5.0'):
if gromacs_version < '5.0':
self.cfg.update('configopts', "-DGMX_CPU_ACCELERATION=%s" % gmx_simd)
else:
self.cfg.update('configopts', "-DGMX_SIMD=%s" % gmx_simd)
Expand Down Expand Up @@ -405,7 +412,7 @@ def configure_step(self):
env.setvar('LDFLAGS', "%s -lgfortran -lm" % os.environ.get('LDFLAGS', ''))

# no more GSL support in GROMACS 5.x, see http://redmine.gromacs.org/issues/1472
if LooseVersion(self.version) < LooseVersion('5.0'):
if gromacs_version < '5.0':
# enable GSL when it's provided
if get_software_root('GSL'):
self.cfg.update('configopts', "-DGMX_GSL=ON")
Expand All @@ -425,7 +432,7 @@ def configure_step(self):
out = super(EB_GROMACS, self).configure_step()

# for recent GROMACS versions, make very sure that a decent BLAS, LAPACK and FFT is found and used
if LooseVersion(self.version) >= LooseVersion('4.6.5'):
if gromacs_version >= '4.6.5':
patterns = [
r"Using external FFT library - \S*",
r"Looking for dgemm_ - found",
Expand Down
10 changes: 8 additions & 2 deletions easybuild/easyblocks/generic/pythonbundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,21 @@ def prepare_step(self, *args, **kwargs):
if req_py_minver is None:
req_py_minver = sys.version_info[1]

python_cmd = pick_python_cmd(req_maj_ver=req_py_majver, req_min_ver=req_py_minver)
# Get the max_py_majver and max_py_minver from the config
max_py_majver = self.cfg['max_py_majver']
max_py_minver = self.cfg['max_py_minver']

python_cmd = pick_python_cmd(req_maj_ver=req_py_majver, req_min_ver=req_py_minver,
max_py_majver=max_py_majver, max_py_minver=max_py_minver)

# If pick_python_cmd didn't find a (system) Python command, we should raise an error
if python_cmd:
self.log.info("Python command being used: %s", python_cmd)
else:
raise EasyBuildError(
"Failed to pick Python command that satisfies requirements in the easyconfig "
"(req_py_majver = %s, req_py_minver = %s)", req_py_majver, req_py_minver
"(req_py_majver = %s, req_py_minver = %s, max_py_majver = %s, max_py_minver = %s)",
req_py_majver, req_py_minver, max_py_majver, max_py_minver
)

self.all_pylibdirs = get_pylibdirs(python_cmd=python_cmd)
Expand Down
31 changes: 27 additions & 4 deletions easybuild/easyblocks/generic/pythonpackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def det_python_version(python_cmd):
return res.output.strip()


def pick_python_cmd(req_maj_ver=None, req_min_ver=None):
def pick_python_cmd(req_maj_ver=None, req_min_ver=None, max_py_majver=None, max_py_minver=None):
"""
Pick 'python' command to use, based on specified version requirements.
If the major version is specified, it must be an exact match (==).
Expand Down Expand Up @@ -129,6 +129,20 @@ def check_python_cmd(python_cmd):
log.debug("Minimal requirement for minor Python version not satisfied: %s vs %s", pyver, req_majmin_ver)
return False

if max_py_majver is not None:
if max_py_minver is None:
max_majmin_ver = '%s.0' % max_py_majver
else:
max_majmin_ver = '%s.%s' % (max_py_majver, max_py_minver)

pyver = det_python_version(python_cmd)

if LooseVersion(pyver) > LooseVersion(max_majmin_ver):
log.debug("Python version (%s) on the system is newer than the maximum supported "
"Python version specified in the easyconfig (%s)",
pyver, max_majmin_ver)
return False

# all check passed
log.debug("All check passed for Python command '%s'!", python_cmd)
return True
Expand Down Expand Up @@ -348,6 +362,8 @@ def extra_options(extra_vars=None):
"Enabled by default if the EB option --debug is used.", CUSTOM],
'req_py_majver': [None, "Required major Python version (only relevant when using system Python)", CUSTOM],
'req_py_minver': [None, "Required minor Python version (only relevant when using system Python)", CUSTOM],
'max_py_majver': [None, "Maximum major Python version (only relevant when using system Python)", CUSTOM],
'max_py_minver': [None, "Maximum minor Python version (only relevant when using system Python)", CUSTOM],
'sanity_pip_check': [True, "Run 'python -m pip check' to ensure all required Python packages are "
"installed and check for any package with an invalid (0.0.0) version.", CUSTOM],
'runtest': [True, "Run unit tests.", CUSTOM], # overrides default
Expand Down Expand Up @@ -509,18 +525,25 @@ def prepare_python(self):
if req_py_minver is None:
req_py_minver = sys.version_info[1]

# Get the max_py_majver and max_py_minver from the config
max_py_majver = self.cfg['max_py_majver']
max_py_minver = self.cfg['max_py_minver']

# if using system Python, go hunting for a 'python' command that satisfies the requirements
python = pick_python_cmd(req_maj_ver=req_py_majver, req_min_ver=req_py_minver)
python = pick_python_cmd(req_maj_ver=req_py_majver, req_min_ver=req_py_minver,
max_py_majver=max_py_majver, max_py_minver=max_py_minver)

# Check if we have Python by now. If not, and if self.require_python, raise a sensible error
if python:
self.python_cmd = python
self.log.info("Python command being used: %s", self.python_cmd)
elif self.require_python:
if req_py_majver is not None or req_py_minver is not None:
if (req_py_majver is not None or req_py_minver is not None
or max_py_majver is not None or max_py_minver is not None):
raise EasyBuildError(
"Failed to pick Python command that satisfies requirements in the easyconfig "
"(req_py_majver = %s, req_py_minver = %s)", req_py_majver, req_py_minver
"(req_py_majver = %s, req_py_minver = %s, max_py_majver = %s, max_py_minver = %s)",
req_py_majver, req_py_minver, max_py_majver, max_py_minver
)
else:
raise EasyBuildError("Failed to pick Python command to use")
Expand Down
6 changes: 6 additions & 0 deletions easybuild/easyblocks/n/nccl.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,14 @@
EasyBuild support for building NCCL, implemented as an easyblock

@author: Simon Branford (University of Birmingham)
@author: Lara Peeters (Gent University)
"""
import os

from easybuild.easyblocks.generic.configuremake import ConfigureMake
from easybuild.tools.config import build_option
from easybuild.tools.systemtools import get_shared_lib_ext
from easybuild.tools.filetools import copy_file


class EB_NCCL(ConfigureMake):
Expand Down Expand Up @@ -67,6 +71,8 @@ def install_step(self):
"""Install NCCL"""
self.cfg.update('installopts', "PREFIX=%s" % self.installdir)

copy_file(os.path.join(self.cfg['start_dir'], 'LICENSE.txt'), os.path.join(self.installdir, 'LICENSE.txt'))

super(EB_NCCL, self).install_step()

def sanity_check_step(self):
Expand Down
2 changes: 2 additions & 0 deletions test/easyblocks/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ def test_pythonpackage_pick_python_cmd(self):
self.assertTrue(pick_python_cmd(3) is not None)
self.assertTrue(pick_python_cmd(3, 6) is not None)
self.assertTrue(pick_python_cmd(123, 456) is None)
self.assertTrue(pick_python_cmd(2, 6, 123, 456) is not None)
self.assertTrue(pick_python_cmd(2, 6, 1, 1) is None)


def template_module_only_test(self, easyblock, name, version='1.3.2', extra_txt='', tmpdir=None):
Expand Down
Loading