From b216f855611c7bf2da7500c8c44bdb3fd8edbd5e Mon Sep 17 00:00:00 2001 From: Dirk Eddelbuettel Date: Tue, 7 May 2024 05:30:08 -0500 Subject: [PATCH 1/2] Armadillo 12.8.3 --- inst/include/armadillo_bits/arma_version.hpp | 2 +- .../include/armadillo_bits/compiler_setup.hpp | 3 -- inst/include/armadillo_bits/config.hpp | 5 +++ inst/include/armadillo_bits/debug.hpp | 8 ++--- .../armadillo_bits/fft_engine_fftw3.hpp | 32 ++++++++++++++++++- 5 files changed, 41 insertions(+), 9 deletions(-) diff --git a/inst/include/armadillo_bits/arma_version.hpp b/inst/include/armadillo_bits/arma_version.hpp index ed2c1844..ce15a285 100644 --- a/inst/include/armadillo_bits/arma_version.hpp +++ b/inst/include/armadillo_bits/arma_version.hpp @@ -23,7 +23,7 @@ #define ARMA_VERSION_MAJOR 12 #define ARMA_VERSION_MINOR 8 -#define ARMA_VERSION_PATCH 2 +#define ARMA_VERSION_PATCH 3 #define ARMA_VERSION_NAME "Cortisol Injector" diff --git a/inst/include/armadillo_bits/compiler_setup.hpp b/inst/include/armadillo_bits/compiler_setup.hpp index 7d9bbde5..29474aa9 100644 --- a/inst/include/armadillo_bits/compiler_setup.hpp +++ b/inst/include/armadillo_bits/compiler_setup.hpp @@ -377,14 +377,11 @@ #if defined(__SUNPRO_CC) - // http://www.oracle.com/technetwork/server-storage/solarisstudio/training/index-jsp-141991.html // http://www.oracle.com/technetwork/server-storage/solarisstudio/documentation/cplusplus-faq-355066.html - #if (__SUNPRO_CC < 0x5140) #error "*** newer compiler required ***" #endif - #endif diff --git a/inst/include/armadillo_bits/config.hpp b/inst/include/armadillo_bits/config.hpp index 6d7874ac..f1f3d3b9 100644 --- a/inst/include/armadillo_bits/config.hpp +++ b/inst/include/armadillo_bits/config.hpp @@ -201,6 +201,11 @@ #if defined(ARMA_EXTRA_DEBUG) #undef ARMA_NO_DEBUG + #undef ARMA_DONT_CHECK_NONFINITE + + #undef ARMA_CHECK_NONFINITE + #define ARMA_CHECK_NONFINITE + #undef ARMA_WARN_LEVEL #define ARMA_WARN_LEVEL 3 #endif diff --git a/inst/include/armadillo_bits/debug.hpp b/inst/include/armadillo_bits/debug.hpp index b436c432..02ad4bdd 100644 --- a/inst/include/armadillo_bits/debug.hpp +++ b/inst/include/armadillo_bits/debug.hpp @@ -579,7 +579,7 @@ arma_assert_same_size(const uword A_n_rows, const uword A_n_cols, const uword B_ -//! stop if given matrices have different sizes +//! stop if given matrices do not have the same size template arma_hot inline @@ -600,7 +600,7 @@ arma_assert_same_size(const Mat& A, const Mat& B, const char* x) -//! stop if given proxies have different sizes +//! stop if given proxies do not have the same size template arma_hot inline @@ -804,7 +804,7 @@ arma_assert_same_size(const uword A_n_rows, const uword A_n_cols, const uword A_ -//! stop if given cubes have different sizes +//! stop if given cubes do not have the same size template arma_hot inline @@ -883,7 +883,7 @@ arma_assert_same_size(const subview_cube& A, const ProxyCube& B, const c -//! stop if given cube proxies have different sizes +//! stop if given cube proxies do not have the same size template arma_hot inline diff --git a/inst/include/armadillo_bits/fft_engine_fftw3.hpp b/inst/include/armadillo_bits/fft_engine_fftw3.hpp index cabe5c96..9a560061 100644 --- a/inst/include/armadillo_bits/fft_engine_fftw3.hpp +++ b/inst/include/armadillo_bits/fft_engine_fftw3.hpp @@ -23,6 +23,13 @@ #if defined(ARMA_USE_FFTW3) +struct fft_engine_fftw3_aux + { + #if (!defined(ARMA_DONT_USE_STD_MUTEX)) + static inline std::mutex& get_plan_mutex() { static std::mutex plan_mutex; return plan_mutex; } + #endif + }; + template class fft_engine_fftw3 { @@ -74,7 +81,30 @@ class fft_engine_fftw3 const int fftw3_flags = fftw3_flag_destroy | fftw3_flag_estimate; arma_extra_debug_print("fft_engine_fftw3::constructor: generating 1D plan"); - fftw3_plan = fftw3::plan_dft_1d(N, X_work.memptr(), Y_work.memptr(), fftw3_sign, fftw3_flags); + + // only fftw3::execute() is thread safe, as per FFTW docs: + // https://www.fftw.org/fftw3_doc/Thread-safety.html + + #if defined(ARMA_USE_OPENMP) + { + #pragma omp critical (arma_fft_engine_fftw3) + { + fftw3_plan = fftw3::plan_dft_1d(N, X_work.memptr(), Y_work.memptr(), fftw3_sign, fftw3_flags); + } + } + #elif (!defined(ARMA_DONT_USE_STD_MUTEX)) + { + std::mutex& plan_mutex = fft_engine_fftw3_aux::get_plan_mutex(); + + const std::lock_guard lock(plan_mutex); + + fftw3_plan = fftw3::plan_dft_1d(N, X_work.memptr(), Y_work.memptr(), fftw3_sign, fftw3_flags); + } + #else + { + fftw3_plan = fftw3::plan_dft_1d(N, X_work.memptr(), Y_work.memptr(), fftw3_sign, fftw3_flags); + } + #endif if(fftw3_plan == nullptr) { arma_stop_runtime_error("fft_engine_fftw3::constructor: failed to create plan"); } } From 98bb35b0361a1b3ab05da2b4d881a63315e89c9e Mon Sep 17 00:00:00 2001 From: Dirk Eddelbuettel Date: Tue, 7 May 2024 05:48:05 -0500 Subject: [PATCH 2/2] RcppArmadillo 0.12.8.3.0 --- ChangeLog | 9 +++++++++ DESCRIPTION | 4 ++-- configure | 18 +++++++++--------- configure.ac | 2 +- inst/NEWS.Rd | 12 ++++++++++++ 5 files changed, 33 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6ea40512..b6819a2d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2024-05-07 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): RcppArmadillo 0.12.8.3.0 + * inst/NEWS.Rd: Idem + * configure.ac: Idem + * configure: Idem + + * inst/include/armadillo_bits/: Armadillo 12.8.3 + 2024-05-03 Dirk Eddelbuettel * DESCRIPTION (Version, Date): Increment micro version, update date diff --git a/DESCRIPTION b/DESCRIPTION index c1e6b941..57d4d010 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: RcppArmadillo Type: Package Title: 'Rcpp' Integration for the 'Armadillo' Templated Linear Algebra Library -Version: 0.12.8.2.1.1 -Date: 2024-05-03 +Version: 0.12.8.3.0 +Date: 2024-05-07 Author: Dirk Eddelbuettel, Romain Francois, Doug Bates, Binxiang Ni, and Conrad Sanderson Maintainer: Dirk Eddelbuettel Description: 'Armadillo' is a templated C++ linear algebra library (by Conrad diff --git a/configure b/configure index 9e655154..3185119e 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for RcppArmadillo 0.12.8.2.0. +# Generated by GNU Autoconf 2.71 for RcppArmadillo 0.12.8.3.0. # # Report bugs to . # @@ -610,8 +610,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='RcppArmadillo' PACKAGE_TARNAME='rcpparmadillo' -PACKAGE_VERSION='0.12.8.2.0' -PACKAGE_STRING='RcppArmadillo 0.12.8.2.0' +PACKAGE_VERSION='0.12.8.3.0' +PACKAGE_STRING='RcppArmadillo 0.12.8.3.0' PACKAGE_BUGREPORT='edd@debian.org' PACKAGE_URL='' @@ -1229,7 +1229,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures RcppArmadillo 0.12.8.2.0 to adapt to many kinds of systems. +\`configure' configures RcppArmadillo 0.12.8.3.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1291,7 +1291,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of RcppArmadillo 0.12.8.2.0:";; + short | recursive ) echo "Configuration of RcppArmadillo 0.12.8.3.0:";; esac cat <<\_ACEOF @@ -1372,7 +1372,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -RcppArmadillo configure 0.12.8.2.0 +RcppArmadillo configure 0.12.8.3.0 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1486,7 +1486,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by RcppArmadillo $as_me 0.12.8.2.0, which was +It was created by RcppArmadillo $as_me 0.12.8.3.0, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3944,7 +3944,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by RcppArmadillo $as_me 0.12.8.2.0, which was +This file was extended by RcppArmadillo $as_me 0.12.8.3.0, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -3999,7 +3999,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -RcppArmadillo config.status 0.12.8.2.0 +RcppArmadillo config.status 0.12.8.3.0 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 383d60fc..00318220 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ AC_PREREQ([2.69]) ## Process this file with autoconf to produce a configure script. -AC_INIT([RcppArmadillo],[0.12.8.2.0],[edd@debian.org]) +AC_INIT([RcppArmadillo],[0.12.8.3.0],[edd@debian.org]) ## Set R_HOME, respecting an environment variable if one is set : ${R_HOME=$(R RHOME)} diff --git a/inst/NEWS.Rd b/inst/NEWS.Rd index a0321423..03873426 100644 --- a/inst/NEWS.Rd +++ b/inst/NEWS.Rd @@ -3,6 +3,18 @@ \newcommand{\ghpr}{\href{https://github.com/RcppCore/RcppArmadillo/pull/#1}{##1}} \newcommand{\ghit}{\href{https://github.com/RcppCore/RcppArmadillo/issues/#1}{##1}} +\section{Changes in RcppArmadillo version 0.12.8.3.0 (2024-05-07)}{ + \itemize{ + \item Upgraded to Armadillo release 12.8.3 (Cortisol Injector) + \itemize{ + \item Fix issue in \code{fft()} and \code{fft2()} in multi-threaded + contexts with FFTW3 enabled + } + \item No longer set C++11 for the \pkg{Rcpp} plugin as this standard has + been the default by R for very long time now. + } +} + \section{Changes in RcppArmadillo version 0.12.8.2.1 (2024-04-15)}{ \itemize{ \item One-char bug fix release commenting out one test that upsets