Skip to content

Commit

Permalink
Merge pull request easybuilders#3401 from boegel/5.0.x
Browse files Browse the repository at this point in the history
sync with develop (20240802)
  • Loading branch information
Micket authored Aug 11, 2024
2 parents a3ec684 + aa994b0 commit 2ddd9fd
Show file tree
Hide file tree
Showing 21 changed files with 1,672 additions and 1,281 deletions.
17 changes: 9 additions & 8 deletions easybuild/easyblocks/a/ansys.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,17 @@ def __init__(self, *args, **kwargs):

def install_step(self):
"""Custom install procedure for ANSYS."""
licserv = self.cfg['license_server']
if licserv is None:
licserv = os.getenv('EB_ANSYS_LICENSE_SERVER', 'license.example.com')
licport = self.cfg['license_server_port']
if licport is None:
licport = os.getenv('EB_ANSYS_LICENSE_SERVER_PORT', '2325:1055')

# Sources (e.g. iso files) may drop the execute permissions
adjust_permissions('INSTALL', stat.S_IXUSR)
cmd = "./INSTALL -silent -install_dir %s -licserverinfo %s:%s" % (self.installdir, licport, licserv)

cmd = "./INSTALL -silent -install_dir %s" % self.installdir
# E.g. license.example.com or license1.example.com,license2.example.com
licserv = self.cfg.get('license_server', os.getenv('EB_ANSYS_LICENSE_SERVER'))
# E.g. '2325:1055' or just ':' to use those defaults
licport = self.cfg.get('license_server_port', os.getenv('EB_ANSYS_LICENSE_SERVER_PORT'))
if licserv is not None and licport is not None:
cmd += ' -licserverinfo %s:%s' % (licport, licserv)

run_shell_cmd(cmd)

adjust_permissions(self.installdir, stat.S_IWOTH, add=False)
Expand Down
6 changes: 5 additions & 1 deletion easybuild/easyblocks/b/bazel.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,11 @@ def configure_step(self):
# We want to enforce it using the JDK we provided via modules
# This is required for Power where Bazel does not have a JDK, but requires it for building itself
# See https://github.com/bazelbuild/bazel/issues/10377
bazel_args += ' --host_javabase=@local_jdk//:jdk'
if LooseVersion(self.version) >= LooseVersion('7.0'):
# Option changed in Bazel 7.x, see https://github.com/bazelbuild/bazel/issues/22789
bazel_args += ' --tool_java_runtime_version=local_jdk'
else:
bazel_args += ' --host_javabase=@local_jdk//:jdk'

# Link C++ libs statically, see https://github.com/bazelbuild/bazel/issues/4137
static = self.cfg['static']
Expand Down
4 changes: 3 additions & 1 deletion easybuild/easyblocks/b/boost.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
from easybuild.tools.filetools import apply_regex_substitutions, read_file, symlink, which, 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 AARCH64, POWER, UNKNOWN
from easybuild.tools.systemtools import AARCH64, POWER, RISCV64, UNKNOWN
from easybuild.tools.systemtools import get_cpu_architecture, get_glibc_version, get_shared_lib_ext


Expand Down Expand Up @@ -326,6 +326,8 @@ def sanity_check_step(self):
lib_mt_suffix += '-a64'
elif get_cpu_architecture() == POWER:
lib_mt_suffix += '-p64'
elif get_cpu_architecture() == RISCV64:
lib_mt_suffix += '-r64'
else:
lib_mt_suffix += '-x64'

Expand Down
7 changes: 6 additions & 1 deletion easybuild/easyblocks/e/esmf.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ def make_module_extra(self):
"""Add install path to PYTHONPATH or EBPYTHONPREFIXES"""
txt = super(EB_ESMF, self).make_module_extra()

# set environment variable ESMFMKFILE
# see section 9.9 in https://earthsystemmodeling.org/docs/release/latest/ESMF_usrdoc/node10.html
esmf_mkfile_path = os.path.join(self.installdir, "lib", "esmf.mk")
txt += self.module_generator.set_environment('ESMFMKFILE', esmf_mkfile_path)

if self.cfg['multi_deps'] and 'Python' in self.cfg['multi_deps']:
txt += self.module_generator.prepend_paths('EBPYTHONPREFIXES', '')
else:
Expand All @@ -172,7 +177,7 @@ def sanity_check_step(self):
binaries = ['ESMF_PrintInfo', 'ESMF_PrintInfoC', 'ESMF_Regrid', 'ESMF_RegridWeightGen',
'ESMF_Scrip2Unstruct', 'ESMF_WebServController']

