3

I'am trying to a run a sample code from pardiso website but end up with this error. I installed the lapack package from http://www.netlib.org/lapack/

gcc pardiso_sym.c -L /home/sree/ -lpardiso600-GNU800-X86-64 -llapack  -lgfortran -fopenmp -lm -ldl

error:

/home/sree//libpardiso600-GNU800-X86-64.so: undefined reference to `log2f@GLIBC_2.27'
/home/sree//libpardiso600-GNU800-X86-64.so: undefined reference to `logf@GLIBC_2.27'
collect2: error: ld returned 1 exit status
SHD
  • 31
  • 1
  • 3

2 Answers2

2

I know this question is quite old but anyway:

First of all - the error you are getting is a linker error and is seems like it cannot resolve a reference to a function defined in glibc.

The version given here for glibc (the GNU C library) is 2.27.

I would now suspect that the version used by GCC when trying to compile pardiso_sym.c was lower than the specified version of glibc - thus the error.

You can find a nice thread about checking the version of glibc used by different gcc compilers here.

That said - different gcc compilers might use different versions of glibc for linking. You could now either specifically try and link a proper version of glibc (like described here) or - probably more feasible - try and update your glibc version.

The described pardiso packages were also compiled with gcc 8.0 but there is a pardiso version available compiled using the gcc 7.2. Both versions also link agains different glibc versions and it might already be feasible to use libpardiso600-GNU720-X86-64.so. In addition I'd also use a gcc version that is higher equal than the one used to compile pardiso so you might want to upgrade gcc too.

Edit: Originally Pardiso 6.0 (and, for that matter also 6.2) was deployed as either libpardiso600-GNU720-X86-64.so or libpardiso600-GNU800-X86-64.so both available under its Download-Link.

Flusslauf
  • 102
  • 12
  • I had the same problem as OP. Your suggestion to use "a gcc version that is higher equal than the one used to compile pardiso" didn't help, I used GCC 10.2 (!). Trying to find a fix, I'll post it if successful. – András Aszódi Feb 28 '21 at 10:16
  • Did you check what version of glibc you GCC is trying to link against Pardiso? And did you try the GNU729 pardiso executable? – Flusslauf Mar 02 '21 at 11:00
  • Yes, I did: Pardiso wants Version 2.27, I have Version 2.17 (checked with `ldd --version`). No, I don't have the `GNU729` Pardiso executable. Only thing I have is Version 6.0, see above. *However*: I contacted Prof. Olaf Schenk (creator of Pardiso) and he kindly promised to give me a new Version 7.2 library compiled against a sufficiently old `glibc` which I expect to solve the problem. – András Aszódi Mar 02 '21 at 16:18
  • Both versions are 6.0 executables (one could choose them when downloading PARDISO, for 6.0 there was `libpardiso600-GNU729-X86-64.so` and `libpardiso600-GNU800-X86-64.so` available). The difference was that they were linked with different a gcc and a different gclib version. Probably that was not very clear in my answer - I'll update that. But good everything worked out. – Flusslauf Mar 02 '21 at 18:44
  • Yes, the `GNU720` (not `GNU729` btw) version did the trick for me. Link line details in my answer, and a big thank you to "Flusslauf" (i.e. +1 :-) ) – András Aszódi Mar 03 '21 at 10:15
  • Uhh - my bad.. I'll change that to 720, thanks! – Flusslauf Mar 03 '21 at 10:38
1

As promised, here comes the summary of what I learned:

The Pardiso library (like all shared libraries) remembers which glibc version was used when it was compiled. Occasionally glibc may be older on your system than what Pardiso expects, leading to the link errors described by OP. You can check the version of your glibc by running ldd --version.

I applied for a free time-limited academic license, that gave me a personal download link. As @Flusslauf pointed out, one has the choice of 2 versions for the Linux 64-bit platform. As of today (2021-03-03) the two versions available to me were: libpardiso600-GNU720-X86-64.so (note: GNU720 and not GNU729, but that's a minor difference) and libpardiso600-GNU800-X86-64.so. The latter didn't work for me for the reasons explained above. So I compiled one of the little example programs from the Pardiso website in the directory containing the former Pardiso library as follows:

cd /path/to/pardiso
gcc pardiso_sym.c -L/usr/lib64 -L. -lpardiso600-GNU720-X86-64 \
  -llapack -lblas -fopenmp -lpthread -lm -ldl -o psym
export LD_LIBRARY_PATH=/path/to/pardiso:${LD_LIBRARY_PATH}
export OMP_NUM_THREADS=2
export PARDISOLICMESSAGE=1
./psym

The -L/usr/lib64 was necessary to find LAPACK and BLAS on the machine I used. The -L. tells GCC to look for the Pardiso library in the current directory (/path/to/pardiso where I compiled the test program). After compilation, add to LD_LIBRARY_PATH the Pardiso library location, ask for 2 OpenMP threads and silence the Pardiso license message.

Oh, one last thing: don't forget to copy your license file to your home directory! :-)

András Aszódi
  • 8,948
  • 5
  • 48
  • 51