1

Unable to make three previously described ways to manually install an old package (VGAM) for an old version of R (v3.3.3) to work on Platform: x86_64-apple-darwin13.4.0 (64-bit)

Previous threads on this subject that I have attempted to draw from:

Manually Downloading and Installing Packages in R

"installation of package 'FILE_PATH' had non-zero exit status" in R

I am running a Mac OS 10.9.5, so I have to run R v3.3.3. As such, I cannot load the current version of the VGAM package, so I've been trying and failing to install previous versions of it by playing with the below code, but all three attempts result in a non-zero exit status. It appears that there is a problem with gfortran? Not sure what this is or what it does.

install.packages('VGAM_1.0-2.tar.gz', lib = "/Users/benny/Google Drive/SEDGWICK PROJECT GRANIVORES/R", repos = NULL, dependencies = TRUE)
download.file('https://cran.r-project.org/src/contrib/Archive/VGAM/VGAM_1.0-0.tar.gz', 
              f <- tempfile())
untar(f, exdir=tempdir())
file.copy(file.path(tempdir(), '.RData'), 'VGAM.RData')
# the above copies the .RData file to a file called VGAM.RData in your current 
# working directory.
load('VGAM.RData')
download.file('https://cran.r-project.org/src/contrib/Archive/VGAM/VGAM_1.0-0.tar.gz',
              f <- tempfile())
untar(f, exdir=tempdir())
load(file.path(tempdir(), '.RData'))

I expect to successfully install the VGAM package, but I get the following error messages, for each code chunk, respectively:

>* installing *source* package ‘VGAM’ ...
** package ‘VGAM’ successfully unpacked and MD5 sums checked
** libs
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include    -fPIC  -Wall -mtune=core2 -g -O2  -c caqo3.c -o caqo3.o
gfortran-4.8   -fPIC  -g -O2  -c cqof.f -o cqof.o
make: gfortran-4.8: No such file or directory
make: *** [cqof.o] Error 1
ERROR: compilation failed for package ‘VGAM’
* removing ‘/Users/benny/Google Drive/SEDGWICK PROJECT GRANIVORES/R/VGAM’
* restoring previous ‘/Users/benny/Google Drive/SEDGWICK PROJECT GRANIVORES/R/VGAM’
Warning in install.packages :
  installation of package ‘VGAM_1.0-2.tar.gz’ had non-zero exit status

For the second chunk/attempt, the file.copy() method just produces "FALSE" output, and does not appear to properly create the 'VGAM.RData' file like I want it to:

[1] FALSE

> load('VGAM.RData')

cannot open compressed file 'VGAM.RData', probable reason 'No such file or directory'
Error in readChar(con, 5L, useBytes = TRUE) : cannot open the connection

The third chunk/attempt returns the following error:

cannot open compressed file '/var/folders/03/9d3s2ktx79l_wm7n2w9vmcdh0000gn/T//Rtmpdb04UI/.RData', probable reason 'No such file or directory'
Error in readChar(con, 5L, useBytes = TRUE) : cannot open the connection
r2evans
  • 141,215
  • 6
  • 77
  • 149
  • `gfortran` is a *compiler*, needed to compile the source code in the `.tar.gz` file you downloaded into executable code. Likely duplicate of https://stackoverflow.com/q/23916219/3358272. (Nothing after *"gfortran-4.8: No such file or directory"* is relevant until this problem is resolved.) – r2evans May 19 '19 at 03:46
  • @r2evans thanks for pointing me to the first line of correction. Will add a comment after installing and redirecting R to the compatible gfortran package – benny_noJets May 20 '19 at 18:38
  • The gfortran download I need for my OS appears to be gfortran-4.2.3, which is available from https://cran.ism.ac.jp/bin/macosx/tools/ as a .pkg (it installs itself). I reloaded R after installing this, but did not see any changes. Am I missing something here? – benny_noJets May 20 '19 at 19:06
  • I understand, and even CRAN lists `gfortran-4.2.3` as its version (ref: https://cran.r-project.org/bin/macosx/tools/), so unfortunately I do not understand why your OS is suggesting 4.8. Possibly related: https://github.com/Homebrew/legacy-homebrew/issues/43290 and https://github.com/metrumresearchgroup/mrgsolve/issues/7 – r2evans May 20 '19 at 19:51

0 Answers0