Re: /usr/bin/ld: cannot find -lgcc_s

From: BenLIU <ben.liu_at_pi.infn.it>
Date: Mon, 29 Jul 2013 11:52:51 +0200

Hi, Jonathan

      I had the same problems you have, I think you can find the solution
as below:

https://twiki.cern.ch/twiki/bin/view/Sandbox/HCALRadiationProject#Install_FLUKA_and_its_graphic_in

   * *" [[: not found "* , is because the script /fluka/flutil/fff uses
     "sh" as script interpreter and does not support double bracket in if
     condition. To solve this change "sh" to "bash" in the first line of
     the script:
       o $ sudo nano /usr/local/fluka/flutil/fff
       o Change the line #!/bin/sh to #!/bin/bash
       o Save the file and exit
   * *"/usr/bin/ld: cannot find crt1.o: No such file or directory"*, the
     linker can not find some libraries, To fix it:
       o Find the directory where the library is:
           + $ sudo locate crt1.o
           + $ sudo locate crti.o
           + $ sudo locate crtn.o
       o Create a soft link of these files in /usr/lib/ directory in
         order to the linker is able to find it:
           + $ sudo ln -s /usr/lib/i386-linux-gnu/crt1.o /usr/lib/crt1.o
           + $ sudo ln -s /usr/lib/i386-linux-gnu/crti.o /usr/lib/crti.o
           + $ sudo ln -s /usr/lib/i386-linux-gnu/crtn.o /usr/lib/crtn.o
   * *"/usr/bin/ld: cannot find -lgcc_s",*
       o Find the directory where the library is:
           + $ sudo locate gcc_s
       o If you have many (i386, i486, i686,..), select the appropriate
         one for your compiler and create a soft link:
           + $ sudo ln -s /lib/i386-linux-gnu/libgcc_s.so.1
             /usr/lib/libgcc_s.so


Ben


On 07/28/2013 10:57 PM, Jonathan Le Gouestre wrote:
> Dear users,
>
> I contact you because i m a begineer and i want to install Fluka on my Ubuntu 12.10, and i got a problem during the Fluka's installation.
> In fact when i do the "make", I got following error :
>
> gcc version 3.4.6 (Ubuntu 3.4.6-6ubuntu5)
> /usr/lib/gcc/i486-linux-gnu/3.4.6/collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o flukahp crt1.o crti.o /usr/lib/gcc/i486-linux-gnu/3.4.6/crtbegin.o -L/home/thibaut/fluka -L/usr/lib/gcc/i486-linux-gnu/3.4.6 -L/usr/lib/gcc/i486-linux-gnu/3.4.6 -L/usr/lib/gcc/i486-linux-gnu/3.4.6/../../../../lib -L/usr/lib/gcc/i486-linux-gnu/3.4.6/../../.. -L/lib/../lib -L/usr/lib/../lib -Map flukahp.map fluka.o -lflukahp -lfrtbegin -lg2c -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/i486-linux-gnu/3.4.6/crtend.o crtn.o
> /usr/bin/ld: cannot find crt1.o: No such file or directory
> /usr/bin/ld: cannot find crti.o: No such file or directory
> /usr/bin/ld: cannot find -lgcc_s
> collect2: ld returned 1 exit status
> cd flutil; FLUPRO=/home/thibaut/fluka make all; cd ..
> make[1]: Entering directory `/home/thibaut/fluka/flutil'
> /home/thibaut/fluka/flutil/fff -N actdline.f
> /home/thibaut/fluka/flutil/fff: 118: [[: not found
> actdline:
> lstnbl:
> /home/thibaut/fluka/flutil/fff -N hpadd.f
> /home/thibaut/fluka/flutil/fff: 118: [[: not found
> hpadd:
> lstnbl:
> /home/thibaut/fluka/flutil/fff -N hpc.f
> /home/thibaut/fluka/flutil/fff: 118: [[: not found
> hpc:
> hpc.f: In program `hpc':
> In file included from hpc.f:0:
> hpc.f:5: warning: unused variable 'chlc'
> hpc.f:5: warning: unused variable 'chuc'
> lstnbl:
> uctolc:
> lctouc:
> /home/thibaut/fluka/flutil/fff -N hpfor.f
> /home/thibaut/fluka/flutil/fff: 118: [[: not found
> hpfor:
> hpfor.f: In program `hpfor':
> In file included from hpfor.f:0:
> hpfor.f:5: warning: unused variable 'chlc'
> hpfor.f:5: warning: unused variable 'chuc'
> lstnbl:
> uctolc:
> lctouc:
> g77 -O3 -g -mcpu=pentiumpro -fexpensive-optimizations -funroll-loops -fstrength-reduce -Wall -fno-automatic -fno-silent -ffortran-bounds-check -m32 -o actdline actdline.o
> /usr/bin/ld: cannot find crt1.o: No such file or directory
> /usr/bin/ld: cannot find crti.o: No such file or directory
> /usr/bin/ld: cannot find -lgcc_s
> collect2: ld returned 1 exit status
> make[1]: *** [actdline] Error 1
> make[1]: Leaving directory `/home/thibaut/fluka/flutil'
>
>
> I don't understand the error because i follow strictly your instructions of the manual instalation, i mean i'm doing the following commands in my terminal :
>
> After having created a new folder "Fluka", and uncompressed the targz inside it :
>
> 1 -> export FLUPRO
> 2 -> FLUFOR=gfortran make
>
> Beforehand i downloaded the next package, with sudo apt-get :
> 1 - Build-essential
> 2 - gfortran (for g77/GCC)
> 3 - python
> 4 - tcl
> 5 - python-imaging-tk
>
> I think it's a linking's problem beetween my libraries, but i don't understand why because i do the link with this command :
>
> export LIBRARY_PATH
>
> By reading the solutions on the mailing list, i tryed to resolve this problem but i spend a lot of time without resolving it, i don't find any way out.
>
> Could you help me please ?
>
> Thanks a lot,
>
>
> Jonathan Le Gouestre
>
>
Received on Mon Jul 29 2013 - 23:00:16 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 29 2013 - 23:00:20 CEST