R: upgrading Hmisc on Debian Lenny
When I bring up a basic image of Debian Lenny on EC2 (actually EMR on EC2) I get Lenny version 5.0.7 and I am able to upgrade R using the method outlined in a previous question. After upgrading R I have version 2.12.
I've been unable to then install the Hmisc package. I see that it has a Debian package so I've tried:
sudo apt-get update
sudo apt-get install r-cran-hmisc
Which seems to work, but when I go into R I get the following:
> require(Hmisc)
Loading required package: Hmisc
Failed with error: ‘package 'Hmisc' was built before R 2.10.0: please re-install it’
so I presume the Hmisc in the Debian repo is an old version. So I'll just upgrade. So I go into R and:
install.packages("Hmisc")
which fails with:
...
gcc -I/usr/share/R/include -fpic -std=gnu99 -O3 -pipe -g -c string_box.c -o string_box.o
gfortran -fpic -O3 -pipe -g -c wclosest.f -o wclosest.o
gcc -shared -o Hmisc.so Hmisc.o cidxcn.o cidxcp.o hoeffd.o jacklins.o largrec.o mChoice.o nstr.o ranksort.o rcorr.o string_box.o wclosest.o -lgfortran -lm -L/usr/lib64/R/lib -lR
/usr/bin/ld: cannot find -lgfortran
collect2: ld returned 1 exit st开发者_开发百科atus
make: *** [Hmisc.so] Error 1
ERROR: compilation failed for package ‘Hmisc’
* removing ‘/home/hadoop/R/x86_64-pc-linux-gnu-library/2.12/Hmisc’
The downloaded packages are in
‘/tmp/Rtmp2Ej5Tn/downloaded_packages’
Warning message:
In install.packages("Hmisc") :
installation of package 'Hmisc' had non-zero exit status
>
It appears like ld is struggling with lgfortran. I checked and gfortran is installed. So I tried installing gfortran-4.1:
sudo apt-get install gfortran-4.1
That didn't change anything. Nor did installing 4.2.
Any tips on what to try next?
What happens when you install the r-base-dev
package? Does it build then? It should.
I stumbled upon this previous question right after I posted here. It appears I need to manually link to the gfortran libraries:
sudo ln -s /usr/lib/libgfortran.so.3 /usr/lib/libgfortran.so
After updating the cluster package I am able to install.packages("Hmisc")
精彩评论