From unknown Sat Aug 16 10:43:06 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#50841 <50841@debbugs.gnu.org> To: bug#50841 <50841@debbugs.gnu.org> Subject: Status: rstan needs gfortran 9+ Reply-To: bug#50841 <50841@debbugs.gnu.org> Date: Sat, 16 Aug 2025 17:43:06 +0000 retitle 50841 rstan needs gfortran 9+ reassign 50841 guix submitter 50841 meedstrom@teknik.io severity 50841 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 27 05:33:46 2021 Received: (at submit) by debbugs.gnu.org; 27 Sep 2021 09:33:46 +0000 Received: from localhost ([127.0.0.1]:39653 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mUn18-0000Iy-Gk for submit@debbugs.gnu.org; Mon, 27 Sep 2021 05:33:46 -0400 Received: from lists.gnu.org ([209.51.188.17]:34016) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mUn16-0000Iq-Bp for submit@debbugs.gnu.org; Mon, 27 Sep 2021 05:33:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54352) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUn16-00069r-5L for bug-guix@gnu.org; Mon, 27 Sep 2021 05:33:44 -0400 Received: from mail.teknik.io ([5.79.72.163]:61536) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUn13-00056j-Cw for bug-guix@gnu.org; Mon, 27 Sep 2021 05:33:43 -0400 dkim-signature: v=1; a=rsa-sha256; d=teknik.io; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From:Subject:Date:Message-ID:To:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=uCmrkDqOgr5bD0i7NgxO/nChuX/xXtC8M6H4so4DmO0=; b=ix6DmgUjxDPs7f9VUHE1fhvTUlMUGp+LpO4IjoOi9N1Sieo3mO6acXiFMFe1YEnCI0AaG/K1tfe/1o6DVpb0dbv+3IQMc5Bk5Ipxd7UExri3KHtPbzVb5GWkFGpy7rvdrXQ6QZTkBjLznGR8R8tlgRCzvUfEuxjxyNn0MHKn1+ciLPETtAN/Eor+teVLY4WoimcSilCsiNURAb3MDWiemlUGUo/gYJqbN/fk4rkHVJl5BHEsdqvORW++gX yHUc4Z0rpTWW34pMqPaJVpKnCrKtu0K+e4G4yFp7LCpFbnO9WiIcQngkBOCGG/+ztzx3WyKE7wpxifdTvRBJbiS1ANfQ== Received: from mail.teknik.io (TEKNIK-SERVER [5.79.72.163]) by mail.teknik.io with ESMTPSA (version=TLSv1.2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128) ; Mon, 27 Sep 2021 02:33:38 -0700 Mime-Version: 1.0 Date: Mon, 27 Sep 2021 09:33:37 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: RainLoop/1.11.3 From: meedstrom@teknik.io Message-ID: <72446ddb47e832e1139c2acd72d10c33@teknik.io> Subject: rstan needs gfortran 9+ To: bug-guix@gnu.org Received-SPF: pass client-ip=5.79.72.163; envelope-from=meedstrom@teknik.io; helo=mail.teknik.io X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) Hi!=0A=0AWith Guix' package for R, it's not possible to use rstan or the = things that depend on it at runtime, whether installed via Guix' r-rstan = or via R's own package manager install.packages("rstan"). They install fi= ne, but functions such as stan() and brm() try to call make, and then thi= ngs crash and burn. The exception is the rstanarm package because it ship= s precompiled Stan models and doesn't need make.=0A=0AThe issue is basica= lly that rstan needs access to gfortran 9+ at runtime (for some minimum G= LIBCXX version), and it seems the core R must be defined with it.=0A=0AYo= u find a related error if you try install.packages("isoband"), which coul= d work as a test case:=0A=0A/gnu/store/741057r2x06zwg6zcmqmdyv51spm6n9i-g= fortran-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/0= 0LOCK-isoband/00new/isoband/libs/isoband.so)=0A=0AI've been using custom = package definitions that make it work, but for some unrelated reasons I'm= having difficulty upgrading my package manifests, so I figured it's high= time to fix this thing upstream. Here are my definitions:=0A=0A(define-p= ublic gfortran-9=0A (package=0A (inherit ((@@ (gnu packages gcc) custo= m-gcc)=0A gcc-9 "gfortran" '("fortran")=0A (@@ (g= nu packages gcc) %generic-search-paths)))=0A (version "9")))=0A=0A(defi= ne-public gfortran-toolchain-9=0A (package=0A (inherit (make-gcc-toolc= hain gfortran-9))))=0A=0A(define-public r-minimal-me1=0A (package=0A = (inherit (@ (gnu packages statistics) r-minimal))=0A (version "4.99.99= -me1")=0A (inputs `(("gfortran" ,gfortran-9)=0A ,@(alist-= delete "gfortran"=0A (package-inputs (@ (gnu= packages statistics) r-minimal)))))))=0A=0A(define-public r-me1=0A (pac= kage=0A (inherit (@ (gnu packages statistics) r))=0A (version "4.99.9= 9-me1")=0A (inputs `(("r-minimal" ,r-minimal-me1)=0A ,@(ali= st-delete "r-minimal"=0A (package-inputs (@ (= gnu packages statistics) r)))))))=0A=0A;; add gcc and make at runtime, al= so needed=0A(define-public r-rstan-me1=0A (package=0A (inherit (@ (gnu= packages cran) r-rstan))=0A (version "2.99.99-me1")=0A (propagated-i= nputs `(("gcc-toolchain" ,gcc-toolchain)=0A ("make= " ,gnu-make)=0A ,@(package-propagated-inputs (@ (g= nu packages cran) r-rstan))))))=0A=0A(define-public r-igraph-me1=0A (pac= kage=0A (inherit (@ (gnu packages cran) r-igraph))=0A (version "2021-= me1")=0A (inputs `(("r-minimal" ,r-minimal-me1)=0A ,@(alist= -delete "r-minimal"=0A (package-inputs (@ (gn= u packages cran) r-igraph)))))=0A (native-inputs `(("gfortran" ,gfortra= n-9)=0A ,@(alist-delete "gfortran"=0A = (package-native-inputs (@ (gnu packages cran) r-igraph= )))))))=0A=0A;; ... and all other packages depending on r-rstan need to p= oint to the new r-rstan-me1, better fix r-rstan upstream From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 12 13:31:24 2022 Received: (at 50841) by debbugs.gnu.org; 12 Jul 2022 17:31:24 +0000 Received: from localhost ([127.0.0.1]:43628 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oBJjI-0001GE-2z for submit@debbugs.gnu.org; Tue, 12 Jul 2022 13:31:24 -0400 Received: from sender4-of-o51.zoho.com ([136.143.188.51]:21134) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oBJjD-0001G3-Ss for 50841@debbugs.gnu.org; Tue, 12 Jul 2022 13:31:22 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1657647076; cv=none; d=zohomail.com; s=zohoarc; b=ax0qGtWUEwDB7R7coOBA9N38VBD2D7WcfUGrBcJiui1dP5/8QZf9HRcrsQQOZXrE/aHItv4G8Je73YLM5T1JXoKoBV6o80MqPDb86wIH+5R1L9pQxUdJst7iKSt846QG4peOoi1QNPO8yu2aIzjRfOYLD5Q9w17MXJVra00IkcU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1657647076; h=Content-Type:Content-Transfer-Encoding:Date:From:MIME-Version:Message-ID:Subject:To; bh=kHIJYXd6P2AL7jQcLSdOzZY9P0broVUUl451a02FWng=; b=UVO9w8vJVMhe8LaVie73tT86dgPQuwNhuFuYjJx1OZr44Drn761o5fOe1E27zxFtVRieyVduOPbPlYVNN7LloiY98kkpdYTLGBPtGXklpUr/JgoqAmNJmthcN9QRYqgd9iDGX5H2UpgmJBN7lC3wEs1CVznqzCgwtNiV0mlZ+ss= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1657647076; s=zoho; d=elephly.net; i=rekado@elephly.net; h=From:From:To:To:Subject:Subject:Date:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To:Cc; bh=kHIJYXd6P2AL7jQcLSdOzZY9P0broVUUl451a02FWng=; b=MCuE6DEDczubwrS6Su1iVPhFt3B2fFLnpWrSmJQ/1h2AxHqpJux7e+X4EbqsZUQr kjmwAzVUXC3i+TqHOGrN3zkqGOEuDSDGkrTvqQBl8V4aj+/N8ccFPMC2y9Y9PODo1YY 4za5iIFIpOIGWcbL8bHe0FvZ0cbz8Lr0l9HHJXh0= Received: from localhost (158-108-142-46.pool.kielnet.net [46.142.108.158]) by mx.zohomail.com with SMTPS id 1657647075671677.109417695092; Tue, 12 Jul 2022 10:31:15 -0700 (PDT) User-agent: mu4e 1.6.11; emacs 28.1 From: Ricardo Wurmus To: 50841@debbugs.gnu.org Subject: rstan needs gfortran 9+ Date: Tue, 12 Jul 2022 19:19:48 +0200 X-URL: https://elephly.net X-PGP-Key: https://elephly.net/rekado.pubkey X-PGP-Fingerprint: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC Message-ID: <87pmiaxmov.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 50841 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, thank you for your bug report! > You find a related error if you try install.packages("isoband"), which co= uld work as a test case: > > /gnu/store/741057r2x06zwg6zcmqmdyv51spm6n9i-gfortran-7.5.0-lib/lib/libstd= c++.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) =E2=80=9Cinstall.packages=E2=80=9D 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=E2=80= =99s compiler toolchain to build things that are eventually incompatible with the libraries used by R from Guix. Here=E2=80=99s an old blog post that explains the problem and how to work a= round it if you must use =E2=80=9Cinstall.packages=E2=80=9D: https://elephly.net/posts/2017-03-24-r-with-guix.html I haven=E2=80=99t been able to reproduce your problem, though. Here=E2=80= =99s 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 fi= eld assignments (recommended package 'codetools' not available?) code for methods in class "Rcpp_stan_fit" was not checked for suspicious fi= eld 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 =3D parallel::detectCores()). To avoid recompilation of unchanged Stan programs, we recommend calling rstan_options(auto_write =3D TRUE) > scode <- " parameters { real y[2];=20 }=20 model { y[1] ~ normal(0, 1); y[2] ~ double_exponential(0, 2); }=20 " fit1 <- stan(model_code =3D scode, iter =3D 10, verbose =3D FALSE)=20 + + + + + + + + >=20 fit1 code for methods in class "Rcpp_stan_fit4model139796fca_b524cd829fcb9f50f67= 61f2451b62eec" was not checked for suspicious field assignments (recommende= d package 'codetools' not available?) code for methods in class "Rcpp_stan_fit4model139796fca_b524cd829fcb9f50f67= 61f2451b62eec" was not checked for suspicious field assignments (recommende= d package 'codetools' not available?) SAMPLING FOR MODEL 'b524cd829fcb9f50f6761f2451b62eec' NOW (CHAIN 1). Chain 1:=20 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:=20 Chain 1:=20 Chain 1: WARNING: No variance estimation is Chain 1: performed for num_warmup < 20 Chain 1:=20 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:=20 Chain 1: Elapsed Time: 0.000157 seconds (Warm-up) Chain 1: 0.000123 seconds (Sampling) Chain 1: 0.00028 seconds (Total) Chain 1:=20 SAMPLING FOR MODEL 'b524cd829fcb9f50f6761f2451b62eec' NOW (CHAIN 2). Chain 2:=20 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:=20 Chain 2:=20 Chain 2: WARNING: No variance estimation is Chain 2: performed for num_warmup < 20 Chain 2:=20 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:=20 Chain 2: Elapsed Time: 0.000146 seconds (Warm-up) Chain 2: 0.000132 seconds (Sampling) Chain 2: 0.000278 seconds (Total) Chain 2:=20 SAMPLING FOR MODEL 'b524cd829fcb9f50f6761f2451b62eec' NOW (CHAIN 3). Chain 3:=20 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:=20 Chain 3:=20 Chain 3: WARNING: No variance estimation is Chain 3: performed for num_warmup < 20 Chain 3:=20 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:=20 Chain 3: Elapsed Time: 0.000271 seconds (Warm-up) Chain 3: 0.000253 seconds (Sampling) Chain 3: 0.000524 seconds (Total) Chain 3:=20 SAMPLING FOR MODEL 'b524cd829fcb9f50f6761f2451b62eec' NOW (CHAIN 4). Chain 4:=20 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:=20 Chain 4:=20 Chain 4: WARNING: No variance estimation is Chain 4: performed for num_warmup < 20 Chain 4:=20 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:=20 Chain 4: Elapsed Time: 0.00014 seconds (Warm-up) Chain 4: 0.000132 seconds (Sampling) Chain 4: 0.000272 seconds (Total) Chain 4:=20 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=20 > > Inference for Stan model: b524cd829fcb9f50f6761f2451b62eec. 4 chains, each with iter=3D10; warmup=3D5; thin=3D1;=20 post-warmup draws per chain=3D5, total post-warmup draws=3D20. 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=20 convergence, Rhat=3D1). >=20 --8<---------------cut here---------------end--------------->8--- Could you please show us an example like the above that fails when run in =E2=80=9Cguix shell -C=E2=80=9D? Please also provide the output of =E2= =80=9Cguix describe -f channels=E2=80=9D. Thank you! --=20 Ricardo