Open ltalluto opened 3 years ago
I got now the same error when trying to build Rstan on a PowerPC Mac:
ar -rs ../inst/lib//libStanServices.a stan_fit.o stan_fit_base.o
ar: creating archive ../inst/lib//libStanServices.a
installing to /Users/svacchanda/Library/R/powerpc/4.1/library/00LOCK-rstan/00new/rstan/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Warning message:
In file(con, "r") :
cannot open file '/var/db/timezone/zoneinfo/+VERSION': No such file or directory
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Warning in file(con, "r") :
cannot open file '/var/db/timezone/zoneinfo/+VERSION': No such file or directory
Error: package or namespace load failed for ‘rstan’:
.onLoad failed in loadNamespace() for 'rstan', details:
call: dyn.load(tbbmalloc_proxy, local = FALSE, now = TRUE)
error: unable to load shared object '/private/var/folders/rD/rDeCM6SDHv8daLCecrRmrU+++TI/-Tmp-/RtmpIprbyl/R.INSTALLb6525da2c990/rstan/':
dlopen(/private/var/folders/rD/rDeCM6SDHv8daLCecrRmrU+++TI/-Tmp-/RtmpIprbyl/R.INSTALLb6525da2c990/rstan/, 10): no suitable image found. Did find:
/private/var/folders/rD/rDeCM6SDHv8daLCecrRmrU+++TI/-Tmp-/RtmpIprbyl/R.INSTALLb6525da2c990/rstan/: not a file
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Users/svacchanda/Library/R/powerpc/4.1/library/rstan’
Removed a relevant call to tbbmalloc from zzz.R file in source, Rstan compiled, however running a test model fails:
[R.app GUI 1.72 (7847) powerpc-apple-darwin10.0.0d2]
[History restored from /Users/svacchanda/.Rapp.history]
> library(rstan)
Loading required package: StanHeaders
Loading required package: ggplot2
Need help getting started? Try the R Graphics Cookbook: https://r-graphics.org
rstan (Version 2.21.2, GitRev: 2e1f913d3ca3)
For execution on a local, multicore CPU with excess RAM we recommend calling
options(mc.cores = parallel::detectCores()).
To avoid recompilation of unchanged Stan programs, we recommend calling
rstan_options(auto_write = TRUE)
Warning message:
In file(con, "r") :
cannot open file '/var/db/timezone/zoneinfo/+VERSION': No such file or directory
> scode <- "
+ parameters {
+ real y[2];
+ }
+ model {
+ y[1] ~ normal(0, 1);
+ y[2] ~ double_exponential(0, 2);
+ }
+ "
> fit1 <- stan(model_code = scode, iter = 10, verbose = FALSE)
Error in dyn.load(libLFile) :
unable to load shared object '/var/folders/rD/rDeCM6SDHv8daLCecrRmrU+++TI/-Tmp-//RtmpnOlqOR/filed69511e8933e.so':
dlopen(/var/folders/rD/rDeCM6SDHv8daLCecrRmrU+++TI/-Tmp-//RtmpnOlqOR/filed69511e8933e.so, 6): Library not loaded: @rpath/libtbb.dylib
Referenced from: /var/folders/rD/rDeCM6SDHv8daLCecrRmrU+++TI/-Tmp-//RtmpnOlqOR/filed69511e8933e.so
Reason: image not found
Error in sink(type = "output") : invalid connection
>
Summary:
rstan, which was working 3 weeks ago, suddenly stopped providing informative error messages, instead giving c++ exception (unknown reason). Attempting to reinstall fails with various errors depending on the installation method.
Description:
c++ exception (unknown reason)
on any error when trying to run a stan model. Following the advice I found from searching around, e.g., here, I tried to reinstall rstan from source:install.packages("rstan", type = "source")
This seemingly successfully compiles, but fails at the end when it tries to load the package:
I tried editing CXX in ~/.R/Makevars to try different compilers (I have g++, apple clang, and macports clang), but this did not change the compiler messages (i.e., it still compiles with clang even when I change CXX to g++).
Next I tried to clone the GitHub repository, run
make build
, then useR CMD INSTALL
to install the package. This succeeds. However, running a test model with a syntax error again gives me c++ exception (unknown reason).Finally, I tried to re-install the CRAN binary. The installation also succeeds (and is correctly getting the arm64 build). However, I cannot load the package:
The directory indicated is my working directory!
Reproducible example
I can only run this after installing using method 2 above.
RStan Version:
2.21.3
R Version:
4.1.0 (2021-05-18)
Operating System:
macOS 11.4, arm64 version