Trouble Downloading rstanarm

I have been trying to install rstanarm for my Quant. methods class and I have gotten a multitude of errors. The most recent error I have received bellow.

My professor advised me to download XQuartz and xcode and it seems that neither have made a difference.

Any help would be much appreciated!

installing the source package ‘rstanarm’

trying URL 'https://cran.rstudio.com/src/contrib/rstanarm_2.21.1.tar.gz'
Content type 'application/x-gzip' length 3548723 bytes (3.4 MB)
==================================================
downloaded 3.4 MB

* installing *source* package ‘rstanarm’ ...
** package ‘rstanarm’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
"/Library/Frameworks/R.framework/Resources/bin/Rscript" -e "source(file.path('..', 'tools', 'make_cc.R')); make_cc(commandArgs(TRUE))" stan_files/bernoulli.stan
Wrote C++ file "stan_files/bernoulli.cc"


clang++ -std=gnu++14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/StanHeaders/include/src" -DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/StanHeaders/include" -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rstan/include" -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/BH/include" -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/RcppEigen/include" -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/RcppParallel/include" -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include `"/Library/Frameworks/R.framework/Resources/bin/Rscript" -e "RcppParallel::CxxFlags()"` `"/Library/Frameworks/R.framework/Resources/bin/Rscript" -e "StanHeaders:::CxxFlags()"` -fPIC  -Wall -g -O2  -c stan_files/bernoulli.cc -o stan_files/bernoulli.o
clang: warning: no such sysroot directory: '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk' [-Wmissing-sysroot]
In file included from stan_files/bernoulli.cc:1:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include/Rcpp.h:27:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include/RcppCommon.h:30:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include/Rcpp/r/headers.h:62:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include/Rcpp/platform/compiler.h:100:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:308:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/math.h:300:15: fatal error: 'math.h' file not found
#include_next <math.h>
              ^~~~~~~~
1 error generated.
make: *** [stan_files/bernoulli.o] Error 1
rm stan_files/bernoulli.cc
ERROR: compilation failed for package ‘rstanarm’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rstanarm’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rstanarm’
Warning in install.packages :
  installation of package ‘rstanarm’ had non-zero exit status

The downloaded source packages are in
	‘/private/var/folders/j4/3w2hqd157rn0zhbbv7br5v9w0000gn/T/Rtmpoa1vZi/downloaded_packages’

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.