Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Michał_K_
Beginner
1,035 Views

libstdc++.a undefined reference to symbol '__tls_get_addr@@GLIBC_2.3'

Hi.

I'm trying to use icpc to compile code generated by xmds2 software and I'm getting this error:

xmds2 version 2.2.2 "XMDS2 is a game of two halves" (Debian package 2.2.2+dfsg-2)
Copyright 2000-2014 Graham Dennis, Joseph Hope, Mattias Johnsson
                    and the xmds team
Generating source code...
... done
Compiling simulation...
Waf: Entering directory `/home/mkulcz/xmds2/Andrzej'
[1/2] cxx: home/mkulcz/xmds2/Andrzej/GP2.cc -> home/mkulcz/xmds2/Andrzej/GP2.cc.1.o
 icpc  -finline-functions --param max-inline-insns-single=1800 -fast -ffast-math -complex-limited-range -fomit-frame-pointer -xS -fma -fstack-protector-strong   -I/usr/lib/python2.7/dist-packages/xpdeint/includes -I/opt/intel/include -I/usr/include/hdf5/serial -DHAVE_DEV_URANDOM -DHAVE_HDF5_HL -DHAVE_H5LEXISTS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D_FORTIFY_SOURCE=2  GP2.cc -c -o GP2.cc.1.o 
icpc: command line warning #10006: ignoring unknown option '-ffast-math'
icpc: command line warning #10131: extension 'S' not supported ignored in option '-x'
[2/2] cxxprogram: home/mkulcz/xmds2/Andrzej/GP2.cc.1.o -> home/mkulcz/xmds2/Andrzej/GP2
 icpc -fast -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-rpath -Wl,/usr/lib/x86_64-linux-gnu/hdf5/serial  GP2.cc.1.o -o /home/mkulcz/xmds2/Andrzej/GP2 -Wl,-rpath,/opt/intel/lib/intel64_lin -Wl,-rpath,/opt/intel/compilers_and_libraries/linux/mpi/lib64 -Wl,-rpath,/usr/lib/x86_64-linux-gnu    -Wl,-Bstatic  -lfftw3 -lhdf5_hl -lhdf5 -Wl,-Bdynamic -L/opt/intel/lib/intel64_lin -L/opt/intel/compilers_and_libraries/linux/mpi/lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu/hdf5/serial -L/usr/lib/x86_64-linux-gnu/hdf5/serial -lpthread -lsz -lz -ldl -lm -Wl,-Bstatic 
ipo: warning #11021: unresolved aec_buffer_decode
        Referenced in /usr/lib/x86_64-linux-gnu/libsz.so
ipo: warning #11021: unresolved aec_buffer_encode
        Referenced in /usr/lib/x86_64-linux-gnu/libsz.so
ld: /usr/lib/gcc/x86_64-linux-gnu/5//libstdc++.a(eh_globals.o): undefined reference to symbol '__tls_get_addr@@GLIBC_2.3'
//lib64/ld-linux-x86-64.so.2: error adding symbols: DSO missing from command line
Waf: Leaving directory `/home/mkulcz/xmds2/Andrzej'
Failed command:
 icpc -fast -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-rpath -Wl,/usr/lib/x86_64-linux-gnu/hdf5/serial  GP2.cc.1.o -o /home/mkulcz/xmds2/Andrzej/GP2 -Wl,-rpath,/opt/intel/lib/intel64_lin -Wl,-rpath,/opt/intel/compilers_and_libraries/linux/mpi/lib64 -Wl,-rpath,/usr/lib/x86_64-linux-gnu    -Wl,-Bstatic  -lfftw3 -lhdf5_hl -lhdf5 -Wl,-Bdynamic -L/opt/intel/lib/intel64_lin -L/opt/intel/compilers_and_libraries/linux/mpi/lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu/hdf5/serial -L/usr/lib/x86_64-linux-gnu/hdf5/serial -lpthread -lsz -lz -ldl -lm -Wl,-Bstatic 


FATAL ERROR: Failed to compile. Check warnings and errors. The most important will be first.

I tried reinstalling libraries but I have no idea how to tackle this. 

0 Kudos
4 Replies
Viet_H_Intel
Moderator
1,035 Views

 

Hi, 

tls_get_addr is defined in /lib/ld-linux.so.2

 $nm -D /lib/ld-linux.so.2 |grep tls_get_addr 
00012050 T ___tls_get_addr 
 

Can you add /lib/ld-linux.so.2 to the link line to see if it solves the problem?

Regards,

Viet

 

Michał_K_
Beginner
1,035 Views

Hi,

How do I do that?

What command should I append to linker?

Michał_K_
Beginner
1,035 Views

Viet Hoang (Intel) wrote:

 

Hi, 

tls_get_addr is defined in /lib/ld-linux.so.2

 $nm -D /lib/ld-linux.so.2 |grep tls_get_addr 
00012050 T ___tls_get_addr 
 

Can you add /lib/ld-linux.so.2 to the link line to see if it solves the problem?

Regards,

Viet

 

 

Could you explain more, I'm really struggling with this.

I tried it also on relatively fresh installation of ubuntu 16.04 and got the same error.

Michał_K_
Beginner
1,035 Views

Finally figured it out, it's -static inside the -fast command that causes this error. Trying to pass -Wl,-rpath,/lib/ to linker didn't work.

Reply