Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

undefined reference to `log2f@GLIBC_2.27' undefined reference to `logf@GLIBC_2.27'

Tags:

math.h

lapack

lm

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
like image 444
SHD Avatar asked Nov 01 '25 04:11

SHD


1 Answers

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.

like image 137
Flusslauf Avatar answered Nov 04 '25 04:11

Flusslauf