From a87c0d7f9d725fe4189d09d96e145e72edfc5a61 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 12 Jun 2025 14:43:04 -0600 Subject: [PATCH] Deal with the fact that Xtensor moved all of its header files. --- include/fastscapelib/algo/pflood.hpp | 17 ++++++++- .../fastscapelib/eroders/diffusion_adi.hpp | 30 +++++++++++++--- include/fastscapelib/eroders/spl.hpp | 26 +++++++++++--- include/fastscapelib/flow/flow_graph.hpp | 27 ++++++++++---- include/fastscapelib/flow/flow_graph_impl.hpp | 30 ++++++++++++---- .../fastscapelib/flow/impl/flow_graph_inl.hpp | 25 ++++++++++--- include/fastscapelib/grid/base.hpp | 23 ++++++++++-- include/fastscapelib/grid/profile_grid.hpp | 17 ++++++++- include/fastscapelib/grid/raster_grid.hpp | 20 +++++++++-- include/fastscapelib/grid/structured_grid.hpp | 36 +++++++++++++++---- include/fastscapelib/grid/trimesh.hpp | 20 +++++++++-- include/fastscapelib/utils/utils.hpp | 17 ++++++++- .../fastscapelib/utils/xtensor_containers.hpp | 27 +++++++++++--- 13 files changed, 268 insertions(+), 47 deletions(-) diff --git a/include/fastscapelib/algo/pflood.hpp b/include/fastscapelib/algo/pflood.hpp index 344581b5..2e2de475 100644 --- a/include/fastscapelib/algo/pflood.hpp +++ b/include/fastscapelib/algo/pflood.hpp @@ -12,7 +12,22 @@ #include #include -#include "xtensor/xtensor.hpp" +// Include the Xtensor configuration file so that we can query the +// Xtensor version number below to address the fact that between +// 0.25.0 and 0.26.0, all Xtensor include files were moved around, +// see https://github.com/xtensor-stack/xtensor/pull/2829 and the +// complaints therein. +#if __has_include() // 0.26.0 and later +# include +#else // 0.25.0 and earlier +# include +#endif + +#if XTENSOR_VERSION_MAJOR ==0 && XTENSOR_VERSION_MINOR <= 25 +# include +#else +# include +#endif #include "fastscapelib/utils/utils.hpp" #include "fastscapelib/utils/consts.hpp" diff --git a/include/fastscapelib/eroders/diffusion_adi.hpp b/include/fastscapelib/eroders/diffusion_adi.hpp index 6c7b51c7..9e67926d 100644 --- a/include/fastscapelib/eroders/diffusion_adi.hpp +++ b/include/fastscapelib/eroders/diffusion_adi.hpp @@ -10,11 +10,31 @@ #include #include -#include "xtensor/xbroadcast.hpp" -#include "xtensor/xbuilder.hpp" -#include "xtensor/xnoalias.hpp" -#include "xtensor/xview.hpp" -#include "xtensor/xmanipulation.hpp" +// Include the Xtensor configuration file so that we can query the +// Xtensor version number below to address the fact that between +// 0.25.0 and 0.26.0, all Xtensor include files were moved around, +// see https://github.com/xtensor-stack/xtensor/pull/2829 and the +// complaints therein. +#if __has_include() // 0.26.0 and later +# include +#else // 0.25.0 and earlier +# include +#endif + +#if XTENSOR_VERSION_MAJOR ==0 && XTENSOR_VERSION_MINOR <= 25 +# include +# include +# include +# include +# include +#else +# include +# include +# include +# include +# include +#endif + #include "fastscapelib/grid/structured_grid.hpp" #include "fastscapelib/utils/utils.hpp" diff --git a/include/fastscapelib/eroders/spl.hpp b/include/fastscapelib/eroders/spl.hpp index 03f89d3b..8e5b3e8a 100644 --- a/include/fastscapelib/eroders/spl.hpp +++ b/include/fastscapelib/eroders/spl.hpp @@ -11,13 +11,31 @@ #include #include -#include "xtensor/xbroadcast.hpp" -#include "xtensor/xtensor.hpp" -#include "xtensor/xmanipulation.hpp" - #include "fastscapelib/utils/utils.hpp" #include "fastscapelib/utils/containers.hpp" +// Include the Xtensor configuration file so that we can query the +// Xtensor version number below to address the fact that between +// 0.25.0 and 0.26.0, all Xtensor include files were moved around, +// see https://github.com/xtensor-stack/xtensor/pull/2829 and the +// complaints therein. +#if __has_include() // 0.26.0 and later +# include +#else // 0.25.0 and earlier +# include +#endif + +#if XTENSOR_VERSION_MAJOR ==0 && XTENSOR_VERSION_MINOR <= 25 +# include +# include +# include +#else +# include +# include +# include +#endif + + namespace fastscapelib { diff --git a/include/fastscapelib/flow/flow_graph.hpp b/include/fastscapelib/flow/flow_graph.hpp index 87399da2..04881387 100644 --- a/include/fastscapelib/flow/flow_graph.hpp +++ b/include/fastscapelib/flow/flow_graph.hpp @@ -1,12 +1,27 @@ #ifndef FASTSCAPELIB_FLOW_FLOW_GRAPH_HPP #define FASTSCAPELIB_FLOW_FLOW_GRAPH_HPP -#include "fastscapelib/flow/flow_graph_impl.hpp" -#include "fastscapelib/flow/flow_kernel.hpp" -#include "fastscapelib/flow/flow_operator.hpp" -#include "fastscapelib/utils/thread_pool.hpp" - -#include "xtensor/xstrided_view.hpp" +#include +#include +#include +#include + +// Include the Xtensor configuration file so that we can query the +// Xtensor version number below to address the fact that between +// 0.25.0 and 0.26.0, all Xtensor include files were moved around, +// see https://github.com/xtensor-stack/xtensor/pull/2829 and the +// complaints therein. +#if __has_include() // 0.26.0 and later +# include +#else // 0.25.0 and earlier +# include +#endif + +#if XTENSOR_VERSION_MAJOR ==0 && XTENSOR_VERSION_MINOR <= 25 +# include +#else +# include +#endif #include #include diff --git a/include/fastscapelib/flow/flow_graph_impl.hpp b/include/fastscapelib/flow/flow_graph_impl.hpp index 4881c167..47f7e4cc 100644 --- a/include/fastscapelib/flow/flow_graph_impl.hpp +++ b/include/fastscapelib/flow/flow_graph_impl.hpp @@ -9,13 +9,31 @@ #include #include -#include "xtensor/xbroadcast.hpp" -#include "xtensor/xstrided_view.hpp" -#include "xtensor/xview.hpp" -#include "fastscapelib/grid/base.hpp" -#include "fastscapelib/utils/iterators.hpp" -#include "fastscapelib/utils/containers.hpp" +// Include the Xtensor configuration file so that we can query the +// Xtensor version number below to address the fact that between +// 0.25.0 and 0.26.0, all Xtensor include files were moved around, +// see https://github.com/xtensor-stack/xtensor/pull/2829 and the +// complaints therein. +#if __has_include() // 0.26.0 and later +# include +#else // 0.25.0 and earlier +# include +#endif + +#if XTENSOR_VERSION_MAJOR ==0 && XTENSOR_VERSION_MINOR <= 25 +# include +# include +# include +#else +# include +# include +# include +#endif + +#include +#include +#include namespace fastscapelib diff --git a/include/fastscapelib/flow/impl/flow_graph_inl.hpp b/include/fastscapelib/flow/impl/flow_graph_inl.hpp index 48fd48a8..4f875573 100644 --- a/include/fastscapelib/flow/impl/flow_graph_inl.hpp +++ b/include/fastscapelib/flow/impl/flow_graph_inl.hpp @@ -8,11 +8,26 @@ #include #include -#include "fastscapelib/utils/containers.hpp" -#include "xtensor/xstrided_view.hpp" - -#include "fastscapelib/flow/flow_graph_impl.hpp" -#include "fastscapelib/flow/flow_operator.hpp" +#include +#include +#include + +// Include the Xtensor configuration file so that we can query the +// Xtensor version number below to address the fact that between +// 0.25.0 and 0.26.0, all Xtensor include files were moved around, +// see https://github.com/xtensor-stack/xtensor/pull/2829 and the +// complaints therein. +#if __has_include() // 0.26.0 and later +# include +#else // 0.25.0 and earlier +# include +#endif + +#if XTENSOR_VERSION_MAJOR ==0 && XTENSOR_VERSION_MINOR <= 25 +# include +#else +# include +#endif namespace fastscapelib diff --git a/include/fastscapelib/grid/base.hpp b/include/fastscapelib/grid/base.hpp index 79950422..b607250c 100644 --- a/include/fastscapelib/grid/base.hpp +++ b/include/fastscapelib/grid/base.hpp @@ -11,9 +11,26 @@ #include #include -#include "xtensor/xadapt.hpp" -#include "xtensor/xtensor.hpp" -#include "xtensor/xview.hpp" +// Include the Xtensor configuration file so that we can query the +// Xtensor version number below to address the fact that between +// 0.25.0 and 0.26.0, all Xtensor include files were moved around, +// see https://github.com/xtensor-stack/xtensor/pull/2829 and the +// complaints therein. +#if __has_include() // 0.26.0 and later +# include +#else // 0.25.0 and earlier +# include +#endif + +#if XTENSOR_VERSION_MAJOR ==0 && XTENSOR_VERSION_MINOR <= 25 +# include +# include +# include +#else +# include +# include +# include +#endif #include "fastscapelib/utils/iterators.hpp" #include "fastscapelib/utils/containers.hpp" diff --git a/include/fastscapelib/grid/profile_grid.hpp b/include/fastscapelib/grid/profile_grid.hpp index eb141280..b1676781 100644 --- a/include/fastscapelib/grid/profile_grid.hpp +++ b/include/fastscapelib/grid/profile_grid.hpp @@ -13,7 +13,22 @@ #include #include -#include +// Include the Xtensor configuration file so that we can query the +// Xtensor version number below to address the fact that between +// 0.25.0 and 0.26.0, all Xtensor include files were moved around, +// see https://github.com/xtensor-stack/xtensor/pull/2829 and the +// complaints therein. +#if __has_include() // 0.26.0 and later +# include +#else // 0.25.0 and earlier +# include +#endif + +#if XTENSOR_VERSION_MAJOR ==0 && XTENSOR_VERSION_MINOR <= 25 +# include +#else +# include +#endif #include "fastscapelib/grid/base.hpp" #include "fastscapelib/grid/structured_grid.hpp" diff --git a/include/fastscapelib/grid/raster_grid.hpp b/include/fastscapelib/grid/raster_grid.hpp index d99c93d1..7afd71c4 100644 --- a/include/fastscapelib/grid/raster_grid.hpp +++ b/include/fastscapelib/grid/raster_grid.hpp @@ -8,8 +8,24 @@ #include #include -#include -#include +// Include the Xtensor configuration file so that we can query the +// Xtensor version number below to address the fact that between +// 0.25.0 and 0.26.0, all Xtensor include files were moved around, +// see https://github.com/xtensor-stack/xtensor/pull/2829 and the +// complaints therein. +#if __has_include() // 0.26.0 and later +# include +#else // 0.25.0 and earlier +# include +#endif + +#if XTENSOR_VERSION_MAJOR ==0 && XTENSOR_VERSION_MINOR <= 25 +# include +# include +#else +# include +# include +#endif #include "fastscapelib/grid/base.hpp" #include "fastscapelib/grid/structured_grid.hpp" diff --git a/include/fastscapelib/grid/structured_grid.hpp b/include/fastscapelib/grid/structured_grid.hpp index ab3dd0d6..6d20ee9c 100644 --- a/include/fastscapelib/grid/structured_grid.hpp +++ b/include/fastscapelib/grid/structured_grid.hpp @@ -15,13 +15,35 @@ #include #include -#include "xtensor/xbuilder.hpp" -#include "xtensor/xarray.hpp" -#include "xtensor/xfixed.hpp" -#include "xtensor/xtensor.hpp" -#include "xtensor/xview.hpp" -#include "xtensor/xindex_view.hpp" -#include "xtensor/xnoalias.hpp" +// Include the Xtensor configuration file so that we can query the +// Xtensor version number below to address the fact that between +// 0.25.0 and 0.26.0, all Xtensor include files were moved around, +// see https://github.com/xtensor-stack/xtensor/pull/2829 and the +// complaints therein. +#if __has_include() // 0.26.0 and later +# include +#else // 0.25.0 and earlier +# include +#endif + +#if XTENSOR_VERSION_MAJOR ==0 && XTENSOR_VERSION_MINOR <= 25 +# include +# include +# include +# include +# include +# include +# include +#else +# include +# include +# include +# include +# include +# include +# include +#endif + #include "xtl/xiterator_base.hpp" diff --git a/include/fastscapelib/grid/trimesh.hpp b/include/fastscapelib/grid/trimesh.hpp index 928283b9..69c1b46c 100644 --- a/include/fastscapelib/grid/trimesh.hpp +++ b/include/fastscapelib/grid/trimesh.hpp @@ -11,8 +11,24 @@ #include #include -#include "xtensor/xstrided_view.hpp" -#include "xtensor/xhistogram.hpp" +// Include the Xtensor configuration file so that we can query the +// Xtensor version number below to address the fact that between +// 0.25.0 and 0.26.0, all Xtensor include files were moved around, +// see https://github.com/xtensor-stack/xtensor/pull/2829 and the +// complaints therein. +#if __has_include() // 0.26.0 and later +# include +#else // 0.25.0 and earlier +# include +# include +#endif + +#if XTENSOR_VERSION_MAJOR ==0 && XTENSOR_VERSION_MINOR <= 25 +# include +# include +#else +# include +#endif #include "fastscapelib/grid/base.hpp" #include "fastscapelib/utils/containers.hpp" diff --git a/include/fastscapelib/utils/utils.hpp b/include/fastscapelib/utils/utils.hpp index af507e27..364f5acb 100644 --- a/include/fastscapelib/utils/utils.hpp +++ b/include/fastscapelib/utils/utils.hpp @@ -9,7 +9,22 @@ #include #include -#include "xtensor/xcontainer.hpp" +// Include the Xtensor configuration file so that we can query the +// Xtensor version number below to address the fact that between +// 0.25.0 and 0.26.0, all Xtensor include files were moved around, +// see https://github.com/xtensor-stack/xtensor/pull/2829 and the +// complaints therein. +#if __has_include() // 0.26.0 and later +# include +#else // 0.25.0 and earlier +# include +#endif + +#if XTENSOR_VERSION_MAJOR ==0 && XTENSOR_VERSION_MINOR <= 25 +# include +#else +# include +#endif // type used for array indexers diff --git a/include/fastscapelib/utils/xtensor_containers.hpp b/include/fastscapelib/utils/xtensor_containers.hpp index c7afc3f0..66937861 100644 --- a/include/fastscapelib/utils/xtensor_containers.hpp +++ b/include/fastscapelib/utils/xtensor_containers.hpp @@ -4,10 +4,29 @@ #ifndef FASTSCAPELIB_UTILS_XTENSOR_CONTAINERS_HPP #define FASTSCAPELIB_UTILS_XTENSOR_CONTAINERS_HPP -#include "xtensor/xarray.hpp" -#include "xtensor/xtensor.hpp" -#include "xtensor/xadapt.hpp" -#include "xtensor/xview.hpp" +// Include the Xtensor configuration file so that we can query the +// Xtensor version number below to address the fact that between +// 0.25.0 and 0.26.0, all Xtensor include files were moved around, +// see https://github.com/xtensor-stack/xtensor/pull/2829 and the +// complaints therein. +#if __has_include() // 0.26.0 and later +# include +#else // 0.25.0 and earlier +# include +#endif + +#if XTENSOR_VERSION_MAJOR ==0 && XTENSOR_VERSION_MINOR <= 25 +# include +# include +# include +# include +#else +# include +# include +# include +# include +#endif + #include