Skip to content

Accommodating breaking upstream changes #471

@eddelbuettel

Description

@eddelbuettel

Upstream has commenced work on a new Armadillo 15.0 branch. It brings fp16 (for the currently still few, mostly arm64-based systems as well as some very high-end server cpus with AVX512-FP16 support) and turns off C++11 support (!!).

That second change, unsurprisingly, would lead to a ton of undesirable breakage at CRAN (short log), if released there. One possible remedy is to offer 14.6.2 as a drop-in fallback given that we can control Armadillo access via a single (!!) #include. The code is in branch armadillo/arma_15.0 and accomplishes this via simple if statement:

#if __cplusplus >= 201402L
// Armadillo 15.0 (rc)
#include "current/armadillo"
#else
// we include Armadillo 14.6.2 here -- the last version to not require C++14
#pragma message("Using fallback compilation with Armadillo 14.6.2 under C++11. Please consider removing the C++11 compilation standard directive.")
// 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 for Armadillo 14.6.2 release
#define ARMA_IGNORE_DEPRECATED_MARKER
#include "legacy/armadillo"
#endif

This is currently being reverse-dependency tested and looks good so far.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions