diff --git a/.github/workflows/check-standalone.yaml b/.github/workflows/check-standalone.yaml index 60afb95..55b09f7 100644 --- a/.github/workflows/check-standalone.yaml +++ b/.github/workflows/check-standalone.yaml @@ -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 diff --git a/R/rstan_config.R b/R/rstan_config.R index a73d684..87f8750 100644 --- a/R/rstan_config.R +++ b/R/rstan_config.R @@ -236,6 +236,9 @@ rstan_config <- function(pkgdir = ".") { } else { cppcode <- c("#include ", 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)