diff --git a/.gitignore b/.gitignore index aca3ef8..982cc13 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,3 @@ /xtensor-0.20.8.tar.gz /xtensor-0.21.2.tar.gz /xtensor-0.21.7.tar.gz -/xtensor-0.23.1.tar.gz -/xtensor-0.24.2.tar.gz -/xtensor-0.25.0.tar.gz -/xtensor-0.27.0.tar.gz -/xtensor-0.27.1.tar.gz diff --git a/0001-Fix-xnpy-save-padding-computation.patch b/0001-Fix-xnpy-save-padding-computation.patch new file mode 100644 index 0000000..3c3921c Binary files /dev/null and b/0001-Fix-xnpy-save-padding-computation.patch differ diff --git a/changelog b/changelog deleted file mode 100644 index a37ec8c..0000000 --- a/changelog +++ /dev/null @@ -1,46 +0,0 @@ -* Mon Jan 29 2024 Fedora Release Engineering - 0.24.2-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Sat Jul 22 2023 Fedora Release Engineering - 0.24.2-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - -* Sat Jan 21 2023 Fedora Release Engineering - 0.24.2-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild - -* Sat Jul 23 2022 Fedora Release Engineering - 0.24.2-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - -* Wed May 11 2022 sguelton@redhat.com - 0.24.2-1 -- Upstream version bump - -* Sat Jan 22 2022 Fedora Release Engineering - 0.23.1-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - -* Fri Jul 23 2021 Fedora Release Engineering - 0.23.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - -* Mon Feb 15 2021 sguelton@redhat.com - 0.23.1-1 -- Upstream version bump -- More generic use of %cmake_build - -* Thu Jan 28 2021 Fedora Release Engineering - 0.21.7-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Tue Oct 06 2020 sguelton@redhat.com - 0.21.7-3 -- Activate all architectures, fixing the remaining issues in the test suite - -* Mon Oct 05 2020 sguelton@redhat.com - 0.21.7-2 -- Fix UB in upstream testsuite, see https://github.com/xtensor-stack/xtensor/pull/2175 -- Activates armv7hl - -* Sat Oct 3 2020 sguelton@redhat.com - 0.21.7-1 -- Upstream version bump - -* Wed Jul 29 2020 Fedora Release Engineering - 0.21.2-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Thu Jan 16 2020 sguelton@redhat.com - 0.21.2-1 -- Upstream version bump - -* Tue Sep 3 2019 sguelton@redhat.com - 0.20.8-1 -- Initial package diff --git a/disable_arch_native.patch b/disable_arch_native.patch new file mode 100644 index 0000000..450993b --- /dev/null +++ b/disable_arch_native.patch @@ -0,0 +1,21 @@ +diff -Naur xtensor-0.21.7.orig/test/CMakeLists.txt xtensor-0.21.7/test/CMakeLists.txt +--- xtensor-0.21.7.orig/test/CMakeLists.txt 2020-10-05 07:58:59.898264285 +0000 ++++ xtensor-0.21.7/test/CMakeLists.txt 2020-10-07 06:49:04.566990256 +0000 +@@ -63,7 +63,7 @@ + endif() + + if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR (CMAKE_CXX_COMPILER_ID MATCHES "Intel" AND NOT WIN32)) +- if(NOT CMAKE_CXX_FLAGS MATCHES "-march") ++ if(NOT CMAKE_CXX_FLAGS MATCHES "-march" AND NOT CMAKE_CXX_FLAGS MATCHES "-mcpu") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native") + endif() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_cxx_std_flag} -Wunused-parameter -Wextra -Wreorder -Wconversion -Wsign-conversion") +@@ -83,7 +83,7 @@ + endif() + elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + if(NOT WIN32) +- if(NOT CMAKE_CXX_FLAGS MATCHES "-march") ++ if(NOT CMAKE_CXX_FLAGS MATCHES "-march" AND NOT CMAKE_CXX_FLAGS MATCHES "-mcpu") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native") + endif() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_cxx_std_flag} -Wunused-parameter -Wextra -Wreorder -Wconversion -Wsign-conversion") diff --git a/sources b/sources index 2f4f959..c12913a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (xtensor-0.27.1.tar.gz) = 3f3fe2391df91518cfef4983ff66bf3b79940136582bb99c6270f87481bf9d2cc15605b13f9b70b6ee9a7a89b389037dd2b26362fcae0fdc49f5204872ee5291 +SHA512 (xtensor-0.21.7.tar.gz) = d042d1ffaa3b7057811148000b303d2b2da036d44d38bc27a08bcfc06424280ee270f37440e1d361d4dc16bee0c630048c4c9a24b7915c96825b4b9a584a9303 diff --git a/test_portability.patch b/test_portability.patch new file mode 100644 index 0000000..0591eae --- /dev/null +++ b/test_portability.patch @@ -0,0 +1,47 @@ +diff -Naur xtensor-0.21.7.orig/test/test_xoperation.cpp xtensor-0.21.7/test/test_xoperation.cpp +--- xtensor-0.21.7.orig/test/test_xoperation.cpp 2020-10-05 07:58:59.903264307 +0000 ++++ xtensor-0.21.7/test/test_xoperation.cpp 2020-10-05 08:41:21.127559227 +0000 +@@ -807,17 +807,18 @@ + TEST(operation, left_shift) + { + xarray arr({5,1, 1000}); ++ xarray arr2({2,1, 3}); + xarray res1 = left_shift(arr, 4); +- xarray res2 = left_shift(arr, arr); ++ xarray res2 = left_shift(arr, arr2); + EXPECT_EQ(left_shift(arr, 4)(1), 16); + xarray expected1 = {80, 16, 16000}; +- xarray expected2 = {160, 2, 256000}; ++ xarray expected2 = {20, 2, 8000}; + + EXPECT_EQ(expected1, res1); + EXPECT_EQ(expected2, res2); + + xarray res3 = arr << 4; +- xarray res4 = arr << arr; ++ xarray res4 = arr << arr2; + EXPECT_EQ(expected1, res3); + EXPECT_EQ(expected2, res4); + } +@@ -825,17 +826,18 @@ + TEST(operation, right_shift) + { + xarray arr({5,1, 1000}); ++ xarray arr2({2,1, 3}); + xarray res1 = right_shift(arr, 4); +- xarray res2 = right_shift(arr, arr); ++ xarray res2 = right_shift(arr, arr2); + EXPECT_EQ(right_shift(arr, 4)(1), 0); + xarray expected1 = {0, 0, 62}; +- xarray expected2 = {0, 0, 3}; ++ xarray expected2 = {1, 0, 125}; + + EXPECT_EQ(expected1, res1); + EXPECT_EQ(expected2, res2); + + xarray res3 = arr >> 4; +- xarray res4 = arr >> arr; ++ xarray res4 = arr >> arr2; + EXPECT_EQ(expected1, res3); + EXPECT_EQ(expected2, res4); + } diff --git a/xtensor.spec b/xtensor.spec index d9bf989..2646ee3 100644 --- a/xtensor.spec +++ b/xtensor.spec @@ -1,23 +1,26 @@ %undefine __cmake_in_source_build Name: xtensor -Version: 0.27.1 -Release: %autorelease +Version: 0.21.7 +Release: 4%{?dist} Summary: C++ tensors with broadcasting and lazy computing -License: BSD-3-Clause +License: BSD URL: http://xtensor.readthedocs.io/ %global github https://github.com/QuantStack/xtensor Source0: %{github}/archive/%{version}/%{name}-%{version}.tar.gz +BuildRequires: make BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: gtest-devel BuildRequires: xtl-devel BuildRequires: xsimd-devel BuildRequires: python3-numpy -BuildRequires: doctest-devel -BuildRequires: json-devel + +Patch0: test_portability.patch +Patch1: 0001-Fix-xnpy-save-padding-computation.patch +Patch2: disable_arch_native.patch # there is no actual arched content - this is a header only library %global debug_package %{nil} @@ -48,7 +51,7 @@ Requires: xsimd-devel %autosetup -p1 %ifarch s390x -find -name '*.npy' -exec %{__python3} -c "import numpy as np; arr = np.load('{}').byteswap() ; np.save('{}', arr.view(arr.dtype.newbyteorder()))" \; +find -name '*.npy' -exec %{__python3} -c "import numpy as np; np.save('{}', np.load('{}').byteswap().newbyteorder())" \; %endif %build @@ -57,19 +60,37 @@ find -name '*.npy' -exec %{__python3} -c "import numpy as np; arr = np.load('{}' %install %cmake_install -rm %{buildroot}%{_prefix}/etc/xeus-cpp/tags.d/xtensor.json -rm %{buildroot}%{_datadir}/xeus-cpp/tagfiles/xtensor.tag %check -%cmake_build --target xtest +%make_build -C %{_vpath_builddir} xtest %files devel %doc README.md %license LICENSE %{_includedir}/%{name}.hpp %{_includedir}/%{name}/ -%{_datadir}/cmake/%{name}/ -%{_datadir}/pkgconfig/%{name}.pc +%{_libdir}/cmake/%{name}/ +%{_libdir}/pkgconfig/%{name}.pc %changelog -%autochangelog +* Thu Jan 28 2021 Fedora Release Engineering - 0.21.7-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Oct 06 2020 sguelton@redhat.com - 0.21.7-3 +- Activate all architectures, fixing the remaining issues in the test suite + +* Mon Oct 05 2020 sguelton@redhat.com - 0.21.7-2 +- Fix UB in upstream testsuite, see https://github.com/xtensor-stack/xtensor/pull/2175 +- Activates armv7hl + +* Sat Oct 3 2020 sguelton@redhat.com - 0.21.7-1 +- Upstream version bump + +* Wed Jul 29 2020 Fedora Release Engineering - 0.21.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Thu Jan 16 2020 sguelton@redhat.com - 0.21.2-1 +- Upstream version bump + +* Tue Sep 3 2019 sguelton@redhat.com - 0.20.8-1 +- Initial package