Skip to content
Merged
Changes from 5 commits
Commits
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
41 changes: 25 additions & 16 deletions easybuild/easyblocks/l/llvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,18 +369,19 @@ def __init__(self, *args, **kwargs):
if LooseVersion(self.version) < LooseVersion('16'):
self.general_opts['LLVM_INCLUDE_GO_TESTS'] = 'OFF'

# Sysroot
self.sysroot = build_option('sysroot')
if self.sysroot:
if LooseVersion(self.version) < LooseVersion('19'):
raise EasyBuildError("Using sysroot is not supported by EasyBuild for LLVM < 19")
self.general_opts['DEFAULT_SYSROOT'] = self.sysroot
self.general_opts['CMAKE_SYSROOT'] = self.sysroot
self._set_dynamic_linker()
trace_msg(f"Using '{self.dynamic_linker}' as dynamic linker from sysroot {self.sysroot}")
self.log.info("Final projects to build: %s", ', '.join(self.final_projects))
self.log.info("Final runtimes to build: %s", ', '.join(self.final_runtimes))

self.ignore_patterns = self.cfg['test_suite_ignore_patterns'] or []
self._cmakeopts = {}
self._cfgopts = list(filter(None, self.cfg.get('configopts', '').split()))

@property
def llvm_src_dir(self):
"""Return root source directory of LLVM (containing all components)"""
# LLVM is the first source so we already have this in start_dir. Might be changed later
return self.start_dir

def _configure_build_targets(self):
# list of CUDA compute capabilities to use can be specifed in two ways (where (2) overrules (1)):
# (1) in the easyconfig file, via the custom cuda_compute_capabilities;
# (2) in the EasyBuild configuration, via --cuda-compute-capabilities configuration option;
Expand Down Expand Up @@ -479,12 +480,6 @@ def __init__(self, *args, **kwargs):
self._cmakeopts = {}
self._cfgopts = list(filter(None, self.cfg.get('configopts', '').split()))

@property
def llvm_src_dir(self):
"""Return root source directory of LLVM (containing all components)"""
# LLVM is the first source so we already have this in start_dir. Might be changed later
return self.start_dir

def prepare_step(self, *args, **kwargs):
"""Prepare step, modified to ensure install dir is deleted before building"""
super().prepare_step(*args, **kwargs)
Expand Down Expand Up @@ -635,6 +630,8 @@ def _set_dynamic_linker(self):
def _update_test_ignore_patterns(self):
"""Update the ignore patterns based on known ignorable test failures when running with specific LLVM versions
or with specific dependencies/options."""
self.ignore_patterns = self.cfg['test_suite_ignore_patterns'] or []

new_ignore_patterns = []
if self.sysroot:
# Some tests will run a FileCheck on the output of `clang -v` for `-internal-externc-isystem /usr/include`
Expand Down Expand Up @@ -705,6 +702,18 @@ def configure_step(self):
if self.cfg.parallel:
self.make_parallel_opts = f"-j {self.cfg.parallel}"

self._configure_build_targets()

# Sysroot
self.sysroot = build_option('sysroot')
if self.sysroot:
if LooseVersion(self.version) < LooseVersion('19'):
raise EasyBuildError("Using sysroot is not supported by EasyBuild for LLVM < 19")
self.general_opts['DEFAULT_SYSROOT'] = self.sysroot
self.general_opts['CMAKE_SYSROOT'] = self.sysroot
self._set_dynamic_linker()
trace_msg(f"Using '{self.dynamic_linker}' as dynamic linker from sysroot {self.sysroot}")

# CMAKE_INSTALL_PREFIX and LLVM start directory are set here instead of in __init__ to
# ensure this easyblock can be used as a Bundle component, see
# https://github.com/easybuilders/easybuild-easyblocks/issues/3680
Expand Down