1

hello I am trying to use intel mpiifort to compile my program. One error occurs during make:

ld:xxx/intel/oneapi/compiler/2021.2.0/linux/bin/intel64/../../bin/intel64/../../lib/icx-lto.so: error loading plugin: /lib64/libc.so.6: version `GLIBC_2.14' not found. 

I read this Multiple glibc libraries on a single host and I complied glibc-2.17 and patchelf both. Then I input

patchelf --set-rpath xxx/glibc-2.17/lib/ xxx/intel/oneapi/compiler/2021.2.0/linux/lib/icx-lto.so and patchelf --add-needed xxx/glibc-2.17/lib/libc.so.6 xxx/intel/oneapi/compiler/2021.2.0/linux/lib/icx-lto.so

The result of ldd xxx/intel/oneapi/compiler/2021.2.0/linux/lib/icx-lto.so is

linux-vdso.so.1 => (0x00007fffaa5ff000)

   libc.so.6 => xxx/glibc/glibc-2.17/lib/libc.so.6 (0x00007fb1adff8000)
   librt.so.1 => xxx/glibc/glibc-2.1/lib/librt.so.1 (0x00007fb1addf0000)
   libdl.so.2 => xxx/glibc/glibc-2.17/lib/libdl.so.2 (0x00007fb1adbec000)
   libimf.so => xxx/intel/oneapi/compiler/2021.2.0/linux/compiler/lib/intel64_lin/libimf.so (0x00007fb1ad563000)
   libm.so.6 => xxx/glibc/glibc-2.17/lib/libm.so.6 (0x00007fb1ad265000)
   libz.so.1 => /lib64/libz.so.1 (0x00007fb1ad032000)
   libsvml.so => xxx/intel/oneapi/compiler/2021.2.0/linux/compiler/lib/intel64_lin/libsvml.so (0x00007fb1ab534000)
   libirng.so => xxx/intel/oneapi/compiler/2021.2.0/linux/compiler/lib/intel64_lin/libirng.so (0x00007fb1ab1ca000)
   libgcc_s.so.1 => xxx/gcc-4.7.4/lib64/libgcc_s.so.1 (0x00007fb1aafb4000)
   libintlc.so.5 => xxx/intel/oneapi/compiler/2021.2.0/linux/compiler/lib/intel64_lin/libintlc.so.5 (0x00007fb1aad3b000)
   libpthread.so.0 => xxx/glibc-2.17/lib/libpthread.so.0 (0x00007fb1aab1e000)
   /lib64/ld-linux-x86-64.so.2 (0x0000003b70a00000)

But it is still not working when I re-compile my program. Does anyone have some solutions?

Actually same errors when using ifort and icc. But it is solved by patchelf --set-interpreter xxx/glibc/glibc-2.17-gcc-4.8.5/lib/ld-linux-x86-64.so.2 --set-rpath xxx/glibc/glibc-2.17-gcc-4.8.5/lib/ xxx/intel/oneapi/compiler/2021.2.0/linux/bin/intel64/ifort

Employed Russian
  • 199,314
  • 34
  • 295
  • 362
yi yuan
  • 13
  • 2
  • Is it expected that your patched `icx-lto.so` still finds `/lib64/libz.so.1`? I guess you don't have a `libz.so.1` in your `xxx/glibc/glibc-2.17/lib/`. I guess that's probably fine, as long as libz doesn't try to resolve its own dependencies against /lib64/libc.so.1. Also, isn't glib 2.14 pretty old? Maybe time to upgrade to a newer version of your distro; current glibc is 2.33. – Peter Cordes Jul 20 '21 at 21:27
  • 2
    You should never use `ldd` on a machine with multiple GLIBCs: https://stackoverflow.com/a/68251162/50617. Also, running `ldd` on the `.so` doesn't tell us what your _actual_ problem is (what does "not working" mean?). – Employed Russian Jul 20 '21 at 23:48
  • @PeterCordes Yes, I think so. And I am using a cluster with CentOS 6.10, so I have to get adapted to it. – yi yuan Jul 21 '21 at 08:53
  • @EmployedRussian Unfortunately, the result of `env LD_TRACE_LOADED_OBJECTS=1 xxx/intel/oneapi/compiler/2021.2.0/linux/lib/icx-lto.so` is `Segmentation fault (core dumped)`, so `patchelf` damaged this`.so`? P.S. "not working" means the problem remains the same. – yi yuan Jul 21 '21 at 09:10
  • You don't *have* to keep using an old CentOS install that's getting more and more obsolete every year. It's already past it's EOL even for maintenance / security updates, and has been since last November (https://wiki.centos.org/About/Product), so it's *really* time to start thinking about either retiring the cluster or upgrading to a new version of something or a new distro. Up to you if you want to spend more time futzing around with a new compiler on that old distro, but even CentOS 8 was 2015. – Peter Cordes Jul 21 '21 at 09:15
  • @EmployedRussian UPDATE, I tried other `.so` that I didn't modify, it still shows `Segmentation fault (core dumped)`. it seems `env LD_TRACE_LOADED_OBJECTS=1` only works for app? – yi yuan Jul 21 '21 at 09:21
  • @PeterCordes Thank you for your advice anyway. You see, I don't have the right to make decision either to retire or upgrade the cluster. I am trying to use it because I want more computation resource. And I really doubt the one in charge of it will take the advice. – yi yuan Jul 21 '21 at 09:37
  • If you're not the admin, then sending them a request to get Intel's compiler installed for you might be useful (either in getting them to solve this, or getting them to finally upgrade). If not, then good luck. :/ – Peter Cordes Jul 21 '21 at 09:42
  • "env LD_TRACE_LOADED_OBJECTS=1 only works for app?" -- yes, and you should set it for the `ifort` binary, so we can see what libraries _it_ loads. – Employed Russian Jul 21 '21 at 15:53
  • @EmployedRussian `ifort` has loaded the libraries as it is supposed: ```` linux-vdso.so.1 libdl.so.2 => xxx/glibc/glibc-2.17-gcc-4.8.5/lib/libdl.so.2 libpthread.so.0 => xxx/glibc/glibc-2.17-gcc-4.8.5/lib/libpthread.so.0 libstdc++.so.6 => xxx/gcc/gcc-4.7.4/lib64/libstdc++.so.6 libm.so.6 =>xxx/glibc/glibc-2.17-gcc-4.8.5/lib/libm.so.6 libc.so.6 => xxx/glibc/glibc-2.17-gcc-4.8.5/lib/libc.so.6 xxx/glibc/glibc-2.17-gcc-4.8.5/lib/ld-linux-x86-64.so.2 libgcc_s.so.1 =>xxx/gcc/gcc-4.7.4/lib64/libgcc_s.so.1 ```` – yi yuan Jul 22 '21 at 13:49
  • "`ifort` loaded libraries as it is supposed to" -- so _what_ is the problem you are trying to solve? – Employed Russian Jul 22 '21 at 15:05
  • @EmployedRussian as I said above, this error information: ld:xxx/intel/oneapi/compiler/2021.2.0/linux/bin/intel64/../../bin/intel64/../../lib/icx-lto.so: error loading plugin: /lib64/libc.so.6: version `GLIBC_2.14' not found. Even though `ifort` and `icc` have loaded correct libraries. – yi yuan Jul 22 '21 at 15:31

1 Answers1

0

This errror:

ld: xxx/intel/oneapi/compiler/2021.2.0/linux/bin/intel64/.../icx-lto.so: error loading plugin: /lib64/libc.so.6: version `GLIBC_2.14' not found. 

appears to be coming from ld.

same errors when using ifort and icc

It looks like both ifort and icc are using linker plugin to perform LTO (link-time optimization).

You need to patchelf the binary which actually fails (ld in this case), not the binary which merely invokes ld (i.e. leave ifort and icc alone).

Usually you can tell the compiler to print more info about the binaries it invokes with e.g. icc -v <rest of command>.

I expect that there is ld (or possibly ld.lld) under .../intel/oneapi/compiler/2021.2.0/linux/..., and you need to patchelf that binary.

Employed Russian
  • 199,314
  • 34
  • 295
  • 362
  • Yes, you are right. The problem is caused by `ld` not icx-lto.so. And `ld` is actually an app from binutils. Thank you for your help! – yi yuan Jul 22 '21 at 18:45
  • @yiyuan -- if the answer helped you, upvote it. If it answered your question completely, accept it. – Employed Russian Jul 22 '21 at 19:34