Search code examples
rinstallationdevtoolsrstan

R packages failed to install: x86_64-apple-darwin13.4.0-ar: No such file or directory - What is "ar"?


I go this error when installing R packages like RStan (and anything that depends on it such as brms) and Devtools. Since in the message displayed during the installation, everything before this look normal, I think the failure to install can be boiled down to this:

/Users/lambda/anaconda3/bin/x86_64-apple-darwin13.4.0-ar -rs ../lib/libStanHeaders.a cvodes/src/cvodes/cvodes.o cvodes/src/cvodes/cvodes_io.o cvodes/src/cvodes/cvodea.o cvodes/src/cvodes/cvodea_io.o cvodes/src/cvodes/cvodes_direct.o cvodes/src/cvodes/cvodes_band.o cvodes/src/cvodes/cvodes_dense.o cvodes/src/cvodes/cvodes_diag.o cvodes/src/cvodes/cvodes_spils.o cvodes/src/cvodes/cvodes_spbcgs.o cvodes/src/cvodes/cvodes_spgmr.o cvodes/src/cvodes/cvodes_sptfqmr.o cvodes/src/cvodes/cvodes_sparse.o cvodes/src/cvodes/cvodes_bandpre.o cvodes/src/cvodes/cvodes_bbdpre.o cvodes/src/sundials/sundials_band.o cvodes/src/sundials/sundials_direct.o cvodes/src/sundials/sundials_math.o cvodes/src/sundials/sundials_pcg.o cvodes/src/sundials/sundials_spbcgs.o cvodes/src/sundials/sundials_spgmr.o cvodes/src/sundials/sundials_dense.o cvodes/src/sundials/sundials_iterative.o cvodes/src/sundials/sundials_nvector.o cvodes/src/sundials/sundials_sparse.o cvodes/src/sundials/sundials_spfgmr.o cvodes/src/sundials/sundials_sptfqmr.o cvodes/src/nvec_ser/nvector_serial.o
make: /Users/lambda/anaconda3/bin/x86_64-apple-darwin13.4.0-ar: No such file or directory
make: *** [static] Error 1
ERROR: compilation failed for package ‘StanHeaders’

I got this same error both with Xcode compiler and clang4 compiler; I don't think the problem is with the compiler, but with the thing called ar. BTW, I have installed Rcpp and it works. I have seen others having the same problem when installing RPy2. So what is that ar thing and how to fix it?

R version:

> version
           _                           
platform       x86_64-apple-darwin13.4.0   
arch           x86_64                      
os             darwin13.4.0                
system         x86_64, darwin13.4.0        
status                                     
major          3                           
minor          4.2                         
year           2017                        
month          09                          
day            28                          
svn rev        73368                       
language       R                           
version.string R version 3.4.2 (2017-09-28)
nickname       Short Summer

Solution

  • I already solved this problem. I got this problem when using RStudio inside Anaconda. Later I installed R 3.4.3 and RStudio outside Anaconda and everything went smoothly. It might have been some problem with the Anaconda RStudio.