0

I'm trying to install the package, rugarch, for a class.

I am using MacOS Mojave 10.14.6 (18G3020).

I am using RStudio: R version 3.5.1 (2018-07-02) -- "Feather Spray" Copyright (C) 2018 The R Foundation for Statistical Computing

Platform: x86_64-apple-darwin15.6.0 (64-bit)

Most of the forums I searched on report the need for Xquartz, but I already have installed it. I also and searched through https://thecoatlessprofessor.com/programming/cpp/r-compiler-tools-for-rcpp-on-macos-before-r-3.6.0/

Wondering what to try next. I'm thinking the problem has to do with my file path, which may have been mucked up from installing both clang4 and clang6?...... Error message below involves a compiler issue: 'make: *** [RcppArmadillo.o] Error 127'. Thanks for your help!

> install.packages('rugarch')
also installing the dependency ‘RcppArmadillo’

trying URL 'https://mran.microsoft.com/snapshot/2018-08-01/src/contrib/RcppArmadillo_0.8.600.0.0.tar.gz'
Content type 'application/octet-stream' length 1356993 bytes (1.3 MB)
==================================================
downloaded 1.3 MB

trying URL 'https://mran.microsoft.com/snapshot/2018-08-01/src/contrib/rugarch_1.4-0.tar.gz'
Content type 'application/octet-stream' length 2936961 bytes (2.8 MB)
==================================================
downloaded 2.8 MB

* installing *source* package ‘RcppArmadillo’ ...
** package ‘RcppArmadillo’ successfully unpacked and MD5 sums checked
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ accepts -g... yes
checking how to run the C++ preprocessor... clang++ -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether clang++ accepts -g... (cached) yes
checking whether g++ version is sufficient... almost
checking for macOS... configure: WARNING: Compiler self-identifies as being compliant with GNUC extensions but is not g++.
found
checking for macOS Apple compiler... not found
checking for clang compiler... found
checking for OpenMP compatible version of clang... found and suitable
checking LAPACK_LIBS... system LAPACK found
checking for OpenMP... found and suitable
configure: creating ./config.status
config.status: creating inst/include/RcppArmadilloConfigGenerated.h
config.status: creating src/Makevars
** libs
/usr/local/clang4/bin/clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.5.1-MRO/Resources/library/Rcpp/include" -DU_STATIC_IMPLEMENTATION -Wall -mtune=core2 -g -O2 -I/opt/X11/include  -I../inst/include -fopenmp -fPIC  -DU_STATIC_IMPLEMENTATION -Wall -mtune=core2 -g -O2 -I/opt/X11/include -c RcppArmadillo.cpp -o RcppArmadillo.o
/bin/sh: /usr/local/clang4/bin/clang++: No such file or directory
make: *** [RcppArmadillo.o] Error 127
ERROR: compilation failed for package ‘RcppArmadillo’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5.1-MRO/Resources/library/RcppArmadillo’
Warning in install.packages :
  installation of package ‘RcppArmadillo’ had non-zero exit status
ERROR: dependency ‘RcppArmadillo’ is not available for package ‘rugarch’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5.1-MRO/Resources/library/rugarch’
Warning in install.packages :
  installation of package ‘rugarch’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/bm/wg7t4j8j3tz_88yfzyfdkkhm0000gn/T/RtmpvkSK0v/downloaded_packages’
  • 2
    Try installing the RcppArmadillo package first. You may need to quit and restart R first. – Dave2e Jun 05 '20 at 01:45
  • @Dave2e, didn't work :(. > install.packages("RcppArmadillo") /bin/sh: /usr/local/clang4/bin/clang++: No such file or directory make: *** [RcppArmadillo.o] Error 127 ERROR: compilation failed for package ‘RcppArmadillo’ * removing ‘/Library/Frameworks/R.framework/Versions/3.5.1-MRO/Resources/library/RcppArmadillo’ Warning in install.packages : installation of package ‘RcppArmadillo’ had non-zero exit status – hohaddict Jun 05 '20 at 04:59
  • @Dave2e just checking if you had any suggestions on this followup? thanks! – hohaddict Jun 07 '20 at 23:28
  • Looking at the error message it looks I agree that the complier set-up on your Mac may be the issue. It also seems you are trying to install an over version. I would type downloading the binary version and not the source if possible. Try: `install.packages("RcppArmadillo", type="binary)` and thus avoiding the need to compile. Updating to the version 3.6.3 of R might help, but a long shot. – Dave2e Jun 08 '20 at 02:37
  • @Dave2e I tried downloading the binary version and got this: Error in install.packages : type 'binary' is not supported on this platform I guess I can try upgrading to Rv3.6.3? I'm using 3.5.1 because of my class though and the professor said version newer than 3.5.1 require extra add-ons.....Is this true? – hohaddict Jun 09 '20 at 04:21
  • I don't know the finer details between the different R versions. The only easy option left, is to try is to find someone else in class with a similar setup and copy the RcppArmadillo folder from them. If that doesn't work then you will to need figure out the compiler issue. – Dave2e Jun 09 '20 at 11:50
  • @Dave2e yeah....this is such a pain. thanks for your help! I will keep looking – hohaddict Jun 10 '20 at 18:03

0 Answers0