[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#50841: rstan needs gfortran 9+
From: |
Ricardo Wurmus |
Subject: |
bug#50841: rstan needs gfortran 9+ |
Date: |
Tue, 12 Jul 2022 19:19:48 +0200 |
User-agent: |
mu4e 1.6.11; emacs 28.1 |
Hi,
thank you for your bug report!
> You find a related error if you try install.packages("isoband"), which could
> work as a test case:
>
> /gnu/store/741057r2x06zwg6zcmqmdyv51spm6n9i-gfortran-7.5.0-lib/lib/libstdc++.so.6:
> version
> `GLIBCXX_3.4.26' not found (required by
> /home/kept/Dotfiles/R/x86_64-unknown-linux-gnu-library/4.1/00LOCK-isoband/00new/isoband/libs/isoband.so)
“install.packages” will only work if you carefully control your
environment. It will not do the right thing when you use it on a
foreign distro, for example, because it would likely pick the system’s
compiler toolchain to build things that are eventually incompatible with
the libraries used by R from Guix.
Here’s an old blog post that explains the problem and how to work around
it if you must use “install.packages”:
https://elephly.net/posts/2017-03-24-r-with-guix.html
I haven’t been able to reproduce your problem, though. Here’s what I did:
--8<---------------cut here---------------start------------->8---
$ guix shell -C r-minimal r-rstan -D r-minimal -- R
R version 4.2.1 (2022-06-23) -- "Funny-Looking Kid"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-unknown-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(rstan)
Loading required package: StanHeaders
Loading required package: ggplot2
code for methods in class "Rcpp_model_base" was not checked for suspicious
field assignments (recommended package 'codetools' not available?)
code for methods in class "Rcpp_model_base" was not checked for suspicious
field assignments (recommended package 'codetools' not available?)
code for methods in class "Rcpp_stan_fit" was not checked for suspicious field
assignments (recommended package 'codetools' not available?)
code for methods in class "Rcpp_stan_fit" was not checked for suspicious field
assignments (recommended package 'codetools' not available?)
rstan (Version 2.21.5, 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)
> 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)
+ + + + + + + + >
fit1
code for methods in class
"Rcpp_stan_fit4model139796fca_b524cd829fcb9f50f6761f2451b62eec" was not checked
for suspicious field assignments (recommended package 'codetools' not
available?)
code for methods in class
"Rcpp_stan_fit4model139796fca_b524cd829fcb9f50f6761f2451b62eec" was not checked
for suspicious field assignments (recommended package 'codetools' not
available?)
SAMPLING FOR MODEL 'b524cd829fcb9f50f6761f2451b62eec' NOW (CHAIN 1).
Chain 1:
Chain 1: Gradient evaluation took 6e-06 seconds
Chain 1: 1000 transitions using 10 leapfrog steps per transition would take
0.06 seconds.
Chain 1: Adjust your expectations accordingly!
Chain 1:
Chain 1:
Chain 1: WARNING: No variance estimation is
Chain 1: performed for num_warmup < 20
Chain 1:
Chain 1: Iteration: 1 / 10 [ 10%] (Warmup)
Chain 1: Iteration: 2 / 10 [ 20%] (Warmup)
Chain 1: Iteration: 3 / 10 [ 30%] (Warmup)
Chain 1: Iteration: 4 / 10 [ 40%] (Warmup)
Chain 1: Iteration: 5 / 10 [ 50%] (Warmup)
Chain 1: Iteration: 6 / 10 [ 60%] (Sampling)
Chain 1: Iteration: 7 / 10 [ 70%] (Sampling)
Chain 1: Iteration: 8 / 10 [ 80%] (Sampling)
Chain 1: Iteration: 9 / 10 [ 90%] (Sampling)
Chain 1: Iteration: 10 / 10 [100%] (Sampling)
Chain 1:
Chain 1: Elapsed Time: 0.000157 seconds (Warm-up)
Chain 1: 0.000123 seconds (Sampling)
Chain 1: 0.00028 seconds (Total)
Chain 1:
SAMPLING FOR MODEL 'b524cd829fcb9f50f6761f2451b62eec' NOW (CHAIN 2).
Chain 2:
Chain 2: Gradient evaluation took 3e-06 seconds
Chain 2: 1000 transitions using 10 leapfrog steps per transition would take
0.03 seconds.
Chain 2: Adjust your expectations accordingly!
Chain 2:
Chain 2:
Chain 2: WARNING: No variance estimation is
Chain 2: performed for num_warmup < 20
Chain 2:
Chain 2: Iteration: 1 / 10 [ 10%] (Warmup)
Chain 2: Iteration: 2 / 10 [ 20%] (Warmup)
Chain 2: Iteration: 3 / 10 [ 30%] (Warmup)
Chain 2: Iteration: 4 / 10 [ 40%] (Warmup)
Chain 2: Iteration: 5 / 10 [ 50%] (Warmup)
Chain 2: Iteration: 6 / 10 [ 60%] (Sampling)
Chain 2: Iteration: 7 / 10 [ 70%] (Sampling)
Chain 2: Iteration: 8 / 10 [ 80%] (Sampling)
Chain 2: Iteration: 9 / 10 [ 90%] (Sampling)
Chain 2: Iteration: 10 / 10 [100%] (Sampling)
Chain 2:
Chain 2: Elapsed Time: 0.000146 seconds (Warm-up)
Chain 2: 0.000132 seconds (Sampling)
Chain 2: 0.000278 seconds (Total)
Chain 2:
SAMPLING FOR MODEL 'b524cd829fcb9f50f6761f2451b62eec' NOW (CHAIN 3).
Chain 3:
Chain 3: Gradient evaluation took 6e-06 seconds
Chain 3: 1000 transitions using 10 leapfrog steps per transition would take
0.06 seconds.
Chain 3: Adjust your expectations accordingly!
Chain 3:
Chain 3:
Chain 3: WARNING: No variance estimation is
Chain 3: performed for num_warmup < 20
Chain 3:
Chain 3: Iteration: 1 / 10 [ 10%] (Warmup)
Chain 3: Iteration: 2 / 10 [ 20%] (Warmup)
Chain 3: Iteration: 3 / 10 [ 30%] (Warmup)
Chain 3: Iteration: 4 / 10 [ 40%] (Warmup)
Chain 3: Iteration: 5 / 10 [ 50%] (Warmup)
Chain 3: Iteration: 6 / 10 [ 60%] (Sampling)
Chain 3: Iteration: 7 / 10 [ 70%] (Sampling)
Chain 3: Iteration: 8 / 10 [ 80%] (Sampling)
Chain 3: Iteration: 9 / 10 [ 90%] (Sampling)
Chain 3: Iteration: 10 / 10 [100%] (Sampling)
Chain 3:
Chain 3: Elapsed Time: 0.000271 seconds (Warm-up)
Chain 3: 0.000253 seconds (Sampling)
Chain 3: 0.000524 seconds (Total)
Chain 3:
SAMPLING FOR MODEL 'b524cd829fcb9f50f6761f2451b62eec' NOW (CHAIN 4).
Chain 4:
Chain 4: Gradient evaluation took 5e-06 seconds
Chain 4: 1000 transitions using 10 leapfrog steps per transition would take
0.05 seconds.
Chain 4: Adjust your expectations accordingly!
Chain 4:
Chain 4:
Chain 4: WARNING: No variance estimation is
Chain 4: performed for num_warmup < 20
Chain 4:
Chain 4: Iteration: 1 / 10 [ 10%] (Warmup)
Chain 4: Iteration: 2 / 10 [ 20%] (Warmup)
Chain 4: Iteration: 3 / 10 [ 30%] (Warmup)
Chain 4: Iteration: 4 / 10 [ 40%] (Warmup)
Chain 4: Iteration: 5 / 10 [ 50%] (Warmup)
Chain 4: Iteration: 6 / 10 [ 60%] (Sampling)
Chain 4: Iteration: 7 / 10 [ 70%] (Sampling)
Chain 4: Iteration: 8 / 10 [ 80%] (Sampling)
Chain 4: Iteration: 9 / 10 [ 90%] (Sampling)
Chain 4: Iteration: 10 / 10 [100%] (Sampling)
Chain 4:
Chain 4: Elapsed Time: 0.00014 seconds (Warm-up)
Chain 4: 0.000132 seconds (Sampling)
Chain 4: 0.000272 seconds (Total)
Chain 4:
Warning message:
The largest R-hat is 1.07, indicating chains have not mixed.
Running the chains for more iterations may help. See
https://mc-stan.org/misc/warnings.html#r-hat
> > Inference for Stan model: b524cd829fcb9f50f6761f2451b62eec.
4 chains, each with iter=10; warmup=5; thin=1;
post-warmup draws per chain=5, total post-warmup draws=20.
mean se_mean sd 2.5% 25% 50% 75% 97.5% n_eff Rhat
y[1] -0.02 0.20 1.02 -1.80 -0.68 -0.05 0.59 1.86 26 0.89
y[2] 2.06 0.49 1.81 -1.29 0.78 1.96 3.48 5.00 14 1.08
lp__ -1.65 0.17 0.85 -3.08 -2.20 -1.64 -1.01 -0.41 26 0.81
Samples were drawn using NUTS(diag_e) at Tue Jul 12 17:28:00 2022.
For each parameter, n_eff is a crude measure of effective sample size,
and Rhat is the potential scale reduction factor on split chains (at
convergence, Rhat=1).
>
--8<---------------cut here---------------end--------------->8---
Could you please show us an example like the above that fails when run
in “guix shell -C”? Please also provide the output of “guix describe -f
channels”.
Thank you!
--
Ricardo
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug#50841: rstan needs gfortran 9+,
Ricardo Wurmus <=