diff --git a/easybuild/easyblocks/l/llvm.py b/easybuild/easyblocks/l/llvm.py index db086bd83c9..54c24eaea0f 100644 --- a/easybuild/easyblocks/l/llvm.py +++ b/easybuild/easyblocks/l/llvm.py @@ -323,7 +323,7 @@ def __init__(self, *args, **kwargs): self.final_runtimes += ['compiler-rt', 'libunwind', 'libcxx', 'libcxxabi'] if self.cfg['build_openmp']: - self.final_projects.append('openmp') + self.final_runtimes.append('openmp') else: errors = [] # check for all options that depend on OpenMP being enabled @@ -540,7 +540,7 @@ def _configure_final_build(self): self._cmakeopts['LIBOMP_USE_HWLOC'] = 'ON' self._cmakeopts['LIBOMP_HWLOC_INSTALL_DIR'] = hwloc_root - if 'openmp' in self.final_projects: + if 'openmp' in self.final_runtimes: if self.cfg['build_openmp_offload']: # Force dlopen of the GPU libraries at runtime, not using existing libraries if LooseVersion(self.version) >= '19': @@ -1124,6 +1124,16 @@ def _para_test_step(self, parallel=1): gcc_lib = self._get_gcc_libpath(strict=True) lib_path = ':'.join(filter(None, [gcc_lib, lib_path])) + # After switching `openmp` to a runtime build, libomp.so is not produced inside `/lib` anymore but + # in `/runtimes/runtimes-bins/openmp/runtime/src/libomp.so` + # This causes the `libomptarget` tests to fail because the compiler cannot find `libomp.so`. + check_libomp = os.path.join(basedir, 'runtimes', 'runtimes-bins', 'openmp', 'runtime', 'src', 'libomp.so') + needed_libomp = os.path.join(basedir, 'lib', 'libomp.so') + if os.path.exists(check_libomp) and not os.path.exists(needed_libomp): + # Create a symlink to the libomp.so in the runtimes directory + mkdir(os.path.dirname(needed_libomp), parents=True) + symlink(check_libomp, needed_libomp) + with _wrap_env(os.path.join(basedir, 'bin'), lib_path): cmd = f"make -j {parallel} check-all" res = run_shell_cmd(cmd, fail_on_error=False) @@ -1456,7 +1466,7 @@ def sanity_check_step(self, custom_paths=None, custom_commands=None, *args, **kw check_bin_files += ['llvm-bolt', 'llvm-boltdiff', 'llvm-bolt-heatmap'] check_lib_files += ['libbolt_rt_instr.a'] custom_commands += ['llvm-bolt --help'] - if 'openmp' in self.final_projects: + if 'openmp' in self.final_runtimes: omp_lib_files = ['libomp.so', 'libompd.so'] if self.cfg['build_openmp_offload']: omp_lib_files += ['libomptarget.so']