From ca9fc613b0291dbfff33c7f42e9f215fe845f88e Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 11 Sep 2023 13:02:56 +0200 Subject: [PATCH 1/4] Fix packages with stanfunctions under rstan 2.33+ --- R/rstan_config.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/rstan_config.R b/R/rstan_config.R index 9e71ba4..a73d684 100644 --- a/R/rstan_config.R +++ b/R/rstan_config.R @@ -199,7 +199,7 @@ rstan_config <- function(pkgdir = ".") { # Stanc3 gives 'auto' return type for standalone functions, which # causes errors with Rcpp::export, so need to replace the auto # return with the plain type from the main definition - if(utils::packageVersion('rstan') >= "2.26") { + if(utils::packageVersion('rstan') >= "2.26" && utils::packageVersion('StanHeaders') < "2.33") { # Extract line numbers of functions to be exported decl_lines = grep("// \\[\\[Rcpp::export]]",cpp_lines) + 1 From 362b228f7e14b85371feb6de0db6fa93d564422d Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 11 Sep 2023 13:45:24 +0200 Subject: [PATCH 2/4] Fix workflow error --- .github/workflows/check-standalone.yaml | 2 +- .github/workflows/check-standard.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-standalone.yaml b/.github/workflows/check-standalone.yaml index fc00602..60afb95 100644 --- a/.github/workflows/check-standalone.yaml +++ b/.github/workflows/check-standalone.yaml @@ -38,7 +38,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: local::. rcmdcheck BH RcppParallel RcppEigen Rcpp rstan StanHeaders RCurl remotes + extra-packages: local::. rcmdcheck BH RcppParallel RcppEigen Rcpp rstan StanHeaders RCurl remotes V8 - name: Checkout lgpr package run: | diff --git a/.github/workflows/check-standard.yaml b/.github/workflows/check-standard.yaml index 680dc7b..f90fd68 100644 --- a/.github/workflows/check-standard.yaml +++ b/.github/workflows/check-standard.yaml @@ -42,7 +42,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: rcmdcheck BH RcppParallel RcppEigen Rcpp rstan StanHeaders + extra-packages: rcmdcheck BH RcppParallel RcppEigen Rcpp rstan StanHeaders V8 - name: Check against CRAN StanHeaders and CRAN RStan uses: r-lib/actions/check-r-package@v2 From 36ffdb123f8aeae67e55cf141864372d18bfefc0 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 11 Sep 2023 15:39:48 +0200 Subject: [PATCH 3/4] Test against lgpr branch with new array syntax --- .github/workflows/check-standalone.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-standalone.yaml b/.github/workflows/check-standalone.yaml index 60afb95..b7dbc8c 100644 --- a/.github/workflows/check-standalone.yaml +++ b/.github/workflows/check-standalone.yaml @@ -42,7 +42,8 @@ jobs: - name: Checkout lgpr package run: | - git clone https://github.com/jtimonen/lgpr + git clone https://github.com/andrjohns/lgpr + git checkout array-syntax - name: Check against CRAN StanHeaders and CRAN RStan run: | From b280a5e554cd60f56ef222cfb8b6b75eb5f2acdc Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 11 Sep 2023 16:07:23 +0200 Subject: [PATCH 4/4] Forgot cd --- .github/workflows/check-standalone.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-standalone.yaml b/.github/workflows/check-standalone.yaml index b7dbc8c..ceeb27a 100644 --- a/.github/workflows/check-standalone.yaml +++ b/.github/workflows/check-standalone.yaml @@ -43,7 +43,7 @@ jobs: - name: Checkout lgpr package run: | git clone https://github.com/andrjohns/lgpr - git checkout array-syntax + cd lgpr && git checkout array-syntax - name: Check against CRAN StanHeaders and CRAN RStan run: |