I’ve been using brms
and with the cmdstanr
successfully on a separate cluster, and I’m trying to help a colleague get set up on his cluster at another university. I must have gotten lucky when I installed it on my university’s cluster… Installation on his cluster has proven very difficult (for me). Any help is much appreciated.
Here we go.
I’m unable to get cmdstanr
to install cmdstan
on a computer cluster that uses Red Hat 7.8. I’ve tried following advice I’ve found in other posts and solicited help from the cluster administrator. But, I’m not sure what the issue is. I’ll try to provide all information I can below, because I’m entirely not sure what is relevant.
I set up the modules.
module purge
module load r/4.0 gcc/9 udunits/2.2 mpi/openmpi-1.10.7_gnu4.8.5
export UDUNITS2_INCLUDE=/apps/udunits/2.2.26_gcc9.2/include
export UDUNITS2_LIBS=/apps/udunits/2.2.26_gcc9.2/lib
export DOWNLOAD_STATIC_LIBV8=1
Here is my g++ version.
-bash-4.2$ g++ --version
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Here is my make version.
GNU Make 3.82
Built for x86_64-redhat-linux-gnu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
g++
and make
are compatible versions based on here. ( g++
version >= 4.9.3 and make
version >= 3.81).
Here is everything in my .R/Makevars file
CXX14 = g++ -std=c++1y -Wno-unused-variable -Wno-unused-function -fPIC
I open R and run the following to install cmdstan 2.26.1.
install.packages("cmdstanr", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
library(cmdstanr)
install_cmdstan(dir = '/fslhome/fslcollab40/cmdstanr_cmdstan',
version = "2.26.1",
overwrite = TRUE,
cpp_option = list("CXX"="g++",
"TBB_CXX_TYPE"="gcc"))
As far as I can tell, everything terminates succesfully.
Then when I load brms
and try to use the cmdstanr
the following model fails. It runs sucessfully when I do no use the cmdstanr
backend.
fit_parallel <- brm(
+ count ~ zAge + zBase * Trt + (1|patient),
+ data = epilepsy, family = poisson(),
+ chains = 4, cores = 4, backend = "cmdstanr",
+ threads = threading(2)
+ )
Compiling Stan program...
Start sampling
Running MCMC with 4 parallel chains, with 2 thread(s) per chain...
Warning: Chain 1 finished unexpectedly!
Warning: Chain 2 finished unexpectedly!
Warning: Chain 3 finished unexpectedly!
Warning: Chain 4 finished unexpectedly!
Warning: Use read_cmdstan_csv() to read the results of the failed chains.
Error in rstan::read_stan_csv(out$output_files()) :
csvfiles does not contain any CSV file name
In addition: Warning messages:
1: All chains finished unexpectedly! Use the $output(chain_id) method for more information.
2: No chains finished successfully. Unable to retrieve the fit.
If I navigate to the cmdstan-2.26.1
directory and try the bernouli example, it fails. I get the following…
-bash-4.2$ ./examples/bernoulli/bernoulli sample data file=examples/bernoulli/bernoulli.data.json
./examples/bernoulli/bernoulli: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ./examples/bernoulli/bernoulli)
./examples/bernoulli/bernoulli: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by ./examples/bernoulli/bernoulli)
./examples/bernoulli/bernoulli: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by ./examples/bernoulli/bernoulli)
./examples/bernoulli/bernoulli: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./examples/bernoulli/bernoulli)
./examples/bernoulli/bernoulli: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /zhome/fslcollab40/cmdstanr_cmdstan/cmdstan-2.26.1/stan/lib/stan_math/lib/tbb/libtbb.so.2)
./examples/bernoulli/bernoulli: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /zhome/fslcollab40/cmdstanr_cmdstan/cmdstan-2.26.1/stan/lib/stan_math/lib/tbb/libtbb.so.2)
./examples/bernoulli/bernoulli: /lib64/libstdc++.so.6: version `CXXABI_1.3.11' not found (required by /zhome/fslcollab40/cmdstanr_cmdstan/cmdstan-2.26.1/stan/lib/stan_math/lib/tbb/libtbb.so.2)
./examples/bernoulli/bernoulli: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /zhome/fslcollab40/cmdstanr_cmdstan/cmdstan-2.26.1/stan/lib/stan_math/lib/tbb/libtbb.so.2)
It looks (to me) like cmdstan
has been incorrectly built. Am I possibly using the wrong cpp_option
for the modules I have loaded?
Where have I gone wrong? Any advice?
Thank you!!
Peter