Skip to content

Commit

Permalink
Merge pull request #125 from stan-dev/fix-rng-error
Browse files Browse the repository at this point in the history
Fix stanfunctions failures with new Stan RNG
  • Loading branch information
andrjohns authored Apr 26, 2024
2 parents dc83777 + 0ffaf33 commit 2010d4b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/check-standalone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,19 @@ jobs:
rcmdcheck::rcmdcheck(path = "lgpr", args = c("--no-manual", "--as-cran"), build_args = "--no-manual")
shell: Rscript {0}

- name: Checkout RStan Experimental branch
uses: actions/checkout@v3
with:
repository: stan-dev/rstan
ref: experimental
path: rstan
submodules: 'recursive'

- name: Install Experimental StanHeaders and Experimental RStan
run: |
Sys.setenv(MAKEFLAGS=paste0("-j",parallel::detectCores()))
remotes::install_github("stan-dev/rstan@experimental", subdir="StanHeaders")
remotes::install_github("stan-dev/rstan@experimental", subdir="rstan/rstan")
install.packages("rstan/StanHeaders", type = "source", repos = NULL)
install.packages("rstan/rstan/rstan", type = "source", repos = NULL)
shell: Rscript {0}

- name: Check against Experimental StanHeaders and Experimental RStan
Expand Down
3 changes: 3 additions & 0 deletions R/rstan_config.R
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ rstan_config <- function(pkgdir = ".") {
} else {
cppcode <- c("#include <rstan/rstaninc.hpp>", cppcode)
}
if (utils::packageVersion('StanHeaders') >= "2.34") {
cppcode <- gsub("boost::ecuyer1988", "stan::rng_t", cppcode, fixed = TRUE)
}
# Stan header file
hdr_name <- .stan_prefix(model_name, ".h")
# get license file (if any)
Expand Down

0 comments on commit 2010d4b

Please sign in to comment.