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

Bugfix for standalone functions under 2.31 #110

Merged
merged 1 commit into from Mar 20, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/workflows/check-standalone.yaml
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
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