libs = ['libesmf.a', 'libesmf.%s' % get_shared_lib_ext()]
libs = ['esmf.mk', 'libesmf.a', 'libesmf.%s' % get_shared_lib_ext()]
custom_paths = {
'files': [os.path.join('bin', x) for x in binaries] + [os.path.join('lib', x) for x in libs],
'dirs': ['include', 'mod'],
Expand Down
36 changes: 28 additions & 8 deletions easybuild/easyblocks/e/extrae.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@

from easybuild.easyblocks.generic.configuremake import ConfigureMake
from easybuild.tools.modules import get_software_root
from easybuild.tools import LooseVersion
from easybuild.tools.systemtools import RISCV64
from easybuild.tools.systemtools import get_cpu_architecture


class EB_Extrae(ConfigureMake):
Expand All @@ -42,14 +45,27 @@ def configure_step(self):
self.cfg.update('configopts', "--with-mpi=%s" % get_software_root(self.toolchain.MPI_MODULE_NAME[0]))

# Optional dependences
deps = {
'binutils': ('', '--with-binutils=%s', ''),
'Boost': ('', '--with-boost=%s', ''),
'libdwarf': ('', '--with-dwarf=%s', '--without-dwarf'),
'libunwind': ('', '--with-unwind=%s', ''),
'libxml2': (' --enable-xml --enable-merge-in-trace', '', ''),
'PAPI': ('--enable-sampling', '--with-papi=%s', '--without-papi'),
}
# Both --enable-xml and --with-dwarf options are no longer available from 4.1.0 version
# Instead, --with-xml is used
if LooseVersion(self.version) >= LooseVersion('4.1.0'):
deps = {
'binutils': ('', '--with-binutils=%s', ''),
'Boost': ('', '--with-boost=%s', ''),
'libunwind': ('', '--with-unwind=%s', '--without-unwind'),
'libxml2': ('--enable-merge-in-trace', '--with-xml=%s', ''),
'PAPI': ('--enable-sampling', '--with-papi=%s', '--without-papi'),
'zlib': ('', '--with-libz=%s', ''),
}
else:
deps = {
'binutils': ('', '--with-binutils=%s', ''),
'Boost': ('', '--with-boost=%s', ''),
'libdwarf': ('', '--with-dwarf=%s', '--without-dwarf'),
'libunwind': ('', '--with-unwind=%s', '--without-unwind'),
'libxml2': (' --enable-xml --enable-merge-in-trace', '', ''),
'PAPI': ('--enable-sampling', '--with-papi=%s', '--without-papi'),
}

for (dep_name, (with_opts, with_root_opt, without_opt)) in deps.items():
dep_root = get_software_root(dep_name)
if dep_root:
Expand All @@ -64,6 +80,10 @@ def configure_step(self):
# TODO: make this optional dependencies
self.cfg.update('configopts', "--without-dyninst")

# Needed to build in RISC-V architectures
if get_cpu_architecture() == RISCV64:
self.cfg.update('configopts', "--enable-posix-clock")

super(EB_Extrae, self).configure_step()

def sanity_check_step(self):
Expand Down
24 changes: 10 additions & 14 deletions easybuild/easyblocks/generic/juliabundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@

from easybuild.easyblocks.generic.bundle import Bundle
from easybuild.easyblocks.generic.juliapackage import EXTS_FILTER_JULIA_PACKAGES, JuliaPackage
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.modules import get_software_root


class JuliaBundle(Bundle):
class JuliaBundle(Bundle, JuliaPackage):
"""
Bundle of JuliaPackages: install Julia packages as extensions in a bundle
Defines custom sanity checks and module environment
Expand Down Expand Up @@ -82,17 +80,10 @@ def prepare_step(self, *args, **kwargs):
"""Prepare for installing bundle of Julia packages."""
super(JuliaBundle, self).prepare_step(*args, **kwargs)

if get_software_root('Julia') is None:
raise EasyBuildError("Julia not included as dependency!")

def make_module_extra(self, *args, **kwargs):
"""
Module has to append installation directory to JULIA_DEPOT_PATH to keep
the user depot in the top entry. See issue easybuilders/easybuild-easyconfigs#17455
"""
txt = super(JuliaBundle, self).make_module_extra()
txt += self.module_generator.append_paths('JULIA_DEPOT_PATH', [''])
return txt
def install_step(self):
"""Prepare installation environment and dd all dependencies to project environment."""
self.prepare_julia_env()
self.include_pkg_dependencies()

def sanity_check_step(self, *args, **kwargs):
"""Custom sanity check for bundle of Julia packages"""
Expand All @@ -101,3 +92,8 @@ def sanity_check_step(self, *args, **kwargs):
'dirs': [os.path.join('packages', self.name)],
}
super(JuliaBundle, self).sanity_check_step(custom_paths=custom_paths)

def make_module_extra(self, *args, **kwargs):
"""Custom module environement from JuliaPackage"""
mod = super(JuliaBundle, self).make_module_extra(*args, **kwargs)
return mod
Loading

0 comments on commit 2ddd9fd

Please sign in to comment.