Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPATH issue with cdft wrappers when using OneAPI compilers #2910

Open
bedroge opened this issue Mar 20, 2023 · 6 comments · May be fixed by #2912
Open

RPATH issue with cdft wrappers when using OneAPI compilers #2910

bedroge opened this issue Mar 20, 2023 · 6 comments · May be fixed by #2912

Comments

@bedroge
Copy link
Contributor

bedroge commented Mar 20, 2023

While installing imkl-FFTW/2022.2.1-iimpi-2022b with --rpath, I ran into lots of the following errors:

mpiicc -c  -Wall -Werror -std=c99 -Wall -Werror -std=c99    \
         -DMKL_DOUBLE -I../../include -I../../include/fftw wrappers/1d_create_plan.c -o /dev/shm/f115372/imklFFTW/2022.2.1/iimpi-2022b/tmp0j8l_1wg/obj_DOUBLE_intel64_lp64/1d_create_plan.o
icx: error: -Wl,-rpath=/cvmfs/hpc.rug.nl/versions/2023.01/rocky8/x86_64/amd/zen3/software/imkl-FFTW/2022.2.1-iimpi-2022b/lib: 'linker' input unused [-Werror,-Wunused-co
mmand-line-argument]
icx: error: -Wl,-rpath=/cvmfs/hpc.rug.nl/versions/2023.01/rocky8/x86_64/amd/zen3/software/imkl-FFTW/2022.2.1-iimpi-2022b/lib64: 'linker' input unused [-Werror,-Wunused-
command-line-argument]
icx: error: -Wl,-rpath=$ORIGIN: 'linker' input unused [-Werror,-Wunused-command-line-argument]
icx: error: -Wl,-rpath=$ORIGIN/../lib: 'linker' input unused [-Werror,-Wunused-command-line-argument]
icx: error: -Wl,-rpath=$ORIGIN/../lib64: 'linker' input unused [-Werror,-Wunused-command-line-argument]
icx: error: -Wl,--disable-new-dtags: 'linker' input unused [-Werror,-Wunused-command-line-argument]
icx: error: -Wl,-rpath=/cvmfs/hpc.rug.nl/versions/2023.01/rocky8/x86_64/amd/zen3/software/imkl/2022.2.1/mkl/2022.2.1/lib/intel64: 'linker' input unused [-Werror,-Wunuse
d-command-line-argument]
icx: error: -Wl,-rpath=/cvmfs/hpc.rug.nl/versions/2023.01/rocky8/x86_64/amd/zen3/software/imkl/2022.2.1/compiler/2022.2.1/linux/compiler/lib/intel64_lin: 'linker' input
 unused [-Werror,-Wunused-command-line-argument]
icx: error: -Wl,-rpath=/cvmfs/hpc.rug.nl/versions/2023.01/rocky8/x86_64/amd/zen3/software/impi/2021.7.1-intel-compilers-2022.2.1/mpi/2021.7.1/libfabric/lib: 'linker' in

This looks very much like the issue that @casparvl reported (#2799 (comment)) and solved (see https://github.com/easybuilders/easybuild-easyblocks/pull/2799/files#diff-093bbadabc20f96a7fa30c5dbca192bdd752e4be7c9b9f21679b9b701348a865R433) for Clang , so I guess we need to do the same thing for newer versions of the Intel compilers (aren't these using Clang now as well?).

@bedroge
Copy link
Contributor Author

bedroge commented Mar 20, 2023

I don't know how broad the issue is (i.e. which applications set -Wall -Werror besides this one), but for imkl-FFTW it could be easily solved by adjusting the imkl easyblock (similar to what is done for PGI/NVHPC here: https://github.com/easybuilders/easybuild-easyblocks/blob/develop/easybuild/easyblocks/i/imkl.py#L217) and making sure that these options are removed from the makefile for newer Intel compilers.

@bedroge
Copy link
Contributor Author

bedroge commented Mar 20, 2023

A somewhat cleaner solution, the following regex for just adding -Wno-unused-command-line-argument to the makefiles seems to work fine too:

regex_subs = [('-Werror', '-Werror -Wno-unused-command-line-argument')]

@bedroge
Copy link
Contributor Author

bedroge commented Mar 20, 2023

I've now tried the following, and this also seems to work fine:

        if get_software_root('intel-compilers') and build_option('rpath'):
            intelver = get_software_version('intel-compilers')
            if LooseVersion(intelver) >= LooseVersion("2022.2.0"):
                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)

@casparvl
Copy link
Contributor

casparvl commented Mar 20, 2023

Looks sensible to me. It should be specific to rpath, since the RPATH wrappers of EasyBuild then add Wl,-rpath arguments, which are not used when only compiling - which is what the compiler then complains about.

Regarding

if LooseVersion(intelver) >= LooseVersion("2022.2.0"):

If I understand correctly, you only see this error when using the new OneAPI (i.e. DPC) compilers, since those are based on Clang. Maybe instead of a version check, we can check if the OneAPI compilers are used (at least as c/c++ compilers)? Should probably use something like this and this. The advantage here is that if the OneAPI compilers are used by an older version of the toolchain, your fix would still be applied :)

@bedroge
Copy link
Contributor Author

bedroge commented Mar 21, 2023

@casparvl You're absolutely right, that check is much better, especially since you can disable the use of the new compilers with new versions. I'll change that and make a PR.

@bedroge bedroge changed the title RPATH issue with Intel 2022b compilers RPATH issue with cdft wrappers in OneAPI compilers Mar 21, 2023
@bedroge bedroge changed the title RPATH issue with cdft wrappers in OneAPI compilers RPATH issue with cdft wrappers when using OneAPI compilers Mar 21, 2023
@bedroge
Copy link
Contributor Author

bedroge commented Mar 21, 2023

Created a pull request: #2912

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants