File tree Expand file tree Collapse file tree 9 files changed +66
-3
lines changed
Expand file tree Collapse file tree 9 files changed +66
-3
lines changed Original file line number Diff line number Diff line change @@ -214,6 +214,12 @@ HighFive integrates with the following libraries:
214214- xtensor (optional)
215215- half (optional)
216216
217+ #### XTensor Header Location
218+ XTensor reorganized their headers in version 0.26. HighFive attempts to guess
219+ where the headers can be found. The guessing can be overridded by setting
220+ ` HIGHFIVE_XTENSOR_HEADER_VERSION ` to: ` 1 ` for finding ` xtensor.hpp ` in
221+ ` <xtensor/xtensor.hpp> ` and ` 2 ` for ` <xtensor/containers/xtensor.hpp> ` .
222+
217223## Versioning & Code Stability
218224We use semantic versioning. Currently, we're preparing ` v3 ` which contains a
219225limited set of breaking changes required to eliminate undesireable behaviour or
Original file line number Diff line number Diff line change 2828#endif
2929
3030#ifdef H5_USE_XTENSOR
31- #include < xtensor/xarray.hpp>
32- #include < xtensor/xtensor.hpp>
3331#include " xtensor.hpp"
3432#endif
3533
Original file line number Diff line number Diff line change 1+ #ifndef HIGHFIVE_XTENSOR_HEADER_VERSION
2+ #if __cplusplus >= 201703L
3+ #if __has_include(<xtensor/xtensor.hpp>)
4+ #define HIGHFIVE_XTENSOR_HEADER_VERSION 1
5+ #elif __has_include(<xtensor/container/xtensor.hpp>)
6+ #define HIGHFIVE_XTENSOR_HEADER_VERSION 2
7+ #endif
8+ #else
9+ #define HIGHFIVE_XTENSOR_HEADER_VERSION 1
10+ #endif
11+ #endif
12+
Original file line number Diff line number Diff line change 22
33#include " bits/H5Inspector_decl.hpp"
44#include " H5Exception.hpp"
5+ #include " bits/xtensor_header_version.hpp"
56
7+ #if HIGHFIVE_XTENSOR_HEADER_VERSION == 1
68#include < xtensor/xtensor.hpp>
79#include < xtensor/xarray.hpp>
810#include < xtensor/xadapt.hpp>
11+ #elif HIGHFIVE_XTENSOR_HEADER_VERSION == 2
12+ #include < xtensor/container/xtensor.hpp>
13+ #include < xtensor/container/xarray.hpp>
14+ #include < xtensor/container/xadapt.hpp>
15+ #else
16+ #error "Set HIGHFIVE_XTENSOR_HEADER_VERSION to `1` for pre 0.26; `2` otherwise."
17+ #endif
918
1019namespace HighFive {
1120namespace details {
Original file line number Diff line number Diff line change 1313
1414// optionally enable plug-in xtensor
1515#ifdef H5_USE_XTENSOR
16+ #include " bits/xtensor_header_version.hpp"
17+ #if HIGHFIVE_XTENSOR_HEADER_VERSION == 1
1618#include < xtensor/xtensor.hpp>
19+ #elif HIGHFIVE_XTENSOR_HEADER_VERSION == 2
20+ #include < xtensor/container/xtensor.hpp>
21+ #else
22+ #error "Failed to detect HIGHFIVE_XTENSOR_HEADER_VERSION."
23+ #endif
1724#endif
1825
1926// optionally enable plug-in Eigen
Original file line number Diff line number Diff line change 1313
1414// optionally enable plug-in xtensor
1515#ifdef H5_USE_XTENSOR
16+ #include < highfive/bits/xtensor_header_version.hpp>
17+ #if HIGHFIVE_XTENSOR_HEADER_VERSION == 1
1618#include < xtensor/xtensor.hpp>
19+ #elif HIGHFIVE_XTENSOR_HEADER_VERSION == 2
20+ #include < xtensor/container/xtensor.hpp>
21+ #else
22+ #error "Failed to detect HIGHFIVE_XTENSOR_HEADER_VERSION."
23+ #endif
1724#endif
1825
1926// optionally enable plug-in Eigen
Original file line number Diff line number Diff line change 1313
1414// optionally enable plug-in xtensor
1515#ifdef H5_USE_XTENSOR
16+ #include < highfive/bits/xtensor_header_version.hpp>
17+ #if HIGHFIVE_XTENSOR_HEADER_VERSION == 1
1618#include < xtensor/xtensor.hpp>
19+ #elif HIGHFIVE_XTENSOR_HEADER_VERSION == 2
20+ #include < xtensor/container/xtensor.hpp>
21+ #else
22+ #error "Failed to detect HIGHFIVE_XTENSOR_HEADER_VERSION."
23+ #endif
1724#endif
1825
1926// optionally enable plug-in Eigen
Original file line number Diff line number Diff line change 1313#include < catch2/catch_template_test_macros.hpp>
1414
1515#include < highfive/highfive.hpp>
16+ #include < highfive/xtensor.hpp>
17+
18+ #if HIGHFIVE_XTENSOR_HEADER_VERSION == 1
1619#include < xtensor/xtensor.hpp>
1720#include < xtensor/xview.hpp>
1821#include < xtensor/xio.hpp>
19- #include < highfive/xtensor.hpp>
22+ #elif HIGHFIVE_XTENSOR_HEADER_VERSION == 2
23+ #include < xtensor/container/xtensor.hpp>
24+ #include < xtensor/views/xview.hpp>
25+ #include < xtensor/io/xio.hpp>
26+ #else
27+ #error "Failed to detect HIGHFIVE_XTENSOR_HEADER_VERSION."
28+ #endif
2029
2130#include " data_generator.hpp"
2231
Original file line number Diff line number Diff line change 2222
2323
2424#ifdef HIGHFIVE_TEST_XTENSOR
25+ #include < highfive/bits/xtensor_header_version.hpp>
26+ #if HIGHFIVE_XTENSOR_HEADER_VERSION == 1
2527#include < xtensor/xrandom.hpp>
2628#include < xtensor/xview.hpp>
29+ #elif HIGHFIVE_XTENSOR_HEADER_VERSION == 2
30+ #include < xtensor/generators/xrandom.hpp>
31+ #include < xtensor/views/xview.hpp>
32+ #else
33+ #error "Failed to detect HIGHFIVE_XTENSOR_HEADER_VERSION."
34+ #endif
2735#endif
2836
2937#ifdef HIGHFIVE_TEST_EIGEN
You can’t perform that action at this time.
0 commit comments