Skip to content

Commit

Permalink
Merge pull request #110 from stan-dev/fix-rstan231-compat
Browse files Browse the repository at this point in the history
Bugfix for standalone functions under 2.31
  • Loading branch information
jgabry committed Mar 20, 2023
2 parents f309be2 + c941a22 commit 14e3c25
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/check-standalone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
extra-packages: local::. rcmdcheck BH RcppParallel RcppEigen Rcpp rstan StanHeaders RCurl remotes

- name: Checkout lgpr package
run: |
Expand Down Expand Up @@ -74,3 +74,15 @@ jobs:
rcmdcheck::rcmdcheck(path = "lgpr", args = c("--no-manual", "--as-cran"), build_args = "--no-manual")
shell: Rscript {0}

- 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")
shell: Rscript {0}

- name: Check against Experimental StanHeaders and Experimental RStan
run: |
rcmdcheck::rcmdcheck(path = "lgpr", args = c("--no-manual", "--as-cran"), build_args = "--no-manual")
shell: Rscript {0}

2 changes: 1 addition & 1 deletion R/rstan_config.R
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ rstan_config <- function(pkgdir = ".") {
rm_prev <- gsub(".*\\{", "", rm_operator)
} else {
# Find first declaration of function (will be the forward declaration)
first_decl <- grep(fun_name, cpp_lines)[1]
first_decl <- grep(paste0(fun_name,"\\("), cpp_lines)[1]

# The return type will be between the function name and the semicolon terminating
# the previous line
Expand Down

0 comments on commit 14e3c25

Please sign in to comment.