Skip to content

Commit 12ce70d

Browse files
authored
Merge pull request #440 from RcppCore/feature/armadillo_12.8.3
RcppArmadillo 0.12.8.3.0 with Armadillo 12.8.3
2 parents af50cb4 + 98bb35b commit 12ce70d

File tree

10 files changed

+74
-21
lines changed

10 files changed

+74
-21
lines changed

ChangeLog

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
2024-05-07 Dirk Eddelbuettel <[email protected]>
2+
3+
* DESCRIPTION (Version, Date): RcppArmadillo 0.12.8.3.0
4+
* inst/NEWS.Rd: Idem
5+
* configure.ac: Idem
6+
* configure: Idem
7+
8+
* inst/include/armadillo_bits/: Armadillo 12.8.3
9+
110
2024-05-03 Dirk Eddelbuettel <[email protected]>
211

312
* DESCRIPTION (Version, Date): Increment micro version, update date

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: RcppArmadillo
22
Type: Package
33
Title: 'Rcpp' Integration for the 'Armadillo' Templated Linear Algebra Library
4-
Version: 0.12.8.2.1.1
5-
Date: 2024-05-03
4+
Version: 0.12.8.3.0
5+
Date: 2024-05-07
66
Author: Dirk Eddelbuettel, Romain Francois, Doug Bates, Binxiang Ni, and Conrad Sanderson
77
Maintainer: Dirk Eddelbuettel <[email protected]>
88
Description: 'Armadillo' is a templated C++ linear algebra library (by Conrad

configure

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.71 for RcppArmadillo 0.12.8.2.0.
3+
# Generated by GNU Autoconf 2.71 for RcppArmadillo 0.12.8.3.0.
44
#
55
# Report bugs to <[email protected]>.
66
#
@@ -610,8 +610,8 @@ MAKEFLAGS=
610610
# Identity of this package.
611611
PACKAGE_NAME='RcppArmadillo'
612612
PACKAGE_TARNAME='rcpparmadillo'
613-
PACKAGE_VERSION='0.12.8.2.0'
614-
PACKAGE_STRING='RcppArmadillo 0.12.8.2.0'
613+
PACKAGE_VERSION='0.12.8.3.0'
614+
PACKAGE_STRING='RcppArmadillo 0.12.8.3.0'
615615
PACKAGE_BUGREPORT='[email protected]'
616616
PACKAGE_URL=''
617617

@@ -1229,7 +1229,7 @@ if test "$ac_init_help" = "long"; then
12291229
# Omit some internal or obsolete options to make the list less imposing.
12301230
# This message is too long to be a string in the A/UX 3.1 sh.
12311231
cat <<_ACEOF
1232-
\`configure' configures RcppArmadillo 0.12.8.2.0 to adapt to many kinds of systems.
1232+
\`configure' configures RcppArmadillo 0.12.8.3.0 to adapt to many kinds of systems.
12331233
12341234
Usage: $0 [OPTION]... [VAR=VALUE]...
12351235
@@ -1291,7 +1291,7 @@ fi
12911291

12921292
if test -n "$ac_init_help"; then
12931293
case $ac_init_help in
1294-
short | recursive ) echo "Configuration of RcppArmadillo 0.12.8.2.0:";;
1294+
short | recursive ) echo "Configuration of RcppArmadillo 0.12.8.3.0:";;
12951295
esac
12961296
cat <<\_ACEOF
12971297
@@ -1372,7 +1372,7 @@ fi
13721372
test -n "$ac_init_help" && exit $ac_status
13731373
if $ac_init_version; then
13741374
cat <<\_ACEOF
1375-
RcppArmadillo configure 0.12.8.2.0
1375+
RcppArmadillo configure 0.12.8.3.0
13761376
generated by GNU Autoconf 2.71
13771377
13781378
Copyright (C) 2021 Free Software Foundation, Inc.
@@ -1486,7 +1486,7 @@ cat >config.log <<_ACEOF
14861486
This file contains any messages produced by compilers while
14871487
running configure, to aid debugging if configure makes a mistake.
14881488
1489-
It was created by RcppArmadillo $as_me 0.12.8.2.0, which was
1489+
It was created by RcppArmadillo $as_me 0.12.8.3.0, which was
14901490
generated by GNU Autoconf 2.71. Invocation command line was
14911491
14921492
$ $0$ac_configure_args_raw
@@ -3944,7 +3944,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
39443944
# report actual input values of CONFIG_FILES etc. instead of their
39453945
# values after options handling.
39463946
ac_log="
3947-
This file was extended by RcppArmadillo $as_me 0.12.8.2.0, which was
3947+
This file was extended by RcppArmadillo $as_me 0.12.8.3.0, which was
39483948
generated by GNU Autoconf 2.71. Invocation command line was
39493949
39503950
CONFIG_FILES = $CONFIG_FILES
@@ -3999,7 +3999,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
39993999
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
40004000
ac_cs_config='$ac_cs_config_escaped'
40014001
ac_cs_version="\\
4002-
RcppArmadillo config.status 0.12.8.2.0
4002+
RcppArmadillo config.status 0.12.8.3.0
40034003
configured by $0, generated by GNU Autoconf 2.71,
40044004
with options \\"\$ac_cs_config\\"
40054005

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
AC_PREREQ([2.69])
1212

1313
## Process this file with autoconf to produce a configure script.
14-
AC_INIT([RcppArmadillo],[0.12.8.2.0],[[email protected]])
14+
AC_INIT([RcppArmadillo],[0.12.8.3.0],[[email protected]])
1515

1616
## Set R_HOME, respecting an environment variable if one is set
1717
: ${R_HOME=$(R RHOME)}

inst/NEWS.Rd

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@
33
\newcommand{\ghpr}{\href{https://github.com/RcppCore/RcppArmadillo/pull/#1}{##1}}
44
\newcommand{\ghit}{\href{https://github.com/RcppCore/RcppArmadillo/issues/#1}{##1}}
55

6+
\section{Changes in RcppArmadillo version 0.12.8.3.0 (2024-05-07)}{
7+
\itemize{
8+
\item Upgraded to Armadillo release 12.8.3 (Cortisol Injector)
9+
\itemize{
10+
\item Fix issue in \code{fft()} and \code{fft2()} in multi-threaded
11+
contexts with FFTW3 enabled
12+
}
13+
\item No longer set C++11 for the \pkg{Rcpp} plugin as this standard has
14+
been the default by R for very long time now.
15+
}
16+
}
17+
618
\section{Changes in RcppArmadillo version 0.12.8.2.1 (2024-04-15)}{
719
\itemize{
820
\item One-char bug fix release commenting out one test that upsets

inst/include/armadillo_bits/arma_version.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
#define ARMA_VERSION_MAJOR 12
2525
#define ARMA_VERSION_MINOR 8
26-
#define ARMA_VERSION_PATCH 2
26+
#define ARMA_VERSION_PATCH 3
2727
#define ARMA_VERSION_NAME "Cortisol Injector"
2828

2929

inst/include/armadillo_bits/compiler_setup.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,14 +377,11 @@
377377

378378

379379
#if defined(__SUNPRO_CC)
380-
381380
// http://www.oracle.com/technetwork/server-storage/solarisstudio/training/index-jsp-141991.html
382381
// http://www.oracle.com/technetwork/server-storage/solarisstudio/documentation/cplusplus-faq-355066.html
383-
384382
#if (__SUNPRO_CC < 0x5140)
385383
#error "*** newer compiler required ***"
386384
#endif
387-
388385
#endif
389386

390387

inst/include/armadillo_bits/config.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,11 @@
201201

202202
#if defined(ARMA_EXTRA_DEBUG)
203203
#undef ARMA_NO_DEBUG
204+
#undef ARMA_DONT_CHECK_NONFINITE
205+
206+
#undef ARMA_CHECK_NONFINITE
207+
#define ARMA_CHECK_NONFINITE
208+
204209
#undef ARMA_WARN_LEVEL
205210
#define ARMA_WARN_LEVEL 3
206211
#endif

inst/include/armadillo_bits/debug.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ arma_assert_same_size(const uword A_n_rows, const uword A_n_cols, const uword B_
579579

580580

581581

582-
//! stop if given matrices have different sizes
582+
//! stop if given matrices do not have the same size
583583
template<typename eT1, typename eT2>
584584
arma_hot
585585
inline
@@ -600,7 +600,7 @@ arma_assert_same_size(const Mat<eT1>& A, const Mat<eT2>& B, const char* x)
600600

601601

602602

603-
//! stop if given proxies have different sizes
603+
//! stop if given proxies do not have the same size
604604
template<typename eT1, typename eT2>
605605
arma_hot
606606
inline
@@ -804,7 +804,7 @@ arma_assert_same_size(const uword A_n_rows, const uword A_n_cols, const uword A_
804804

805805

806806

807-
//! stop if given cubes have different sizes
807+
//! stop if given cubes do not have the same size
808808
template<typename eT1, typename eT2>
809809
arma_hot
810810
inline
@@ -883,7 +883,7 @@ arma_assert_same_size(const subview_cube<eT>& A, const ProxyCube<T1>& B, const c
883883

884884

885885

886-
//! stop if given cube proxies have different sizes
886+
//! stop if given cube proxies do not have the same size
887887
template<typename eT1, typename eT2>
888888
arma_hot
889889
inline

inst/include/armadillo_bits/fft_engine_fftw3.hpp

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@
2323

2424
#if defined(ARMA_USE_FFTW3)
2525

26+
struct fft_engine_fftw3_aux
27+
{
28+
#if (!defined(ARMA_DONT_USE_STD_MUTEX))
29+
static inline std::mutex& get_plan_mutex() { static std::mutex plan_mutex; return plan_mutex; }
30+
#endif
31+
};
32+
2633
template<typename cx_type, bool inverse>
2734
class fft_engine_fftw3
2835
{
@@ -74,7 +81,30 @@ class fft_engine_fftw3
7481
const int fftw3_flags = fftw3_flag_destroy | fftw3_flag_estimate;
7582

7683
arma_extra_debug_print("fft_engine_fftw3::constructor: generating 1D plan");
77-
fftw3_plan = fftw3::plan_dft_1d<cx_type>(N, X_work.memptr(), Y_work.memptr(), fftw3_sign, fftw3_flags);
84+
85+
// only fftw3::execute() is thread safe, as per FFTW docs:
86+
// https://www.fftw.org/fftw3_doc/Thread-safety.html
87+
88+
#if defined(ARMA_USE_OPENMP)
89+
{
90+
#pragma omp critical (arma_fft_engine_fftw3)
91+
{
92+
fftw3_plan = fftw3::plan_dft_1d<cx_type>(N, X_work.memptr(), Y_work.memptr(), fftw3_sign, fftw3_flags);
93+
}
94+
}
95+
#elif (!defined(ARMA_DONT_USE_STD_MUTEX))
96+
{
97+
std::mutex& plan_mutex = fft_engine_fftw3_aux::get_plan_mutex();
98+
99+
const std::lock_guard<std::mutex> lock(plan_mutex);
100+
101+
fftw3_plan = fftw3::plan_dft_1d<cx_type>(N, X_work.memptr(), Y_work.memptr(), fftw3_sign, fftw3_flags);
102+
}
103+
#else
104+
{
105+
fftw3_plan = fftw3::plan_dft_1d<cx_type>(N, X_work.memptr(), Y_work.memptr(), fftw3_sign, fftw3_flags);
106+
}
107+
#endif
78108

79109
if(fftw3_plan == nullptr) { arma_stop_runtime_error("fft_engine_fftw3::constructor: failed to create plan"); }
80110
}

0 commit comments

Comments
 (0)