1

This is the issue when I try to install quantreg in R, I was initially trying to install scde when I saw there was an error installing quantreg, So I am trying to install quantreg first.

install.packages("quantreg")
Installing package into ‘/home/aditya/R/x86_64-pc-linux-gnu-   library/3.3’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/quantreg_5.29.tar.gz'
Content type 'application/x-gzip' length 1722772 bytes (1.6 MB)
==================================================
downloaded 1.6 MB

* installing *source* package ‘quantreg’ ...
** package ‘quantreg’ successfully unpacked and MD5 sums checked
** libs

gfortran -fpic -g -O2 -fstack-protector-strong -c akj.f -o akj.o
gfortran -fpic -g -O2 -fstack-protector-strong -c boot.f -o boot.o
gfortran -fpic -g -O2 -fstack-protector-strong -c bound.f -o bound.o
gfortran -fpic -g -O2 -fstack-protector-strong -c boundc.f -o boundc.o
gfortran -fpic -g -O2 -fstack-protector-strong -c brute.f -o brute.o
gfortran -fpic -g -O2 -fstack-protector-strong -c chlfct.f -o chlfct.o
gfortran -fpic -g -O2 -fstack-protector-strong -c cholesky.f -o cholesky.o
gfortran -fpic -g -O2 -fstack-protector-strong -c combos.f -o combos.o
gfortran -fpic -g -O2 -fstack-protector-strong -c crq.f -o crq.o
gfortran -fpic -g -O2 -fstack-protector-strong -c crqfnb.f -o crqfnb.o
gfortran -fpic -g -O2 -fstack-protector-strong -c dsel05.f -o dsel05.o
gfortran -fpic -g -O2 -fstack-protector-strong -c etime.f -o etime.o
gfortran -fpic -g -O2 -fstack-protector-strong -c extract.f -o extract.o
gfortran -fpic -g -O2 -fstack-protector-strong -c idmin.f -o idmin.o
gfortran -fpic -g -O2 -fstack-protector-strong -c iswap.f -o iswap.o
gfortran -fpic -g -O2 -fstack-protector-strong -c kuantile.f -o kuantile.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-        protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c mcmb.c -o mcmb.o
gfortran -fpic -g -O2 -fstack-protector-strong -c penalty.f -o penalty.o
gfortran -fpic -g -O2 -fstack-protector-strong -c powell.f -o powell.o
gfortran -fpic -g -O2 -fstack-protector-strong -c rls.f -o rls.o
gfortran -fpic -g -O2 -fstack-protector-strong -c rq0.f -o rq0.o
gfortran -fpic -g -O2 -fstack-protector-strong -c rq1.f -o rq1.o
gfortran -fpic -g -O2 -fstack-protector-strong -c rqbr.f -o rqbr.o
gfortran -fpic -g -O2 -fstack-protector-strong -c rqfn.f -o rqfn.o
gfortran -fpic -g -O2 -fstack-protector-strong -c rqfnb.f -o rqfnb.o
gfortran -fpic -g -O2 -fstack-protector-strong -c rqfnc.f -o rqfnc.o
gfortran -fpic -g -O2 -fstack-protector-strong -c rqs.f -o rqs.o
gfortran -fpic -g -O2 -fstack-protector-strong -c sparskit2.f -o sparskit2.o
gfortran -fpic -g -O2 -fstack-protector-strong -c srqfn.f -o srqfn.o
gfortran -fpic -g -O2 -fstack-protector-strong -c srqfnc.f -o srqfnc.o
gfortran -fpic -g -O2 -fstack-protector-strong -c srtpai.f -o srtpai.o
gcc -std=gnu99 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-        z,relro -o quantreg.so akj.o boot.o bound.o boundc.o brute.o chlfct.o     cholesky.o combos.o crq.o crqfnb.o dsel05.o etime.o extract.o idmin.o     iswap.o kuantile.o mcmb.o penalty.o powell.o rls.o rq0.o rq1.o rqbr.o     rqfn.o rqfnb.o rqfnc.o rqs.o sparskit2.o srqfn.o srqfnc.o srtpai.o -        llapack -lblas -lgfortran -lm -lquadmath -lgfortran -lm -lquadmath -        L/usr/lib/R/lib -lR
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.9/libgfortran.a(etime.o):     relocation R_X86_64_32 against `.rodata.str1.8' can not be used when     making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.9/libgfortran.a: error adding symbols:     Bad value
collect2: error: ld returned 1 exit status
/usr/share/R/share/make/shlib.mk:6: recipe for target 'quantreg.so' failed
make: *** [quantreg.so] Error 1
ERROR: compilation failed for package ‘quantreg’
* removing ‘/home/aditya/R/x86_64-pc-linux-gnu-library/3.3/quantreg’
Warning in install.packages :
installation of package ‘quantreg’ had non-zero exit status

The downloaded source packages are in
‘/tmp/RtmpXFNEIR/downloaded_packages’

Previously I had a similar issue with lgfortran which I solved with this link https://askubuntu.com/a/680100/586038 following the above post instructions my current version of gcc used is in

/usr/bin/gcc-4.9 

Now

find /usr/lib/gcc/x86_64-linux-gnu/ -iname "libgfortran"

gave me the path

/usr/bin/gcc-5

then I did

cd /usr/lib/gcc/x86_64-linux-gnu/4.9/

sudo ln -s /usr/lib/gcc/x86_64-linux-gnu/5/libgfortran.a libgfortran.a

Presently I have the file libgfortran.so in

/usr/lib/gcc/x86_64-linux-gnu/5/

but not in

/usr/lib/gcc/x86_64-linux-gnu/4.9/

What shall I do to resolve this issue

Community
  • 1
  • 1
Aditya2956
  • 11
  • 4
  • 1
    It looks like you are missing the dynamic version of libgfortran. Try to find `libgfortran.so` or `libgfortran.3.so` or similar in your system. How did you install gfortran? – Vladimir F Героям слава Feb 13 '17 at 08:00
  • I installed gcc maybe fortran got installed from that , I also tried – Aditya2956 Feb 13 '17 at 13:10
  • sudo apt-get install libgfortran-5-dev – Aditya2956 Feb 13 '17 at 13:10
  • So have you searched for the `.so` file? *"I had previously had issues with gfortran installation , but now I have fixed it by copying the lgfortran.a file"* This is worrying. You **cannot** use the `.a` file, you need the `.so` file. – Vladimir F Героям слава Feb 13 '17 at 13:47
  • What I meant was that http://askubuntu.com/questions/276892/cannot-find-lgfortran following the answer by PeacefulDaemon , I found my current gcc version used is 4.9 , and this command gave me find /usr/lib/gcc/x86_64-linux-gnu/ -iname "libgfortran" the output as /usr/bin/gcc-5 So I deleted libgfortran file in /usr/bin/gcc-4.9 and created a symbolic link cd /usr/lib/gcc/x86_64-linux-gnu/4.9/ sudo ln -s /usr/lib/gcc/x86_64-linux-gnu/5/libgfortran.a libgfortran.a After you said I also found libgfortran.so in /usr/lib/gcc/x86_64-linux-gnu/5/ but not in 4.9 So what should I do – Aditya2956 Feb 13 '17 at 14:01
  • 1
    Please describe what you did *in steps* in the question. Please take care to describe it *very clearly*. You last comment is hard to understand. – Vladimir F Героям слава Feb 13 '17 at 14:04
  • can you check now – Aditya2956 Feb 13 '17 at 14:44
  • Ok, the copying of libgfortran.a is not good at all. Delete it and install gfortran in your GCC 4.9 properly including gfortran. And **I repeat** the `libgfortran.a` **will not help you** you **MUST** use the .so version. – Vladimir F Героям слава Feb 13 '17 at 14:47
  • " install gfortran in your GCC 4.9 properly including gfortran" - what does this mean - please give the command what I should do - I do not want to mess up again . Should I just go and delete libgfortran.a from 4.9 folder – Aditya2956 Feb 13 '17 at 14:58
  • Don't do any copying, delete the files you copied. Install GCC as it should be installed. I do not use Ubuntu, so I don't know the name of the package, but use your package manager (apt-get). – Vladimir F Героям слава Feb 13 '17 at 15:01
  • 1
    `sudo apt-get install libgfortran3` (this is the shared library for gfortran 5) – Pierre de Buyl Feb 13 '17 at 20:34
  • (this is directly following Vladimir F instruction and is for Ubutnu 16.04) – Pierre de Buyl Feb 13 '17 at 20:47

0 Answers0