Bug#610291: libgfortran: /usr/bin/ld: cannot find -lgfortran
On 01/17/11 13:07, Matthias Klose wrote:
> On 17.01.2011 08:19, Kingsley G. Morse Jr. wrote:
> >Package: libgfortran3
> >Version: 4.4.5-10
> >Severity: normal
> >File: libgfortran
> >
> >
> >Thanks for maintaining libgfortran3.
> >
> >I use it.
> >
> >I happened to notice that building some R packages
> >from their source code elicited an error about
> >not being able to find gfortran's library.
> >
> >Here's one way that I found tne bug.
> >
> > $ R
> > > install.package("amap")
> > gfortran -fpic -O3 -pipe -g -c pop.f -o pop.o
> > g++ -shared -o amap.so acprob.o burt.o diss.o distance.o distance_T.o
> > hclust.o hclust_T.o kmeans.o pop.o -lpthread -lgfortran -lm
> > -L/usr/lib/R/lib -lR
> > /usr/bin/ld: cannot find -lgfortran
> > collect2: ld returned 1 exit status
> > make: *** [amap.so] Error 1
> > ERROR: compilation failed for package 'amap'
> >
> >The other way was
> >
> > > install.package("kernlab")
> >
> >I fixed them by doing
> >
> > $ ln -s /usr/lib/libgfortran.so.3.0.0 /usr/lib/libgfortran.so
> >
> >If possible, maybe the libgfortran3 package should
> >create a similar symbolic link.
>
> No, the link is present. which g++ do you use?
>
> which g++
> g++ --print-file-name libgfortran.so
Hi Matthias,
Thank you for replying quickly.
I typed the two commands in your email.
Here's what happened:
$ which g++
/usr/bin/g++
$ ls -l /usr/bin/g++
lrwxrwxrwx 1 root root 7 2009-03-22 10:49 /usr/bin/g++ -> g++-4.3
$ g++ --print-file-name libgfortran.so
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libgfortran.so
Then I removed the symbolic link for
/usr/lib/libgfortran.so that fixed my problem, and
ran g++ again.
$ rm /usr/lib/libgfortran.so
$ g++ --print-file-name libgfortran.so
libgfortran.so
Does that help?
Thanks,
Kingsley
Reply to: