0

I just installed a gcc-4.7.2 in my home directory (non-root). As per the link here, i followed the instructions, installed gmp, mpfr, mpc, libelf and then gcc-4.7.2.

I downloaded the latest gmp, mpfr, mpc, libelf from their websites. But I wanted to install gcc-4.7.2 with them.

my configure options for gcc were :

./configure --enable-libstdcxx-threads 
--enable-libstdcxx-time=yes 
--disable-shared 
--enable-static 
--disable-bootstrap 
--enable-libstdcxx-pch 
--enable-libgomp 
--enable-lto
--enable-threads=posix 
--enable-tls 
--prefix=/home/gcc-4.7.2 
--with-gmp=/home/packages/gcctemp 
--with-mpfr=/home/packages/gcctemp 
--with-mpc=/home/packages/gcctemp 
--with-libelf=/home/packages/gcctemp 
--with-fpmath=sse 
--enable-languages=c,c++

I set the environment variables correctly. When I compile a sample c++11 code, I get the error as :

ld: cannot find -lgcc_s

I searched the forums and found libgcc.a in the two locations

./lib/gcc/x86_64-unknown-linux-gnu/4.7.2/libgcc.a
./lib/gcc/x86_64-unknown-linux-gnu/4.7.2/32/libgcc.a

But I did not find any libgcc_s.so / libgcc_s.so.1 file in the installation folder.

How do i solve this problem ? Was there something wrong in my gcc configuration

PS: I do have gcc-4.9 installed in my home directory as well following the same installation instructions and I could locate the libgcc_s.so files in gcc-4.9.

Can I copy those .so files into gcc-4.7.2 lib and lib64 folders ?

Community
  • 1
  • 1
pugs
  • 155
  • 1
  • 8
  • why are you using 4.7.2 at all? – DTSCode Jul 11 '14 at 20:37
  • So you --disable-shared and then wonder why there is no shared library? – PlasmaHH Jul 11 '14 at 21:22
  • I cant use intel compiler with gcc 4.9 for using include headers. The intel compiler needs gcc header files for its include path and gcc 4.9 does not support intel 14.0 compiler version. The latest it supports AFAIK is 4.7.2 or may be 4.8. Also Boost (1.55) libraries are not yet compatible with gcc 4.9.0. Hence 4.7.2. The workaround I used was pretty naive, I copied the libgcc_s.so from gcc 4.9.0 to the gcc-4.7.2 folder and it worked for now. – pugs Jul 11 '14 at 21:22
  • @PlasmaHH : I installed 4.9.0 using the same flags. and It did not cause a problem. It caused for 4.7.2 though. Will I have to rebuild mpc, mpfr, gmp, elf again ? I followed the steps given the stackoverflow link(installing gcc hardway) – pugs Jul 11 '14 at 21:25

0 Answers0