Rstanarm: CRAN vs Development version installation issues

And you get the same error? What command are you using to install rstanarm?

stan_files/continuous.cc:29:1: required from here
/home/Hutchinson/R/x86_64-pc-linux-gnu-library/4.1/RcppEigen/include/Eigen/src/Core/CoreEvaluators.h:960:8: warning: ignoring attributes on template argument ‘Eigen::internal::packet_traits::type {aka __vector(2) double}’ [-Wignored-attributes]
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
make: *** [stan_files/continuous.o] Error 4
/usr/lib/R/etc/Makeconf:175: recipe for target ‘stan_files/continuous.o’ failed
rm stan_files/jm.cc stan_files/continuous.cc stan_files/bernoulli.cc stan_files/binomial.cc stan_files/lm.cc stan_files/polr.cc stan_files/count.cc stan_files/mvmer.cc
ERROR: compilation failed for package ‘rstanarm’

  • removing ‘/home/Hutchinson/R/x86_64-pc-linux-gnu-library/4.1/rstanarm’
    Warning in install.packages :
    installation of package ‘rstanarm’ had non-zero exit status

The downloaded source packages are in
‘/tmp/RtmpXWRyQ4/downloaded_packages’

The same error even after increase to 16GB RAM

Restarting R session…

Sys.setenv(MAKEFLAGS = “-1”)
install.packages(“rstanarm”, repos = c(“Repository for distributing (some) stan-dev R packages | r-packages”, getOption(“repos”)))
Installing package into ‘/home/Hutchinson/R/x86_64-pc-linux-gnu-library/4.1’
(as ‘lib’ is unspecified)
trying URL ‘https://mc-stan.org/r-packages/src/contrib/rstanarm_2.21.2.tar.gz
Content type ‘application/gzip’ length 755170 bytes (737 KB)
==================================================
downloaded 737 KB

  • installing source package ‘rstanarm’ …
    ** using staged installation
    ** libs

Ah sorry, I’d mistyped in my earlier post. That should be (note the j):

Sys.setenv(MAKEFLAGS="-j1")

g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
make: *** [stan_files/continuous.o] Error 4
ERROR: compilation failed for package ‘rstanarm’

  • removing ‘/home/Hutchinson/R/x86_64-pc-linux-gnu-library/4.1/rstanarm’
    /usr/lib/R/etc/Makeconf:175: recipe for target ‘stan_files/continuous.o’ failed
    rm stan_files/jm.cc stan_files/continuous.cc stan_files/bernoulli.cc stan_files/binomial.cc stan_files/lm.cc stan_files/polr.cc stan_files/count.cc stan_files/mvmer.cc
    Warning in install.packages :
    installation of package ‘rstanarm’ had non-zero exit status

The downloaded source packages are in
‘/tmp/RtmpeB2BPO/downloaded_packages’

Same exact error, even with below:

with 16GB RAM

Can you try:

Sys.setenv(MAKEFLAGS="-j1")
install.packages("rstanarm", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))

And copy all output that you get?

wait, it may take some time, also, there are lots of output which I may not able to capture all. Is there a way to send the output to a file?

Hold on, I can see from local testing that the package isn’t respecting the MAKEFLAGS setting and will attempt to compile all models in parallel regardless. Let me look into this

Can you try installing the Github version:

Sys.setenv(MAKEFLAGS = "-j2")
Sys.setenv("R_REMOTES_NO_ERRORS_FROM_WARNINGS" = "true")
remotes::install_github("stan-dev/rstanarm", INSTALL_opts = "--no-multiarch", force = TRUE)

Thanks for looking into it. But to me it is strange that my local PC RStudio (8GB RAM) can install your package easily, while that of the Azure VM is giving me so much issues.

Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
make: *** [stan_files/jm.o] Error 4
make: *** Waiting for unfinished jobs…
/usr/lib/R/etc/Makeconf:175: recipe for target ‘stan_files/jm.o’ failed
rm stan_files/jm.cc stan_files/continuous.cc stan_files/bernoulli.cc stan_files/binomial.cc stan_files/lm.cc stan_files/polr.cc stan_files/count.cc stan_files/mvmer.cc
ERROR: compilation failed for package ‘rstanarm’

  • removing ‘/home/Hutchinson/R/x86_64-pc-linux-gnu-library/4.1/rstanarm’
    Warning message:
    In i.p(…) :
    installation of package ‘/tmp/RtmpeB2BPO/file4ef550cefd8d/rstanarm_2.21.2.tar.gz’ had non-zero exit status

stan_files/jm.hpp:4716:10: note: variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without
void ctor_body(stan::io::var_context& context__,
^~~~~~~~~
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
make: *** [stan_files/jm.o] Error 4
make: *** Waiting for unfinished jobs…
/usr/lib/R/etc/Makeconf:175: recipe for target ‘stan_files/jm.o’ failed
rm stan_files/jm.cc stan_files/continuous.cc stan_files/bernoulli.cc stan_files/binomial.cc stan_files/lm.cc stan_files/polr.cc stan_files/count.cc stan_files/mvmer.cc
ERROR: compilation failed for package ‘rstanarm’

  • removing ‘/home/Hutchinson/R/x86_64-pc-linux-gnu-library/4.1/rstanarm’

@jonah It looks like rstanarm isn’t respecting the MAKEFLAGS setting when specifying the number of jobs while building from source on linux. Any chance you know where this could be coming from?

Do you have news regarding this issue?

Thank you.

The solution to my problem was solved by following @bgoodri suggestion here.