Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 3 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: RcppArmadillo
Type: Package
Title: 'Rcpp' Integration for the 'Armadillo' Templated Linear Algebra Library
Version: 15.2.4-1
Date: 2026-03-17
Version: 15.2.4-1.1
Date: 2026-03-20
Authors@R: c(person("Dirk", "Eddelbuettel", role = c("aut", "cre"), email = "edd@debian.org",
comment = c(ORCID = "0000-0001-6419-907X")),
person("Romain", "Francois", role = "aut",
Expand All @@ -28,11 +28,7 @@ Description: 'Armadillo' is a templated C++ linear algebra library aiming toward
.
The 'RcppArmadillo' package includes the header files from the 'Armadillo' library;
users do not need to install 'Armadillo' itself in order to use 'RcppArmadillo'.
Starting from release 15.0.0, the minimum compilation standard is C++14 so 'Armadillo'
version 14.6.3 is included as a fallback when an R package forces the C++11 standard.
Package authors should set a '#define' to select the 'current' version, or select the
'legacy' version (also chosen as default) if they must. See 'GitHub issue #475' for
details.
Starting from release 15.0.0, the minimum compilation standard is C++14.
.
Since release 7.800.0, 'Armadillo' is licensed under Apache License 2; previous
releases were under licensed as MPL 2.0 from version 3.800.0 onwards and LGPL-3
Expand Down
5 changes: 1 addition & 4 deletions inst/include/RcppArmadillo.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

// RcppArmadillo.h: Rcpp/Armadillo glue
//
// Copyright (C) 2010 - 2021 Dirk Eddelbuettel, Romain Francois and Douglas Bates
// Copyright (C) 2010-2026 Dirk Eddelbuettel, Romain Francois and Douglas Bates
//
// This file is part of RcppArmadillo.
//
Expand All @@ -25,9 +25,6 @@
#error "The file 'Rcpp.h' should not be included. Please correct to include only 'RcppArmadillo.h'."
#endif

// Deal with Armadillo 14.6.3 (fallback) versus 15.0.* (or later, preference) selection
#include <RcppArmadillo/version/arma.h>

// Set up actual #include <armadillo> after first #include <RcppArmadilloConfig> and more config
#include <RcppArmadillo/interface/RcppArmadilloForward.h>

Expand Down
39 changes: 4 additions & 35 deletions inst/include/RcppArmadillo/interface/RcppArmadilloForward.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// RcppArmadilloForward.h: Rcpp/Armadillo glue
//
// Copyright (C) 2010 - 2014 Dirk Eddelbuettel, Romain Francois and Douglas Bates
// Copyright (C) 2015 - 2025 Dirk Eddelbuettel
// Copyright (C) 2019 - 2025 Conrad Sanderson
// Copyright (C) 2015 - 2026 Dirk Eddelbuettel
// Copyright (C) 2019 - 2026 Conrad Sanderson
//
// This file is part of RcppArmadillo.
//
Expand Down Expand Up @@ -47,39 +47,8 @@
// installation of Armadillo
#define ARMA_DONT_USE_WRAPPER

// See version/arma.h header for the (user and/or compilation) drive selection of these defines
#if defined(ARMA_SELECTED_CURRENT_VERSION) || (__cplusplus >= 201402L)

// we include Armadillo 15.0.1 here -- but do it quietly
//#pragma message("Using compilation with current Armadillo version.")

// Armadillo 15.0.1 or later
#include "current/armadillo"

#else

// we use a catch-all else branch to provide for packages including this file directly
// needless to say, we recommend one of the official entry-point headers
#if !defined(ARMA_SELECTED_LEGACY_VERSION)
#pragma message("Neither 'current' nor 'legacy' version selected. Ensure you use proper entry point headers.")
#endif

// we include Armadillo 14.6.3 here -- but do it quietly
//#pragma message("Using fallback compilation with Armadillo 14.6.3.")

// Armadillo has deprecation warnings (which RcppArmadillo suppressed at time to
// minimise issies at CRAN). Should your package display any, and you decide
// _not_ to fix the root causes (see RcppArmadillo GitHub Issues #391 and #402
// for details) then defining the following macro will help. You can add a
// #define in your source code before including the RcppArmadillo header, or add
// a -DARMA_IGNORE_DEPRECATED_MARKER to the PKG_CPPFLAGS in src/Makevars.
//
// Renabling globally again for Armadillo 14.6.* as too many packages trigger this
#define ARMA_IGNORE_DEPRECATED_MARKER

#include "legacy/armadillo"

#endif
// Armadillo 15.0.1 or later
#include "armadillo"

/* forward declarations */
namespace Rcpp {
Expand Down
62 changes: 6 additions & 56 deletions inst/include/RcppArmadillo/version/arma.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,62 +21,12 @@
#ifndef RcppArmadillo__version__arma__h
#define RcppArmadillo__version__arma__h


// Purpose: By explicitly defining or undefining a variable the 'defined(...) that
// is in RcppArmadilloForward.h works as expected allowing us to selectively include
// either a 'legacy' Armadillo (i.e. 14.6.3. the last version to a) allow C++11 and
// b) permit suppression of deprecation warnings) or a 'current' Armadillo (i.e. as
// of this writing 15.0.1, or any later version)
// This file was used to provide a selection mechanism with proper fallbacks after the
// release of Armadill 15.0.0 and its switch to C++14 as the minimum standard. Now that
// all CRAN packages can compile under this standard -- following a managed transition
// period permitting adjustments as needed -- this is no longer required and the file is
// effectively empty.
//
// See https://github.com/RcppCore/RcppArmadillo/issues/475 for more details

// Sanity check: Cannot select both current and legacy but only one
#if defined(ARMA_USE_CURRENT) && defined(ARMA_USE_LEGACY)
#error "Do not select both 'current' and 'legacy', only one choice is possible."
#endif

// Sanity check: Cannot select current under C++11
#if defined(ARMA_USE_CURRENT) && __cplusplus <= 201103L
#error "Do not select 'current' with C++11 (or older) as 'current' requires C++14 or newer."
#endif

// Carefully check and set if the user has -DARMA_USE_CURRENT
// This can be set in src/Makevars(.win) via PKG_CPPFLAGS (or equivalent)
#if defined(ARMA_USE_CURRENT)
#define ARMA_SELECTED_CURRENT_VERSION
#else
#undef ARMA_SELECTED_CURRENT_VERSION
#endif

// Carefully check and set if the user has -DARMA_USE_LEGACY
// This can be set in src/Makevars(.win) via PKG_CPPFLAGS (or equivalent)
#if defined(ARMA_USE_LEGACY)
#define ARMA_SELECTED_LEGACY_VERSION
#else
#undef ARMA_SELECTED_LEGACY_VERSION
#endif

// Fallback: Use 'legacy' and warn.
// This toggle can be turned to default to 'current' (allowing a legacy override) which we plan
// to do after a (sufficiently long) adjustment period
#if !defined(ARMA_SELECTED_LEGACY_VERSION) && !defined(ARMA_SELECTED_CURRENT_VERSION)
// Show messages, adjusted for compilation standard (as we also want to move on from C++11)
// We plan to 'at some point' flip to for C++14
#if __cplusplus < 201402L
#pragma message("Using fallback compilation with Armadillo 14.6.3. Please consider defining -DARMA_USE_CURRENT and also removing C++11 compilation directive. See GitHub issue #475 for more.")
// Define selector used in RcppArmadilloForward.h
#define ARMA_SELECTED_LEGACY_VERSION
#undef ARMA_SELECTED_CURRENT_VERSION
#endif
// -- no longer automatically fall back to legacy version (unless in C++11 mode)
// #else
// #pragma message("Using fallback compilation with Armadillo 14.6.3. Please consider defining -DARMA_USE_CURRENT. See GitHub issue #475 for more.")
// // Define selector used in RcppArmadilloForward.h
// // It is our intention to select current here after transition instead of legacy
// #define ARMA_SELECTED_LEGACY_VERSION
// #undef ARMA_SELECTED_CURRENT_VERSION
// #endif
#endif

// See https://github.com/RcppCore/RcppArmadillo/issues/475 for more details.

#endif
Loading