Skip to content
Prev 1723 / 15076 Next

R Package compilation problem with Fortran

I typically use R from within X11 but when installing packages I 
typically used the Aqua GUI...

So from within the GUI...I select 'Packages & Data' --> 'Package 
Installer'  and after selecting the Hmisc package, I then click on 
'Install Selected'.  Then I received the error that g77 is not found.

In addition, from within the R console, typing system('which g77') 
yields '/sw/bin/g77'
I have not used R CMD INSTALL before.  So I downloaded the package 
source onto my Desktop, unzipped it, and then typed:  R CMD INSTALL 
/Users/brianbeckage/Desktop/Hmisc

* Installing *source* package 'Hmisc' ...
** libs
g77   -fno-common  -g -O2 -c cidxcn.f -o cidxcn.o
g77   -fno-common  -g -O2 -c cidxcp.f -o cidxcp.o
g77   -fno-common  -g -O2 -c hoeffd.f -o hoeffd.o
g77   -fno-common  -g -O2 -c jacklins.f -o jacklins.o
g77   -fno-common  -g -O2 -c largrec.f -o largrec.o
gcc-3.3 -no-cpp-precomp 
-I/Library/Frameworks/R.framework/Resources/include 
-I/usr/local/include   -fno-common  -g -O2 -c ranksort.c -o ranksort.o
g77   -fno-common  -g -O2 -c rcorr.f -o rcorr.o
g77   -fno-common  -g -O2 -c wclosest.f -o wclosest.o
gcc-3.3 -bundle -flat_namespace -undefined suppress -L/usr/local/lib 
-o Hmisc.so cidxcn.o cidxcp.o hoeffd.o jacklins.o largrec.o 
ranksort.o rcorr.o wclosest.o 
-L/usr/local/lib/gcc/powerpc-apple-darwin6.8/3.4.2 -lg2c -lSystem 
-lcc_dynamic -framework R
ld: warning -L: directory name 
(/usr/local/lib/gcc/powerpc-apple-darwin6.8/3.4.2) does not exist
ld: can't locate file for: -lg2c
make: *** [Hmisc.so] Error 1
ERROR: compilation failed for package 'Hmisc'
** Removing 
'/Library/Frameworks/R.framework/Versions/2.1.0/Resources/library/Hmisc'
** Restoring previous 
'/Library/Frameworks/R.framework/Versions/2.1.0/Resources/library/Hmisc'

Any ideas?

Thanks again for your help.
Brian