I've been going round in circles on the web for several hours now so I've given up and need to ask the pros.
I'm trying to install a newer version of R in a local folder on a Ubuntu server. I need a specific package (Phangorn), but the system wide copy of R is too old, and I can't upgrade it because it will break too many other people's dependencies (and I'm not the admin).
So, I downloaded the R-devel latest version and followed these excellent instructions (http://pj.freefaculty.org/blog/?p=315). I had to install my own copies of zlib, liblzma (XZ) and pcre (now in ~/packages
). I didn't need to do curl and bzip2 it seems. This caused enough problems as it is, but after much faffing, I was able to successfully compile R.
However, when I try to install Phangorn within it, it gives me the following errors:
/usr/bin/ld: cannot find -lgfortran
/usr/bin/ld: cannot find -lgfortran
collect2: error: ld returned 1 exit status
make: *** [igraph.so] Error 1
ERROR: compilation failed for package ‘igraph’
* removing ‘/home/wms_joe/bin/R-devel/library/igraph’
ERROR: dependency ‘igraph’ is not available for package ‘phangorn’
* removing ‘/home/wms_joe/bin/R-devel/library/phangorn’
The downloaded source packages are in
‘/tmp/RtmpahSdck/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning messages:
1: In install.packages("phangorn") :
installation of package ‘igraph’ had non-zero exit status
2: In install.packages("phangorn") :
installation of package ‘phangorn’ had non-zero exit status
So from what I can tell Phangorn depends on igraph which depends on gfortran, and R can't find it.
It looks to be the same problem as detailed in this thread: Building R package getting error "ld: cannot find -lgfortran "
But the solutions all seem to need softlinking and therefore requiring sudo which totally defeats the point of me doing a local install :/
What are my options here? If I download lgfortran for my own directory (assuming that even fixes the problem) where should I be linking it to?