Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix stanfunctions failures with new Stan RNG #125

Merged
merged 4 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading