Skip to content

Commit

Permalink
Merge pull request #4 from andrjohns/feature/rstan-next
Browse files Browse the repository at this point in the history
Compatibility with Future StanHeaders
  • Loading branch information
anastasiospanagiotelis authored Apr 2, 2023
2 parents 73188b0 + d3d6223 commit 3f6854c
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 91 deletions.
1 change: 0 additions & 1 deletion .github/.gitignore

This file was deleted.

81 changes: 0 additions & 81 deletions .github/workflows/R-CMD-check.yaml

This file was deleted.

6 changes: 4 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ Description: Training of reconciliation weights for probabilistic forecasts to o
License: GPL-3
URL: https://github.com/anastasiospanagiotelis/ProbReco
Depends: R (>= 3.5.0)
Imports: Rcpp (>= 1.0.2), purrr(>= 0.3.2), mvtnorm, Rdpack
Imports: Rcpp (>= 1.0.2), purrr(>= 0.3.2), mvtnorm, Rdpack, rstan
Suggests: knitr, rmarkdown, fable, dplyr,tidyr, magrittr, stringi
LinkingTo: Rcpp, RcppEigen, StanHeaders (>= 2.19.1), BH
LinkingTo: Rcpp, RcppEigen, StanHeaders (>= 2.19.1), BH, RcppParallel
NeedsCompilation: yes
RdMacros: Rdpack
RoxygenNote: 7.1.1
LazyData: true
VignetteBuilder: knitr
Encoding: UTF-8
BugReports: https://github.com/anastasiospanagiotelis/ProbReco/issues
SystemRequirements: GNU make, C++14
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
useDynLib(ProbReco)
useDynLib(ProbReco, .registration = TRUE)
importFrom(Rcpp, evalCpp)
exportPattern("^[[:alpha:]]+")
importFrom(stats, rnorm, sd,cov)
Expand Down
Empty file removed src/.Rhistory
Empty file.
15 changes: 12 additions & 3 deletions src/Makevars
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## With Rcpp 0.11.0 and later, we no longer need to set PKG_LIBS as there is
## no user-facing library. The include path to headers is already set by R.
#PKG_LIBS =
#PKG_LIBS =

## With R 3.1.0 or later, you can uncomment the following line to tell R to
## With R 3.1.0 or later, you can uncomment the following line to tell R to
## enable compilation with C++11 (or even C++14) where available
CXX_STD = CXX14

Expand All @@ -14,4 +14,13 @@ CXX=$(CCACHE) g++$(VER)
CXX11=$(CCACHE) g++$(VER)
CXX14=$(CCACHE) g++$(VER)
FC=$(CCACHE) gfortran$(VER)
F77=$(CCACHE) gfortran$(VER)
F77=$(CCACHE) gfortran$(VER)

STANHEADERS_SRC = $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript" -e "message()" -e "cat(system.file('include', 'src', package = 'StanHeaders', mustWork = TRUE))" -e "message()" | grep "StanHeaders")

STANC_FLAGS = $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript" -e "cat(ifelse(utils::packageVersion('rstan') >= 2.26, '-DUSE_STANC3',''))")
PKG_CPPFLAGS += -I"../inst/include" -I"$(STANHEADERS_SRC)" -DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG -DBOOST_MATH_OVERFLOW_ERROR_POLICY=errno_on_error $(STANC_FLAGS)
PKG_CXXFLAGS += $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript" -e "RcppParallel::CxxFlags()") $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript" -e "StanHeaders:::CxxFlags()")
PKG_LIBS += $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript" -e "RcppParallel::RcppParallelLibs()") $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript" -e "StanHeaders:::LdFlags()")

CXX_STD = CXX14
15 changes: 12 additions & 3 deletions src/Makevars.win
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## With Rcpp 0.11.0 and later, we no longer need to set PKG_LIBS as there is
## no user-facing library. The include path to headers is already set by R.
#PKG_LIBS =
#PKG_LIBS =

## With R 3.1.0 or later, you can uncomment the following line to tell R to
## With R 3.1.0 or later, you can uncomment the following line to tell R to
## enable compilation with C++11 (or even C++14) where available
CXX_STD = CXX14

Expand All @@ -13,4 +13,13 @@ CXX=$(CCACHE) g++$(VER)
CXX11=$(CCACHE) g++$(VER)
CXX14=$(CCACHE) g++$(VER)
FC=$(CCACHE) gfortran$(VER)
F77=$(CCACHE) gfortran$(VER)
F77=$(CCACHE) gfortran$(VER)

STANHEADERS_SRC = $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript" -e "message()" -e "cat(system.file('include', 'src', package = 'StanHeaders', mustWork = TRUE))" -e "message()" | grep "StanHeaders")

STANC_FLAGS = $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript" -e "cat(ifelse(utils::packageVersion('rstan') >= 2.26, '-DUSE_STANC3',''))")
PKG_CPPFLAGS += -I"../inst/include" -I"$(STANHEADERS_SRC)" -DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG -DRCPP_PARALLEL_USE_TBB=1 $(STANC_FLAGS)
PKG_CXXFLAGS += $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript" -e "RcppParallel::CxxFlags()") $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript" -e "StanHeaders:::CxxFlags()")
PKG_LIBS += $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript" -e "RcppParallel::RcppParallelLibs()") $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript" -e "StanHeaders:::LdFlags()")

CXX_STD = CXX14
Binary file removed src/ProbReco.so
Binary file not shown.
Binary file removed src/RcppExports.o
Binary file not shown.
Binary file removed src/scores.o
Binary file not shown.

0 comments on commit 3f6854c

Please sign in to comment.