cran2copr icon indicating copy to clipboard operation
cran2copr copied to clipboard

rstan requires BH and RcppEigen

Open sergiopasra opened this issue 8 months ago • 1 comments

I have just installed rstan via the copr repo and it misses two runtime dependencies RcppEigen and BH. I have installed both packages also from the repo and rstan seems to work correctly.

sergiopasra avatar Mar 26 '25 11:03 sergiopasra

What do you mean by runtime dependencies? After installing the package, it loads fine. Maybe RcppEigen and BH are then required for some functions, but then you should manually install them, this is expected.

Enchufa2 avatar Mar 26 '25 13:03 Enchufa2

The package loads, but it doesn't pass the self check in "Verifying installation"

https://github.com/stan-dev/rstan/wiki/Rstan-Getting-Started#verifying-installation

> example(stan_model, package = "rstan", run.dontrun = TRUE)

Loading required package: StanHeaders

rstan version 2.32.6 (Stan version 2.32.2)

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)
For within-chain threading using `reduce_sum()` or `map_rect()` Stan functions,
change `threads_per_chain` option:
rstan_options(threads_per_chain = 1)


stn_md> stancode <- 'data {real y_mean;} parameters {real y;} model {y ~ normal(y_mean,1);}'

stn_md> mod <- stan_model(model_code = stancode, verbose = TRUE)

TRANSLATING MODEL '' FROM Stan CODE TO C++ CODE NOW.
COMPILING THE C++ CODE FOR MODEL 'anon_model' NOW.
OS: x86_64, linux-gnu; rstan: 2.32.6; Rcpp: 1.0.13.1; inline: 0.3.20 
Error in stan_model(model_code = stancode, verbose = TRUE) : 
  Boost not found; call install.packages('BH')

sergiopasra avatar Mar 28 '25 11:03 sergiopasra

That's fine. It tells you what's missing and the solution, so no big deal I would say. :)

IMHO these packages should be declared not only in LinkingTo, but also in Imports, as e.g. we recommend for Rcpp in section 2.2 of the Rcpp Attributes manual:

For example, if your package depends on Rcpp you’d have the following entries in the DESCRIPTION file:

Imports: Rcpp (>= 0.11.4)
LinkingTo: Rcpp

Thanks anyway for your report! Closing here.

Enchufa2 avatar Mar 28 '25 12:03 Enchufa2