xtensor: 0.25.0 -> 0.26.0 (#414307)

This commit is contained in:
Gaétan Lepage
2025-06-21 19:51:57 +02:00
committed by GitHub
4 changed files with 26 additions and 95 deletions
@@ -1,66 +0,0 @@
From 475bedb15252a3732683f3a62c45cc3f1abbab5c Mon Sep 17 00:00:00 2001
From: Mykola Vankovych <mykola.vankovych@biodataanalysis.de>
Date: Tue, 14 Jan 2025 16:48:47 +0100
Subject: [PATCH] Added fixes for building with clang 19 (more strict template
matching rules)
---
include/xtensor/xexpression_traits.hpp | 7 +++----
include/xtensor/xstorage.hpp | 4 ++--
include/xtensor/xutils.hpp | 3 ++-
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/include/xtensor/xexpression_traits.hpp b/include/xtensor/xexpression_traits.hpp
index 205de67a5..2f84ae234 100644
--- a/include/xtensor/xexpression_traits.hpp
+++ b/include/xtensor/xexpression_traits.hpp
@@ -103,16 +103,15 @@ namespace xt
using type = xarray<T, L>;
};
-#if defined(__GNUC__) && (__GNUC__ > 6)
-#if __cplusplus == 201703L
+// Workaround for rebind_container problems when C++17 feature is enabled
+#ifdef __cpp_template_template_args
template <template <class, std::size_t, class, bool> class S, class X, std::size_t N, class A, bool Init>
struct xtype_for_shape<S<X, N, A, Init>>
{
template <class T, layout_type L>
using type = xarray<T, L>;
};
-#endif // __cplusplus == 201703L
-#endif // __GNUC__ && (__GNUC__ > 6)
+#endif // __cpp_template_template_args
template <template <class, std::size_t> class S, class X, std::size_t N>
struct xtype_for_shape<S<X, N>>
diff --git a/include/xtensor/xstorage.hpp b/include/xtensor/xstorage.hpp
index ac179a852..fec8e10f3 100644
--- a/include/xtensor/xstorage.hpp
+++ b/include/xtensor/xstorage.hpp
@@ -1637,8 +1637,8 @@ namespace xt
return !(lhs < rhs);
}
-// Workaround for rebind_container problems on GCC 8 with C++17 enabled
-#if defined(__GNUC__) && __GNUC__ > 6 && !defined(__clang__) && __cplusplus >= 201703L
+// Workaround for rebind_container problems when C++17 feature is enabled
+#ifdef __cpp_template_template_args
template <class X, class T, std::size_t N>
struct rebind_container<X, aligned_array<T, N>>
{
diff --git a/include/xtensor/xutils.hpp b/include/xtensor/xutils.hpp
index 9844b0ba7..b8c818efd 100644
--- a/include/xtensor/xutils.hpp
+++ b/include/xtensor/xutils.hpp
@@ -1023,7 +1023,8 @@ namespace xt
using type = C<X, allocator>;
};
-#if defined(__GNUC__) && __GNUC__ > 6 && !defined(__clang__) && __cplusplus >= 201703L
+// Workaround for rebind_container problems when C++17 feature is enabled
+#ifdef __cpp_template_template_args
template <class X, class T, std::size_t N>
struct rebind_container<X, std::array<T, N>>
{
+8 -11
View File
@@ -13,18 +13,15 @@
stdenv.mkDerivation (finalAttrs: {
pname = "xtensor";
version = "0.25.0";
version = "0.26.0";
src = fetchFromGitHub {
owner = "xtensor-stack";
repo = "xtensor";
rev = finalAttrs.version;
hash = "sha256-hVfdtYcJ6mzqj0AUu6QF9aVKQGYKd45RngY6UN3yOH4=";
tag = finalAttrs.version;
hash = "sha256-gAGLb5NPT4jiIpXONqY+kalxKCFKFXlNqbM79x1lTKE=";
};
# See https://github.com/xtensor-stack/xtensor/pull/2821
patches = lib.optionals stdenv.cc.isClang [ ./0001-Fix-clang-build-errors-on-darwin.patch ];
nativeBuildInputs = [
cmake
];
@@ -42,17 +39,17 @@ stdenv.mkDerivation (finalAttrs: {
(lib.cmakeBool "XTENSOR_CHECK_DIMENSION" enableBoundChecks)
];
doCheck = true;
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
nativeCheckInputs = [
doctest
];
checkTarget = "xtest";
meta = with lib; {
meta = {
description = "Multi-dimensional arrays with broadcasting and lazy computing";
homepage = "https://github.com/xtensor-stack/xtensor";
license = licenses.bsd3;
maintainers = with maintainers; [ cpcloud ];
platforms = platforms.all;
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ cpcloud ];
platforms = lib.platforms.all;
};
})
+9 -9
View File
@@ -5,15 +5,15 @@
cmake,
doctest,
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "xtl";
version = "0.7.7";
version = "0.8.0";
src = fetchFromGitHub {
owner = "xtensor-stack";
repo = "xtl";
rev = version;
hash = "sha256-f8qYh8ibC/ToHsUv3OF1ujzt3fUe7kW9cNpGyLqsgqw=";
tag = finalAttrs.version;
hash = "sha256-hhXM2fG3Yl4KeEJlOAcNPVLJjKy9vFlI63lhbmIAsT8=";
};
nativeBuildInputs = [ cmake ];
@@ -24,11 +24,11 @@ stdenv.mkDerivation rec {
nativeCheckInputs = [ doctest ];
checkTarget = "xtest";
meta = with lib; {
meta = {
description = "Basic tools (containers, algorithms) used by other quantstack packages";
homepage = "https://github.com/xtensor-stack/xtl";
license = licenses.bsd3;
maintainers = with maintainers; [ cpcloud ];
platforms = platforms.all;
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ cpcloud ];
platforms = lib.platforms.all;
};
}
})
@@ -1,7 +1,7 @@
{
lib,
toPythonModule,
stdenv,
toPythonModule,
fetchFromGitHub,
cmake,
gtest,
@@ -13,23 +13,23 @@
toPythonModule (
stdenv.mkDerivation (finalAttrs: {
pname = "xtensor-python";
version = "0.27.0";
version = "0.28.0";
src = fetchFromGitHub {
owner = "xtensor-stack";
repo = "xtensor-python";
rev = finalAttrs.version;
hash = "sha256-Cy/aXuiriE/qxSd4Apipzak30DjgE7jX8ai1ThJ/VnE=";
tag = finalAttrs.version;
hash = "sha256-xByqAYtSRKOnllMUFdRM25bXGft/43EEpEMIlcjdrgE=";
};
nativeBuildInputs = [ cmake ];
buildInputs = [ pybind11 ];
nativeCheckInputs = [ gtest ];
doCheck = true;
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
cmakeFlags = [
# Always build the tests, even if not running them, because testing whether
# they can be built is a test in itself.
"-DBUILD_TESTS=ON"
(lib.cmakeBool "BUILD_TESTS" true)
];
propagatedBuildInputs = [
@@ -39,11 +39,11 @@ toPythonModule (
checkTarget = "xtest";
meta = with lib; {
meta = {
homepage = "https://github.com/xtensor-stack/xtensor-python";
description = "Python bindings for the xtensor C++ multi-dimensional array library";
license = licenses.bsd3;
maintainers = with maintainers; [ lsix ];
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ lsix ];
};
})
)