Rstanarm installation failure on R 3.6.2, Debian 9

Hi,

I am trying to install rstanarm, with the following command:

install.packages("rstanarm")

The installation command results in the following error:

** 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 ‘/usr/local/lib/R/site-library/00LOCK-rstanarm/00new/rstanarm/libs/rstanarm.so’:
/usr/local/lib/R/site-library/00LOCK-rstanarm/00new/rstanarm/libs/rstanarm.so: undefined symbol: _ZN21model_count_namespace24csr_matrix_times_vector2IddEEN5Eigen6MatrixIN5boost4math5tools12promote_argsIT_T0_ffffE4typeELin1ELi1ELi0ELin1ELi1EEERKiSD_RKNS2_IS7_Lin1ELi1ELi0ELin1ELi1EEERKSt6vectorIiSaIiEESL_RKNS2_IS8_Lin1ELi1ELi0ELin1ELi1EEEPSo
Error: loading failed
Execution halted
ERROR: loading failed

Can someone give me pointer on how to resolve this please.

> sessionInfo()
R version 3.6.2 (2019-12-12)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 9 (stretch)

Matrix products: default
BLAS:   /usr/lib/openblas-base/libblas.so.3
LAPACK: /usr/lib/libopenblasp-r0.2.19.so

locale:
[1] C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] compiler_3.6.2 tools_3.6.2
1 Like

The same error can be reproduced on rocker/tidyverse Docker image with the following command:

docker run rocker/tidyverse:latest bash -c "install2.r rstanarm"

The rstanarm package on CRAN won’t build and I can’t upload a rstanarm that does build because it appears to crash on 32bit Windows when quitting R. You can do

remotes::install_github("stan-dev/rstanarm")

@Takao_Noguchi I’ve run into the same problem installing rstanarm to RHEL 7.3:

Error: package or namespace load failed for ‘rstanarm’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '~/rpackages/rstanarm/libs/rstanarm.so':
  ~/rpackages/rstanarm/libs/rstanarm.so: undefined symbol: _ZN21model_count_namespace24csr_matrix_times_vector2IddEEN5Eigen6MatrixIN5boost4math5tools12promote_argsIT_T0_ffffE4typeELin1ELi1ELi0ELin1ELi1EEERKiSD_RKNS2_IS7_Lin1ELi1ELi0ELin1ELi1EEERKSt6vectorIiSaIiEESL_RKNS2_IS8_Lin1ELi1ELi0ELin1ELi1EEEPSo
Error: loading failed
Execution halted
ERROR: loading failed
> sessionInfo()
R version 3.5.3 (2019-03-11)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux

Matrix products: default
BLAS: /rigel/opt/R-3.5.3/lib64/R/lib/libRblas.so
LAPACK: /rigel/opt/R-3.5.3/lib64/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.5.3

It applies to all source installs of rstanarm from CRAN irrespective of operating system. Installation of binary packages or source installation from github should be fine.

Thanks! That command worked.

Thanks @bgoodri, that works for me too.

sadly didn’t work for me - a novice on stan, using linux mint 19.3 Tricia with R 3.6.3, gives error:

compilation terminated.
/usr/lib/R/etc/Makeconf:168: recipe for target ‘expr.o’ failed
make: *** [expr.o] Error 1
ERROR: compilation failed for package ‘lazyeval’

  • removing ‘/home/greg/R/x86_64-pc-linux-gnu-library/3.6/lazyeval’
    Error: Failed to install ‘rstanarm’ from GitHub:
    (converted from warning) installation of package ‘lazyeval’ had non-zero exit status

the problem highlighted earlier on was:

             from <command-line>:0:

/home/greg/R/x86_64-pc-linux-gnu-library/3.6/RcppEigen/include/Eigen/src/Core/util/Macros.h:613:1: error: unknown type name ‘namespace’
namespace Eigen {
^~~~~~~~~
/home/greg/R/x86_64-pc-linux-gnu-library/3.6/RcppEigen/include/Eigen/src/Core/util/Macros.h:613:17: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
namespace Eigen {
^
In file included from /home/greg/R/x86_64-pc-linux-gnu-library/3.6/RcppEigen/include/Eigen/Dense:1:0,
from /home/greg/R/x86_64-pc-linux-gnu-library/3.6/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:13,
from :0:
/home/greg/R/x86_64-pc-linux-gnu-library/3.6/RcppEigen/include/Eigen/Core:96:10: fatal error: complex: No such file or directory
#include
^~~~~~~~~
compilation terminated.

help!!

thanks

Greg

Hi Greg,

This looks like a general error to install R packages rather than rstanarm specifically (as the error relates to the lazyeval package).

What happens if you restart R and run install.packages("lazyeval")?

hi Andrew

thanks, that solved the first problem. Then trying within R to
install.packages(“rstanarm”) failed, so I went back to the remotes
approach. This threw a series of errors, each of which were resolved by
the suggestions to install libcurl4-openssl-dev, and then libssl-dev, and
then libv8-dev

After that, it took about 15 mins to install rstanarm. We’ll see if it works!

thanks again

Greg