From 7e6e4518eb69f0b54951426047ac7cc8f6217feb Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Thu, 9 Feb 2023 18:54:54 +0200 Subject: [PATCH 1/2] Fix namespace --- DESCRIPTION | 8 +++++--- NAMESPACE | 1 + R/llik.R | 1 + src/Makevars | 5 ++++- src/Makevars.win | 3 +++ 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index d41d9d6..0587664 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -13,7 +13,8 @@ Suggests: testthat (>= 3.0.0) Imports: Rcpp (>= 1.0.8), - checkmate + checkmate, + RcppParallel Description: Provides the log-likelihoods with gradients from 'stan' (Carpenter et al (2015), ) needed for generalized log-likelihood estimation in 'nlmixr2' @@ -25,13 +26,14 @@ BugReports: https://github.com/nlmixr2/rxode2ll/issues/ NeedsCompilation: yes License: GPL (>= 3) URL: https://nlmixr2.github.io/rxode2ll/, https://github.com/nlmixr2/rxode2ll/ -RoxygenNote: 7.2.1 +RoxygenNote: 7.2.3 Biarch: true LinkingTo: Rcpp (>= 1.0.8), RcppEigen (>= 0.3.3.9.2), StanHeaders (>= 2.21.0.7), - BH (>= 1.78.0.0) + BH (>= 1.78.0.0), + RcppParallel Encoding: UTF-8 Language: en-US Roxygen: list(markdown = TRUE) diff --git a/NAMESPACE b/NAMESPACE index d062fa0..f378804 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -16,4 +16,5 @@ export(llikT) export(llikUnif) export(llikWeibull) importFrom(Rcpp,sourceCpp) +importFrom(RcppParallel,RcppParallelLibs) useDynLib(rxode2ll, .registration=TRUE) diff --git a/R/llik.R b/R/llik.R index 901a246..6b33805 100644 --- a/R/llik.R +++ b/R/llik.R @@ -12,6 +12,7 @@ #' @author Matthew L. Fidler #' @export #' @importFrom Rcpp sourceCpp +#' @importFrom RcppParallel RcppParallelLibs #' @examples #' #' llikNorm(0) diff --git a/src/Makevars b/src/Makevars index 0e20d07..eb9811a 100644 --- a/src/Makevars +++ b/src/Makevars @@ -1,4 +1,7 @@ CXX_STD = CXX14 CXX14STD = -std=gnu++14 PKG_CXXFLAGS = -DBOOST_DISABLE_ASSERTS -DBOOST_NO_CXX11_STATIC_ASSERT -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT - +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()") diff --git a/src/Makevars.win b/src/Makevars.win index 09a56d5..70715f7 100644 --- a/src/Makevars.win +++ b/src/Makevars.win @@ -1,3 +1,6 @@ CXX_STD = CXX14 CXX14STD = -std=c++1y PKG_CXXFLAGS = -DBOOST_DISABLE_ASSERTS -DBOOST_NO_CXX11_STATIC_ASSERT -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT +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.exe" -e "RcppParallel::RcppParallelLibs()") From 6ebfc802ec28b73f41fb33be6410915341a9d379 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Thu, 9 Feb 2023 19:10:01 +0200 Subject: [PATCH 2/2] GNU make --- DESCRIPTION | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 0587664..58a3609 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -24,7 +24,7 @@ Description: Provides the log-likelihoods with gradients from 'stan' the 'nlmixr2' models during estimation. BugReports: https://github.com/nlmixr2/rxode2ll/issues/ NeedsCompilation: yes -License: GPL (>= 3) +License: GPL (>= 3) URL: https://nlmixr2.github.io/rxode2ll/, https://github.com/nlmixr2/rxode2ll/ RoxygenNote: 7.2.3 Biarch: true @@ -38,3 +38,4 @@ Encoding: UTF-8 Language: en-US Roxygen: list(markdown = TRUE) Config/testthat/edition: 3 +SystemRequirements: GNU make