From e9a3c926c8fa65b70d10f74d7da4544d4ecf9092 Mon Sep 17 00:00:00 2001 From: serge-sans-paille Date: Oct 07 2020 07:59:10 +0000 Subject: Activate all architectures, fixing the remaining issues in the test suite --- 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/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/xtensor.spec b/xtensor.spec index 871498b..d47d845 100644 --- a/xtensor.spec +++ b/xtensor.spec @@ -2,7 +2,7 @@ Name: xtensor Version: 0.21.7 -Release: 2%{?dist} +Release: 3%{?dist} Summary: C++ tensors with broadcasting and lazy computing License: BSD URL: http://xtensor.readthedocs.io/ @@ -10,17 +10,16 @@ URL: http://xtensor.readthedocs.io/ %global github https://github.com/QuantStack/xtensor Source0: %{github}/archive/%{version}/%{name}-%{version}.tar.gz -# because tests fail for these archs -ExcludeArch: ppc64le s390x - BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: gtest-devel BuildRequires: xtl-devel BuildRequires: xsimd-devel +BuildRequires: python3-numpy 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} @@ -50,6 +49,10 @@ Requires: xsimd-devel %prep %autosetup -p1 +%ifarch s390x +find -name '*.npy' -exec %{__python3} -c "import numpy as np; np.save('{}', np.load('{}').byteswap().newbyteorder())" \; +%endif + %build %cmake -DBUILD_TESTS=ON %cmake_build @@ -69,6 +72,9 @@ Requires: xsimd-devel %{_libdir}/pkgconfig/%{name}.pc %changelog +* 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