Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29389 Discussions

Intel ifx compiler build failure with link-time (IPO) optimizations

DataScientist
Valued Contributor I
625 Views

I have a library that is configured with CMake. During the configuration phase, CMake's test (via check_ipo_supported) for IPO optimization support of ifx fails, stating that the compiler (ifx) does not support IPO optimization. If I enforce IPO explicitly with ifx compiler flags, I get the following LLVM errors during the linking phase:

ld: /tmp/lto-llvm-ecd5af.o:(.rodata.strlit.1.llvm.0+0x0): multiple definition of `strlit.1.llvm.0'; /tmp/lto-llvm-6a50da.o:(.rodata.strlit.1.llvm.0+0x0): first defined here
ld: /tmp/lto-llvm-bd59f7.o:(.rodata.str1.16+0x30): multiple definition of `strlit.16.llvm.0'; /tmp/lto-llvm-58bd2a.o:(.rodata.strlit.16.llvm.0+0x0): first defined here
ld: /tmp/lto-llvm-e20798.o:(.rodata.strlit.1.llvm.0+0x0): multiple definition of `strlit.1.llvm.0'; /tmp/lto-llvm-6a50da.o:(.rodata.strlit.1.llvm.0+0x0): first defined here
ld: /tmp/lto-llvm-e20798.o:(.rodata.strlit.llvm.0+0x0): multiple definition of `strlit.llvm.0'; /tmp/lto-llvm-281b67.o:(.rodata.strlit.llvm.0+0x0): first defined here
ld: /tmp/lto-llvm-8a56ed.o:(.rodata.strlit.1.llvm.0+0x0): multiple definition of `strlit.1.llvm.0'; /tmp/lto-llvm-6a50da.o:(.rodata.strlit.1.llvm.0+0x0): first defined here
ld: /tmp/lto-llvm-bc72e5.o:(.rodata.strlit.6.llvm.0+0x0): multiple definition of `strlit.6.llvm.0'; /tmp/lto-llvm-8a56ed.o:(.rodata.strlit.6.llvm.0+0x0): first defined here
ld: /tmp/lto-llvm-bc72e5.o:(.rodata.strlit.5.llvm.0+0x0): multiple definition of `strlit.5.llvm.0'; /tmp/lto-llvm-8a56ed.o:(.rodata.strlit.5.llvm.0+0x0): first defined here
ld: /tmp/lto-llvm-f75a37.o:(.rodata.strlit.17.llvm.0+0x0): multiple definition of `strlit.17.llvm.0'; /tmp/lto-llvm-58bd2a.o:(.rodata.strlit.17.llvm.0+0x0): first defined here
ld: /tmp/lto-llvm-f75a37.o:(.rodata.strlit.22.llvm.0+0x0): multiple definition of `strlit.22.llvm.0'; /tmp/lto-llvm-58bd2a.o:(.rodata.cst4+0x14): first defined here
ld: /tmp/lto-llvm-f75a37.o:(.rodata.strlit.1.llvm.0+0x0): multiple definition of `strlit.1.llvm.0'; /tmp/lto-llvm-6a50da.o:(.rodata.strlit.1.llvm.0+0x0): first defined here

Any ideas why such an error may be happening?

The IFX compiler flags explicitly passed are the following:

-O3 -fPIC -nologo -threads -standard-semantics -integer-size 32 -static-intel -unroll -finline-functions -ftz -inline-forceinline -flto=thin -heap-arrays

The IFX linker flags explicitly passed are the following:

-fPIC -O3 -nologo -threads -standard-semantics -integer-size 32 -diag-disable=7025 -diag-disable=5268 -diag-disable=10346 -diag-disable=10448 -static-intel -O3 -unroll -diag-disable=10397 -finline-functions -ftz -qopt-report=2 -inline-forceinline -flto=thin -fpic -shared -qopenmp-link=static -static -static-libstdc++ -static-libgcc -shared -nofor-main

 

0 Kudos
3 Replies
DataScientist
Valued Contributor I
576 Views

After extensive investigation, it turns out that passing the `--allow-multiple-definition` flag to the linker resolves the issue. But I consider it only a temporary solution. I still appreciate any permanent fix to the above compilation error. The platform is Microsoft WSL Ubuntu.

0 Kudos
Igor_V_Intel
Moderator
506 Views

Do you have a small reproducer showing this problem?

DataScientist
Valued Contributor I
212 Views

Unfortunately, I do not have a minimal reproducible example yet. The flag I mentioned above (`--allow-multiple-definition`) has temporarily bypassed the issue, although I suppose that is not a permanent solution. I will work on a minimal reproducer to share here as soon as other obligations allow.

0 Kudos
Reply