Skip to content

Commit

Permalink
Merge pull request #3367 from boegel/5.0.x
Browse files Browse the repository at this point in the history
sync with develop (20240619)
  • Loading branch information
Micket authored Jun 19, 2024
2 parents 4533001 + 5d63396 commit a3ec684
Show file tree
Hide file tree
Showing 10 changed files with 114 additions and 15 deletions.
29 changes: 28 additions & 1 deletion RELEASE_NOTES
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,34 @@ For more detailed information, please see the git log.

These release notes can also be consulted at http://easybuild.readthedocs.org/en/latest/Release_notes.html.

The latest version of easybuild-easyblocks provides 255 software-specific easyblocks and 43 generic easyblocks.
The latest version of easybuild-easyblocks provides 259 software-specific easyblocks and 43 generic easyblocks.


v4.9.2 (12 June 2024)
---------------------

update/bugfix release

- 4 new software-specific easyblocks: QuantumESPRESSO with CMake (#3257), AEDT (#3281), optiSLang (#3300), MetalWalls (#3311, #3331)
- minor enhancements and updates, including:
- refactor GAMESS-US easyblock to directly write install.info (#3047)
- add ABAQUS license server to generated module (#3277)
- allow 'nosource: True' in PythonPackage extensions (#3305)
- auto-disable FFTW quad precision on RISC-V (#3314)
- use regular 'configure' instead of wrapper script in easyblock for UCX plugins (#3315)
- add libjpeg-turbo to include dir for torchvision easyblock (#3322, #3353)
- add RISC-V support to custom easyblocks for Clang (#3325), Java (#3323), Mesa (#3324)
- add a sanity check for OpenFOAM's 'wmake' to make sure it finds the compiler commands (#3328)
- always override the compiler version check for CUDA installations (#3329)
- allow version mismatchs between OpenSSL components in host system as long as they fulfill version requirements (#3340)
- allow external PRRTE in OpenMPI easyblock (#3347)
- various bug fixes, including:
- don't manipulate setup.py for Python 3.12+ when using alternate sysroot (#3313)
- do not run unit tests on Python 3.5 (#3326)
- avoid sanity check on the software itself for CargoPythonBundle easyblock (#3341)
- fix malformed '$CPATH' for intel-compilers on Debian/Ubuntu (#3346)
- other changes:
- Binary easyblock already adds top level directory to PATH, so no need to do it in the Stata easyblock (#3307)


v4.9.1 (5 April 2024)
Expand Down
8 changes: 8 additions & 0 deletions easybuild/easyblocks/c/cuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,14 @@ def install_step(self):
# Use C locale to avoid localized questions and crash on CUDA 10.1
self.cfg.update('preinstallopts', "export LANG=C && ")

# As a CUDA recipe gets older and the OS gets updated, it is
# likely that the system GCC becomes too new for the CUDA version.
# Since in EasyBuild we know/expect that CUDA will only ever get used
# as a dependency within the context of a toolchain, we can override
# the compiler version check that would cause the installation to
# fail.
self.cfg.update('installopts', "--override")

cmd = "%(preinstallopts)s %(interpreter)s %(script)s %(installopts)s" % {
'preinstallopts': self.cfg['preinstallopts'],
'interpreter': install_interpreter,
Expand Down
5 changes: 4 additions & 1 deletion easybuild/easyblocks/e/easybuildmeta.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ def install_step(self):
try:
subdirs = os.listdir(self.builddir)
for pkg in self.easybuild_pkgs:
seldirs = [x for x in subdirs if x.startswith(pkg)]
# also consider "normalized" package name, with dashes ('-') replaced by underscores ('_'),
# which is being enforced by recent versions of setuptools (>= 69.0.3?)
pkg_norm = pkg.replace('-', '_')
seldirs = [x for x in subdirs if x.startswith(pkg) or x.startswith(pkg_norm)]
if len(seldirs) != 1:
# setuptools is optional since it may be available in the OS;
# vsc-install and vsc-base sources are optional,
Expand Down
4 changes: 4 additions & 0 deletions easybuild/easyblocks/generic/cargopythonbundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ def __init__(self, *args, **kwargs):
self.check_for_sources = False # make Bundle allow sources (as crates are treated as sources)
super(CargoPythonBundle, self).__init__(*args, **kwargs)

# Cargo inherits from ExtensionEasyBlock, thus EB treats the software itself as an extension
# Setting modulename to False to ensure that sanity checks are performed on the extensions only
self.options = {'modulename': False}

def extract_step(self):
"""Specifically use the overloaded variant from Cargo as is populates vendored sources with checksums."""
return Cargo.extract_step(self)
7 changes: 6 additions & 1 deletion easybuild/easyblocks/i/intel_compilers.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,12 @@ def make_module_extra(self):
res = run_shell_cmd("gcc -print-multiarch")
multiarch_out = res.output.strip()
if res.exit_code == 0 and multiarch_out:
res = run_shell_cmd("gcc -E -Wp,-v -xc /dev/null 2>&1 | grep %s$" % multiarch_out)
multi_arch_inc_dir_cmd = '|'.join([
"gcc -E -Wp,-v -xc /dev/null 2>&1",
"grep %s$" % multiarch_out,
"grep -v /include-fixed/",
])
res = run_shell_cmd(multi_arch_inc_dir_cmd)
multiarch_inc_dir = res.output.strip()
if res.exit_code == 0 and multiarch_inc_dir:
self.log.info("Adding multiarch include path %s to $CPATH in generated module file", multiarch_inc_dir)
Expand Down
25 changes: 24 additions & 1 deletion easybuild/easyblocks/o/openfoam.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,15 @@
import shutil
import stat
import tempfile
import textwrap
from easybuild.tools import LooseVersion

import easybuild.tools.environment as env
import easybuild.tools.toolchain as toolchain
from easybuild.easyblocks.generic.cmakemake import setup_cmake_env
from easybuild.framework.easyblock import EasyBlock
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.filetools import adjust_permissions, apply_regex_substitutions, mkdir
from easybuild.tools.filetools import adjust_permissions, apply_regex_substitutions, mkdir, write_file
from easybuild.tools.modules import get_software_root, get_software_version
from easybuild.tools.run import run_shell_cmd
from easybuild.tools.systemtools import get_shared_lib_ext, get_cpu_architecture, AARCH64, POWER
Expand Down Expand Up @@ -293,6 +294,23 @@ def configure_step(self):
else:
env.setvar("%s_ROOT" % depend.upper(), dependloc)

if get_software_root('CGAL') and LooseVersion(get_software_version('CGAL')) >= LooseVersion('5.0'):
# CGAL >= 5.x is header-only, but when using it OpenFOAM still needs MPFR.
# It may fail to find it, so inject the right settings and paths into the "have_cgal" script.
have_cgal_script = os.path.join(self.builddir, self.openfoamdir, 'wmake', 'scripts', 'have_cgal')
if get_software_root('MPFR') and os.path.exists(have_cgal_script):
eb_cgal_config = textwrap.dedent('''
# Injected by EasyBuild
HAVE_CGAL=true
HAVE_MPFR=true
CGAL_FLAVOUR=header
CGAL_INC_DIR=${EBROOTCGAL}/include
CGAL_LIB_DIR=${EBROOTCGAL}/lib
MPFR_INC_DIR=${EBROOTMPFR}/include
MPFR_LIB_DIR=${EBROOTMPFR}/lib
''')
write_file(have_cgal_script, eb_cgal_config, append=True)

def build_step(self):
"""Build OpenFOAM using make after sourcing script to set environment."""

Expand Down Expand Up @@ -486,6 +504,11 @@ def sanity_check_step(self):
test_foammonitor = "! foamMonitor -h 2>&1 | grep 'not installed'"
custom_commands.append(' && '.join([load_openfoam_env, test_foammonitor]))

if self.is_dot_com and self.looseversion >= LooseVersion("2012"):
# Make sure that wmake can see the compilers
test_wmake_compilers = ["command -V $(wmake -show-cxx)", "command -V $(wmake -show-c)"]
custom_commands.append(' && '.join([load_openfoam_env] + test_wmake_compilers))

custom_paths = {
'files': [os.path.join(self.openfoamdir, 'etc', x) for x in ["bashrc", "cshrc"]] + bins + libs,
'dirs': dirs,
Expand Down
6 changes: 5 additions & 1 deletion easybuild/easyblocks/o/openmpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,11 @@ def sanity_check_step(self):
if build_option('mpi_tests'):
params.update({'nr_ranks': ranks, 'cmd': test_exe})
# Allow oversubscription for this test (in case of hyperthreading)
custom_commands.append("OMPI_MCA_rmaps_base_oversubscribe=1 " + mpi_cmd_tmpl % params)
if LooseVersion(self.version) >= '5.0':
extra_env = "PRTE_MCA_rmaps_default_mapping_policy=:oversubscribe"
else:
extra_env = "OMPI_MCA_rmaps_base_oversubscribe=1"
custom_commands.append(extra_env + " " + mpi_cmd_tmpl % params)
# Run with 1 process which may trigger other bugs
# See https://github.com/easybuilders/easybuild-easyconfigs/issues/12978
params['nr_ranks'] = 1
Expand Down
6 changes: 5 additions & 1 deletion easybuild/easyblocks/o/openssl_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@
import os
import re

from urllib.parse import urlparse
try:
from urllib.parse import urlparse
except ImportError:
# fallback for Python 2.7, should be removed for EasyBuild >= 5.0
from urlparse import urlparse

from easybuild.tools import LooseVersion

Expand Down
3 changes: 2 additions & 1 deletion easybuild/easyblocks/p/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,9 @@ def patch_step(self, *args, **kwargs):
# if we're installing Python with an alternate sysroot,
# we need to patch setup.py which includes hardcoded paths like /usr/include and /lib64;
# this fixes problems like not being able to build the _ssl module ("Could not build the ssl module")
# Python 3.12 doesn't have setup.py any more
sysroot = build_option('sysroot')
if sysroot:
if sysroot and LooseVersion(self.version) < LooseVersion('3.12'):
sysroot_inc_dirs, sysroot_lib_dirs = [], []

for pattern in ['include*', os.path.join('usr', 'include*')]:
Expand Down
36 changes: 28 additions & 8 deletions easybuild/easyblocks/t/torchvision.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@
@author: Alexander Grund (TU Dresden)
@author: Kenneth Hoste (HPC-UGent)
"""
import os

from easybuild.easyblocks.generic.pythonpackage import PythonPackage, det_pylibdir
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.config import build_option
from easybuild.tools.modules import get_software_version
from easybuild.tools.modules import get_software_version, get_software_root
import easybuild.tools.environment as env


Expand Down Expand Up @@ -69,18 +71,30 @@ def configure_step(self):
if cuda_cc:
env.setvar('TORCH_CUDA_ARCH_LIST', ';'.join(cuda_cc))

libjpeg_root = get_software_root('libjpeg-turbo')
if libjpeg_root and 'TORCHVISION_INCLUDE' not in self.cfg['preinstallopts']:
env.setvar('TORCHVISION_INCLUDE', os.path.join(libjpeg_root, 'include'))

super(EB_torchvision, self).configure_step()

def sanity_check_step(self):
"""Custom sanity check for torchvision."""
custom_commands = None
custom_paths = None

# load module early ourselves rather than letting parent sanity_check_step method do so,
# so the correct 'python' command is used to by det_pylibdir() below;
if hasattr(self, 'sanity_check_module_loaded') and not self.sanity_check_module_loaded:
self.fake_mod_data = self.sanity_check_load_module(extension=self.is_extension)

custom_commands = []
custom_paths = {
'files': [],
'dirs': [det_pylibdir()],
}

# check whether torchvision was indeed built with CUDA support,
# cfr. https://discuss.pytorch.org/t/notimplementederror-could-not-run-torchvision-nms-with-arguments-from-\
# the-cuda-backend-this-could-be-because-the-operator-doesnt-exist-for-this-backend/132352/4
if self.with_cuda:
custom_commands = []
python_code = '\n'.join([
"import torch, torchvision",
"if torch.cuda.device_count():",
Expand All @@ -89,9 +103,15 @@ def sanity_check_step(self):
" print(torchvision.ops.nms(boxes, scores, 0.5))",
])
custom_commands.append('python -c "%s"' % python_code)
custom_paths = {
'files': [],
'dirs': [det_pylibdir()],
}

if get_software_root('libjpeg-turbo'):
# check if torchvision was built with libjpeg support
# if not, will show error "RuntimeError: encode_jpeg: torchvision not compiled with libjpeg support"
python_code = '\n'.join([
"import torch, torchvision",
"image_tensor = torch.zeros(1, 1, 1, dtype=torch.uint8)",
"print(torchvision.io.image.encode_jpeg(image_tensor))",
])
custom_commands.append('python -c "%s"' % python_code)

return super(EB_torchvision, self).sanity_check_step(custom_commands=custom_commands, custom_paths=custom_paths)

0 comments on commit a3ec684

Please sign in to comment.