Failing to download packages - installation of package ‘rrcov’ had non-zero exit status

Trying to download some packages and I keep getting a similar error:

First example: rrcov package

I've tried downloading by going to tools -> install packages -> CRAN; rrcov; default library -> install. I've also tried to download the .tgz file as well and doing install packages -> file -> install.

I then get this message:

> install.packages("rrcov")
Installing package into ‘/usr/local/lib/R/3.6/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/rrcov_1.5-2.tar.gz'
Content type 'application/x-gzip' length 1020006 bytes (996 KB)
==================================================
downloaded 996 KB

* installing *source* package ‘rrcov’ ...
** package ‘rrcov’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
clang -I"/usr/local/Cellar/r/3.6.2/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/include  -fPIC  -g -O2  -c R-rng4ftn.c -o R-rng4ftn.o
clang -I"/usr/local/Cellar/r/3.6.2/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/include  -fPIC  -g -O2  -c covOPW.c -o covOPW.o
gfortran -fno-optimize-sibling-calls  -fPIC  -g -O2  -c ds11.f -o ds11.o
ds11.f:268:72:

  268 |   100 AUX(I)=Z(I)
      |                                                                        1
Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 100 at (1)
ds11.f:292:72:

  292 |       IF(SWITCH) 810,810,800
      |                                                                        1
Warning: Fortran 2018 deleted feature: Arithmetic IF statement at (1)
clang -I"/usr/local/Cellar/r/3.6.2/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/include  -fPIC  -g -O2  -c fast-mve.c -o fast-mve.o
gfortran -fno-optimize-sibling-calls  -fPIC  -g -O2  -c fsada.f -o fsada.o
fsada.f:350:72:

  350 | 45            sum = sum + cinv(i,k) * (data(k,j) - ave(k,ngp))
      |                                                                        1
Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 45 at (1)
fsada.f:383:72:

  383 | 60                  sum=sum+(data(k,icas)-ave(k,ngp))*datimg(k,j)
      |                                                                        1
Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 60 at (1)
fsada.f:446:72:

  446 |    do 70 j = 1, i
      |                                                                        1
Warning: Fortran 2018 deleted feature: Shared DO termination label 70 at (1)
fsada.f:467:72:

  467 |  81    sum = sum + cinv(i,j) * devj(j)
      |                                                                        1
Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 81 at (1)
fsada.f:473:72:

  473 |    do 85 j = 1, nord
      |                                                                        1
Warning: Fortran 2018 deleted feature: Shared DO termination label 85 at (1)
fsada.f:474:72:

  474 |  85    cinv(i,j) = cinv(i,j) - devi(i) * devi(j) * factor
      |                                                                        1
Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 85 at (1)
fsada.f:490:72:

  490 |  15   sum = sum + cov(i,k) * cinv(k,j)
      |                                                                        1
Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 15 at (1)
clang -I"/usr/local/Cellar/r/3.6.2/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/include  -fPIC  -g -O2  -c rrcov_init.c -o rrcov_init.o
clang -I"/usr/local/Cellar/r/3.6.2/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/include  -fPIC  -g -O2  -c sest.c -o sest.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/Cellar/r/3.6.2/lib/R/lib -L/usr/local/opt/gettext/lib -L/usr/local/opt/readline/lib -L/usr/local/lib -o rrcov.so R-rng4ftn.o covOPW.o ds11.o fast-mve.o fsada.o rrcov_init.o sest.o -L/usr/local/opt/openblas/lib -lopenblas -L/usr/local/opt/gcc/lib/gcc/9/gcc/x86_64-apple-darwin18/9.2.0 -L/usr/local/opt/gcc/lib/gcc/9 -lgfortran -lquadmath -lm -L/usr/local/opt/gcc/lib/gcc/9/gcc/x86_64-apple-darwin18/9.2.0 -L/usr/local/opt/gcc/lib/gcc/9 -lgfortran -lquadmath -lm -L/usr/local/Cellar/r/3.6.2/lib/R/lib -lR -lintl -Wl,-framework -Wl,CoreFoundation
ld: warning: could not create compact unwind for _reader_: stack subq instruction is too different from dwarf stack size
installing to /usr/local/lib/R/3.6/site-library/00LOCK-rrcov/00new/rrcov/libs
** R
** data
** inst
** byte-compile and prepare package for lazy loading
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/usr/local/lib/R/3.6/site-library/pcaPP/libs/pcaPP.so':
  dlopen(/usr/local/lib/R/3.6/site-library/pcaPP/libs/pcaPP.so, 6): Library not loaded: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib
  Referenced from: /usr/local/lib/R/3.6/site-library/pcaPP/libs/pcaPP.so
  Reason: image not found
Calls: <Anonymous> ... namespaceImport -> loadNamespace -> library.dynam -> dyn.load
Execution halted
ERROR: lazy loading failed for package ‘rrcov’
* removing ‘/usr/local/lib/R/3.6/site-library/rrcov’
Warning in install.packages :
  installation of package ‘rrcov’ had non-zero exit status

The downloaded source packages are in
	‘/private/var/folders/_m/g6gbjyxx1xn94186vvmvkb_r0000gp/T/Rtmp7Z9gvo/downloaded_packages’

So I am assuming this means it is not downloading successfully. Any ideas why? I can't find anything about it going wrong. I have the most updated version of R Studio (1.2.5033), and using a MacBook Pro Mojave 10.14.6.

Thank you!

Hi, and welcome!

The short answer is that the rrcov package requires compilation from C/C++/FORTRAN source code, and that is failing on your set up.

This is what I see

> install.packages("rrcov")
Installing package into ‘/Users/rc/Library/R/3.6/library’
(as ‘lib’ is unspecified)
trying URL 'https://ftp.osuosl.org/pub/cran/bin/macosx/el-capitan/contrib/3.6/rrcov_1.5-2.tgz'
Content type 'application/x-gzip' length 1723165 bytes (1.6 MB)
==================================================
downloaded 1.6 MB

The downloaded binary packages are in
	/var/folders/vw/p54wdfm95lq9wf8jkwxg_qpw0000gp/T//Rtmp9Jtp40/downloaded_packages

Possible reasons for the difference:

  1. Mojave vs Catalina
  2. R installed by brew, rather than the package from RStudio
  3. XCode not installed or
  4. XCode command line utility not installed with
$ xcode-select --install

or
5) The R version is less than 3.6.2, which fixed a similar problem with FORTRAN

What I'd suggest (and did with my own MacOS laptop):

  1. Use app zap or another terminator to completely remove R or
brew uninstall R
  1. Upgrade to Catalina
  2. Install R from the https://cran.r-project.org site
  3. Install XCode from the App Store
  4. Use xcode-select --install
  5. Install the RStudio IDE from the RStudio.com site
  6. Run `install.packages("rrcov").

In general, what you should expect if this works is that compiling packages from source will succeed for short source code and fail for longer. If you get an "exit status 1", it's unlikely to be something you can fix. In a week or10 days, Saint Simon Urbanek of the Core Development team will have done the dark magic needed to get a binary package that will load and run. So, lesson--give it a try, but if at first you don't succeed, wait.

Good luck. Report back if you get stuck..

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.