I wanted to demonstrate rstan
(and rstanarm
too) using RStudio Cloud for my class, as students would run into different issues installing it on their computer and I want them to have some hands on experience with it first. I followed the instruction in https://github.com/stan-dev/rstan/wiki/Installing-RStan-on-Mac-or-Linux, and I think I've checked g++, build-essential, and libssl-dev are all present in the system. However, I failed to install rstan
, with the message
* installing *source* package ‘rstan’ ...
** package ‘rstan’ successfully unpacked and MD5 sums checked
** libs
g++ -I/opt/R/3.4.2/lib/R/include -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"`"/opt/R/3.4.2/lib/R/bin/Rscript" --vanilla -e "cat(system.file('include', 'src', package = 'StanHeaders'))"`" -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -DFUSION_MAX_VECTOR_SIZE=12 -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -I"/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -I"/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.4/RcppEigen/include" -I"/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.4/BH/include" -I"/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.4/StanHeaders/include" -I/usr/local/include -fpic -Wno-unused-variable -Wno-unused-function -Wno-macro-redefined -flto -Wno-unused-local-typedefs -c chains.cpp -o chains.o
g++ -I/opt/R/3.4.2/lib/R/include -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"`"/opt/R/3.4.2/lib/R/bin/Rscript" --vanilla -e "cat(system.file('include', 'src', package = 'StanHeaders'))"`" -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -DFUSION_MAX_VECTOR_SIZE=12 -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -I"/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -I"/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.4/RcppEigen/include" -I"/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.4/BH/include" -I"/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.4/StanHeaders/include" -I/usr/local/include -fpic -Wno-unused-variable -Wno-unused-function -Wno-macro-redefined -flto -Wno-unused-local-typedefs -c init.cpp -o init.o
g++ -I/opt/R/3.4.2/lib/R/include -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"`"/opt/R/3.4.2/lib/R/bin/Rscript" --vanilla -e "cat(system.file('include', 'src', package = 'StanHeaders'))"`" -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -DFUSION_MAX_VECTOR_SIZE=12 -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -I"/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -I"/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.4/RcppEigen/include" -I"/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.4/BH/include" -I"/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.4/StanHeaders/include" -I/usr/local/include -fpic -Wno-unused-variable -Wno-unused-function -Wno-macro-redefined -flto -Wno-unused-local-typedefs -c lang__ast_def.cpp -o lang__ast_def.o
g++ -I/opt/R/3.4.2/lib/R/include -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"`"/opt/R/3.4.2/lib/R/bin/Rscript" --vanilla -e "cat(system.file('include', 'src', package = 'StanHeaders'))"`" -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -DFUSION_MAX_VECTOR_SIZE=12 -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -I"/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -I"/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.4/RcppEigen/include" -I"/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.4/BH/include" -I"/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.4/StanHeaders/include" -I/usr/local/include -fpic -Wno-unused-variable -Wno-unused-function -Wno-macro-redefined -flto -Wno-unused-local-typedefs -c lang__grammars__bare_type_grammar_inst.cpp -o lang__grammars__bare_type_grammar_inst.o
In file included from /home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.4/BH/include/boost/spirit/include/phoenix_limits.hpp:11:0,
from /home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.4/BH/include/boost/spirit/home/support/meta_compiler.hpp:16,
from /home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.4/BH/include/boost/spirit/home/qi/meta_compiler.hpp:14,
from /home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.4/BH/include/boost/spirit/home/qi/action/action.hpp:14,
from /home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.4/BH/include/boost/spirit/home/qi/action.hpp:14,
from /home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.4/BH/include/boost/spirit/home/qi.hpp:14,
from /home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.4/BH/include/boost/spirit/include/qi.hpp:16,
from /home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.4/StanHeaders/include/src/stan/lang/grammars/bare_type_grammar_def.hpp:4,
from /home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.4/StanHeaders/include/src/stan/lang/grammars/bare_type_grammar_inst.cpp:1,
from lang__grammars__bare_type_grammar_inst.cpp:18:
/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.4/BH/include/boost/phoenix/core/limits.hpp:44:0: warning: "BOOST_PHOENIX_NO_VARIADIC_EXPRESSION" redefined
# define BOOST_PHOENIX_NO_VARIADIC_EXPRESSION
^
<command-line>:0:0: note: this is the location of the previous definition
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
/opt/R/3.4.2/lib/R/etc/Makeconf:168: recipe for target 'lang__grammars__bare_type_grammar_inst.o' failed
make: *** [lang__grammars__bare_type_grammar_inst.o] Error 4
ERROR: compilation failed for package ‘rstan’
* removing ‘/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.4/rstan’
Warning in install.packages :
installation of package ‘rstan’ had non-zero exit status
Any help would be greatly appreciated.