Rstanarm: CRAN vs Development version installation issues

I am continuing this thread as I have problems installing the feature/survival branch from Github on OSX Catalina.

I followed Rstan getting started and Installing Rstan from source on a Mac, installed first the macOS R toolchain, then Rcpp and Rstan (version 2.19.3) with

install.packages("Rcpp", repos = "https://rcppcore.github.io/drat")
install.packages("rstan", type = "source")

After this I have succesfully installed and used rstanarm from CRAN

install.packages("rstanarm", type="source")

Also these installations succeed

install.packages("rstanarm")
devtools::install_github("stan-dev/rstanarm", build_vignettes = FALSE)

However, when I try to install the feature/survival branch from github, it fails:

devtools::install_github("stan-dev/rstanarm@feature/survival", build_vignettes = FALSE)

(Note that below I show only the end of the R output. The full log is very long, as it has some seemingly unrelated warnings that also show up in the successful installations)

** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘rstanarm’ in dyn.load(file, DLLpath = DLLpath, …):
unable to load shared object ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/00LOCK-rstanarm/00new/rstanarm/libs/rstanarm.so’:
dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/00LOCK-rstanarm/00new/rstanarm/libs/rstanarm.so, 6): Symbol not found: __ZN20model_polr_namespace24csr_matrix_times_vector2IdN4stan4math3varEEEN5Eigen6MatrixIN5boost4math5tools12promote_argsIT_T0_ffffE4typeELin1ELi1ELi0ELin1ELi1EEERKiSG_RKNS5_ISA_Lin1ELi1ELi0ELin1ELi1EEERKNSt3__16vectorIiNSK_9allocatorIiEEEESQ_RKNS5_ISB_Lin1ELi1ELi0ELin1ELi1EEEPNSK_13basic_ostreamIcNSK_11char_traitsIcEEEE
Referenced from: /Library/Frameworks/R.framework/Versions/3.6/Resources/library/00LOCK-rstanarm/00new/rstanarm/libs/rstanarm.so
Expected in: flat namespace
in /Library/Frameworks/R.framework/Versions/3.6/Resources/library/00LOCK-rstanarm/00new/rstanarm/libs/rstanarm.so
Error: loading failed
Execution halted
ERROR: loading failed
removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rstanarm’
Error: Failed to install ‘rstanarm’ from GitHub:
(converted from warning) installation of package ‘/var/folders/st/bd1mw1z533d4pwb1xxd2vf540000gn/T//RtmpSpPhb2/file15724720f6586/rstanarm_2.19.1.tar.gz’ had non-zero exit status

The same happens if I download the repo and try to install it manually from Rstudio.

This error message seems very similar to the one reported here, but that did not help me forward.

Curiously, I was able to install and use the survival branch on Debian GNU/Linux 10 (buster).

So I have a problem that seems to be specific to the survival branch and OSX. Could it be that rstanarm master branch has been updated recently to cope with OSX Catalina, but the survival branch has not? Or maybe the survival branch is incompatible with rstan version 2.19.3, and I should install an older rstan version first?

Could either @sambrilleman or @bgoodri help me out here?

1 Like