Problems installing RStan on Ubuntu 16.04.7 LTS

We’ve upgraded to R 4.0.2 on a server on which we run RStudio Server. The server is running Ubuntu 16.04.7.

I’ve attempted to reinstall RStan using instructions I’ve found in a variety of places:

https://github.com/stan-dev/rstan/wiki/Installing-RStan-on-Linux

https://sites.psu.edu/theubunturblog/2012/09/03/installing-rstan-in-ubuntu/

https://discourse.mc-stan.org/t/installing-rstan-on-debian-10-buster-ubuntu-18-04-bionic-beaver/3364

Every attempt results in the same error:

/usr/lib/R/etc/Makeconf:176: recipe for target 'Module.o' failed
make: *** [Module.o] Error 1
ERROR: compilation failed for package ‘rstan’

Any advice?

Hi Sean, sorry about the trouble here! Are there any other errors reported or is that all there is?

A couple of things to also check:

  • Have you removed any pre-existing Makevars/.Renviron/.Rprofile configurations before trying to reinstall?
  • If you upgraded from a 3.x to 4.x version of R have you reinstalled your other packages?
  • Is it only rstan that fails to compile? Are you able to build the Rcpp \ RccpParallel \ V8 dependencies?
  • What compiler and version do you have installed on the server?
1 Like

I removed the old Makevars file (forgot it was there) and everything worked like a charm. Thanks for the speedy and extremely helpful resolution to my problem!

No worries! Also, you should be fine to re-add the Makevars file for optimisations now (i.e. CXX14FLAGS += -march=native -O3)