From 8f9958da25eb1db2931898647ad09b8134271812 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 21 Mar 2023 10:42:44 +0100 Subject: [PATCH] add fix for Intel OneAPI compilers when using RPATH --- easybuild/easyblocks/i/imkl.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/easybuild/easyblocks/i/imkl.py b/easybuild/easyblocks/i/imkl.py index c2bb129b2ec..fe5a985db76 100644 --- a/easybuild/easyblocks/i/imkl.py +++ b/easybuild/easyblocks/i/imkl.py @@ -46,6 +46,7 @@ from easybuild.easyblocks.generic.intelbase import IntelBase, ACTIVATION_NAME_2012, LICENSE_FILE_NAME_2012 from easybuild.framework.easyconfig import CUSTOM from easybuild.tools.build_log import EasyBuildError +from easybuild.tools.config import build_option from easybuild.tools.filetools import apply_regex_substitutions, change_dir, mkdir, move_file, remove_dir, write_file from easybuild.tools.modules import get_software_root from easybuild.tools.run import run_cmd @@ -234,6 +235,17 @@ def build_mkl_fftw_interfaces(self, libdir): for liball in glob.glob(os.path.join(interfacedir, '*', 'makefile')): apply_regex_substitutions(liball, regex_nvc_subs) + # RPATH wrappers add -Wl,rpath arguments to all command lines, including when it is just compiling. + # The icx compiler by default warns about that, but the makefiles of the cdft wrappers set -Wall -Werror, + # which turns them into "linker input unused" errors: + # See https://github.com/easybuilders/easybuild-easyblocks/issues/2910 + # Here, we patch the makefiles and add -Wno-unused-command-line-argument to avoid these warnings alltogether. + if get_software_root('intel-compilers') and build_option('rpath'): + if self.toolchain.options.get('oneapi') or self.toolchain.options.get('oneapi_c_cxx'): + regex_icx_subs = [('-Werror', '-Werror -Wno-unused-command-line-argument')] + for lib in self.cdftlibs: + apply_regex_substitutions(os.path.join(interfacedir, lib, 'makefile'), regex_icx_subs) + for lib in fftw2libs + fftw3libs + self.cdftlibs: buildopts = [compopt] if lib in fftw3libs: