Skip to content
Open
Changes from all 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
12 changes: 12 additions & 0 deletions easybuild/easyblocks/i/imkl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it makes more sense to replace -Wall than -Werror, since the order of options may matter.

When replacing -Werror, I think we assume that -Wall is listed earlier, so -Wno-unused-* can disable the warning.
When replacing -Wall to inject -Wno-unused-*, we're disabling that specific warning right after enabling all warnings (and before -Werror which enables all warnings to be treated as errors kicks in).

This may make this fix a bit more robust w.r.t. changes to the makefile being patched

regex_icx_subs = [('-Wall', '-Wall -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:
Expand Down