diff --git a/DESCRIPTION b/DESCRIPTION index 813d99dc..1586e294 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,9 +1,9 @@ Package: DAISIE Type: Package Title: Dynamical Assembly of Islands by Speciation, Immigration and Extinction -Version: 4.3.3 -Date: 2023-03-10 -Depends: R (>= 4.1.0) +Version: 4.3.4 +Date: 2023-03-16 +Depends: R (>= 4.2.0) biocViews: Imports: deSolve, @@ -111,6 +111,7 @@ Description: Simulates and computes the (maximum) likelihood of a dynamical extinction. See e.g. Valente et al. 2015. Ecology Letters 18: 844-852, . NeedsCompilation: yes +SystemRequirements: C++17 Encoding: UTF-8 VignetteBuilder: knitr URL: https://github.com/rsetienne/DAISIE diff --git a/NEWS.md b/NEWS.md index eaf98bc1..7819a59e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,13 @@ +# DAISIE 4.3.4 + +* Require C++17 via `CXX_STD` flag on Makevars[.win]. +* Add SystemRequirements: C++17 to DESCRIPTION as for that standard +"Writing R Extensions" requires it be explicitly stated. +* Depends on R (>= 4.2.0) due to C++17 requirement on Windows due to Rtools 4.0, +which is used for R 4.0-4.1. Toolchain for Rtools 4.0 is gcc 8.3 but "GCC 9.1 +was the first release with non-experimental C++17 support". as per +https://gcc.gnu.org/. + # DAISIE 4.3.3 * Address problem detected by valgrind: unitialized member variable diff --git a/src/DAISIE_CS.cpp b/src/DAISIE_CS.cpp index 332f9957..8afa8f8d 100644 --- a/src/DAISIE_CS.cpp +++ b/src/DAISIE_CS.cpp @@ -1,7 +1,6 @@ // [[Rcpp::plugins(cpp14)]] // [[Rcpp::depends(BH)]] - //' @export daisie_odeint_cs #include "config.h" @@ -16,7 +15,7 @@ namespace { // maximal number of steps the solver is executing. // prevents odeint from getting stuckle // at-hoc - 'solution'. - static constexpr int default_max_cs_steps = 1'000'000; + static constexpr int default_max_cs_steps = 1000000; static int max_cs_steps = default_max_cs_steps; // step-size factor for adams_bashforth_moulton integration diff --git a/src/DAISIE_IW.cpp b/src/DAISIE_IW.cpp index 1c74694e..ae84a11a 100644 --- a/src/DAISIE_IW.cpp +++ b/src/DAISIE_IW.cpp @@ -1,6 +1,9 @@ //' @export daisie_odeint_iw + // [[Rcpp::plugins(cpp14)]] // [[Rcpp::plugins(openmp)]] +// [[Rcpp::depends(BH)]] +// [[Rcpp::depends(RcppEigen)]] #include "config.h" #include "DAISIE_odeint.h" diff --git a/src/DAISIE_odeint.h b/src/DAISIE_odeint.h index a2d531a5..20fa9fa2 100644 --- a/src/DAISIE_odeint.h +++ b/src/DAISIE_odeint.h @@ -12,7 +12,6 @@ #include #include - using namespace Rcpp; using namespace boost::numeric::odeint; @@ -45,7 +44,6 @@ class padded_vector_view namespace daisie_odeint { - extern double abm_factor; @@ -89,6 +87,7 @@ namespace daisie_odeint { { if (!J_) { // once-only, generic evaluation + J_ = std::make_unique>(J.size1(), J.size2()); auto single = vector_t(x.size(), 0); auto dxdt = vector_t(x.size()); @@ -106,7 +105,7 @@ namespace daisie_odeint { RHS& rhs_; std::unique_ptr> J_; - }; + }; } diff --git a/src/Makevars b/src/Makevars index 1fada8d1..3e7f275e 100644 --- a/src/Makevars +++ b/src/Makevars @@ -1,2 +1,2 @@ -CXX_STD = CXX14 +CXX_STD = CXX17 PKG_CPPFLAGS = -D_HAS_AUTO_PTR_ETC=0 diff --git a/src/Makevars.win b/src/Makevars.win index 1fada8d1..3e7f275e 100644 --- a/src/Makevars.win +++ b/src/Makevars.win @@ -1,2 +1,2 @@ -CXX_STD = CXX14 +CXX_STD = CXX17 PKG_CPPFLAGS = -D_HAS_AUTO_PTR_ETC=0