diff --git a/SOURCES/0001-fix_zvector_build.patch b/SOURCES/0001-fix_zvector_build.patch new file mode 100644 index 0000000..deef032 --- /dev/null +++ b/SOURCES/0001-fix_zvector_build.patch @@ -0,0 +1,58 @@ +From 18824d10eaa46b39d42ae2b437fe760a2be25a7b Mon Sep 17 00:00:00 2001 +From: Antonio Sanchez +Date: Fri, 22 Oct 2021 08:52:16 -0700 +Subject: [PATCH] Fix ZVector build. + +Cross-compiled via `s390x-linux-gnu-g++`, run via qemu. This allows the +packetmath tests to pass. + + +(cherry picked from commit 40bbe8a4d0eb3ec2bfd472fa30cac19e6e743b46) +--- + Eigen/src/Core/arch/ZVector/Complex.h | 14 ++++++++++++-- + Eigen/src/Core/arch/ZVector/PacketMath.h | 4 ++-- + 2 files changed, 14 insertions(+), 4 deletions(-) + +diff --git a/Eigen/src/Core/arch/ZVector/Complex.h b/Eigen/src/Core/arch/ZVector/Complex.h +index 0b9b33d99d..e0acedefbd 100644 +--- a/Eigen/src/Core/arch/ZVector/Complex.h ++++ b/Eigen/src/Core/arch/ZVector/Complex.h +@@ -91,8 +91,18 @@ template<> struct packet_traits > : default_packet_traits + }; + }; + +-template<> struct unpacket_traits { typedef std::complex type; enum {size=2, alignment=Aligned16, vectorizable=true, masked_load_available=false, masked_store_available=false}; typedef Packet2cf half; }; +-template<> struct unpacket_traits { typedef std::complex type; enum {size=1, alignment=Aligned16, vectorizable=true, masked_load_available=false, masked_store_available=false}; typedef Packet1cd half; }; ++template<> struct unpacket_traits { ++ typedef std::complex type; ++ enum {size=2, alignment=Aligned16, vectorizable=true, masked_load_available=false, masked_store_available=false}; ++ typedef Packet2cf half; ++ typedef Packet4f as_real; ++}; ++template<> struct unpacket_traits { ++ typedef std::complex type; ++ enum {size=1, alignment=Aligned16, vectorizable=true, masked_load_available=false, masked_store_available=false}; ++ typedef Packet1cd half; ++ typedef Packet2d as_real; ++}; + + /* Forward declaration */ + EIGEN_STRONG_INLINE void ptranspose(PacketBlock& kernel); +diff --git a/Eigen/src/Core/arch/ZVector/PacketMath.h b/Eigen/src/Core/arch/ZVector/PacketMath.h +index 1f55a90a5c..208e4b167c 100755 +--- a/Eigen/src/Core/arch/ZVector/PacketMath.h ++++ b/Eigen/src/Core/arch/ZVector/PacketMath.h +@@ -91,8 +91,8 @@ static _EIGEN_DECLARE_CONST_FAST_Packet2l(ZERO, 0); + static _EIGEN_DECLARE_CONST_FAST_Packet2l(ONE, 1); + + static Packet2d p2d_ONE = { 1.0, 1.0 }; +-static Packet2d p2d_ZERO_ = { numext::bit_cast0x8000000000000000ull), +- numext::bit_cast0x8000000000000000ull) }; ++static Packet2d p2d_ZERO_ = { numext::bit_cast(0x8000000000000000ull), ++ numext::bit_cast(0x8000000000000000ull) }; + + #if !defined(__ARCH__) || (defined(__ARCH__) && __ARCH__ >= 12) + #define _EIGEN_DECLARE_CONST_FAST_Packet4f(NAME,X) \ +-- +GitLab + diff --git a/SOURCES/0002-zvector_move_alignas_qualifier_to_come_first.patch b/SOURCES/0002-zvector_move_alignas_qualifier_to_come_first.patch new file mode 100644 index 0000000..da865bb --- /dev/null +++ b/SOURCES/0002-zvector_move_alignas_qualifier_to_come_first.patch @@ -0,0 +1,167 @@ +From 23469c3cdaeeeb7b9f31e2d0971cddd114f1587d Mon Sep 17 00:00:00 2001 +From: Andreas Krebbel +Date: Tue, 26 Oct 2021 15:29:30 +0200 +Subject: [PATCH] ZVector: Move alignas qualifier to come first + +We currently have plenty of type definitions with the alignment +qualifier coming after the type. The compiler warns about ignoring +them: +int EIGEN_ALIGN16 ai[4]; + +Turn this into: +EIGEN_ALIGN16 int ai[4]; + + +(cherry picked from commit 8faafc3aaa2b45e234cfe0bef085c1134ceffc42) +--- + Eigen/src/Core/arch/ZVector/Complex.h | 8 ++++---- + Eigen/src/Core/arch/ZVector/PacketMath.h | 24 ++++++++++++------------ + 2 files changed, 16 insertions(+), 16 deletions(-) + +diff --git a/Eigen/src/Core/arch/ZVector/Complex.h b/Eigen/src/Core/arch/ZVector/Complex.h +index e0acedefbd..6c67cfe058 100644 +--- a/Eigen/src/Core/arch/ZVector/Complex.h ++++ b/Eigen/src/Core/arch/ZVector/Complex.h +@@ -160,7 +160,7 @@ template<> EIGEN_STRONG_INLINE void prefetch >(const std::c + + template<> EIGEN_STRONG_INLINE std::complex pfirst(const Packet1cd& a) + { +- std::complex EIGEN_ALIGN16 res; ++ EIGEN_ALIGN16 std::complex res; + pstore >(&res, a); + + return res; +@@ -205,7 +205,7 @@ template<> EIGEN_STRONG_INLINE void pstoreu >(std::complex EIGEN_STRONG_INLINE std::complex pfirst(const Packet2cf& a) + { +- std::complex EIGEN_ALIGN16 res[2]; ++ EIGEN_ALIGN16 std::complex res[2]; + pstore >(res, a); + + return res[0]; +@@ -235,14 +235,14 @@ template<> EIGEN_STRONG_INLINE Packet2cf pset1(const std::complex EIGEN_DEVICE_FUNC inline Packet2cf pgather, Packet2cf>(const std::complex* from, Index stride) + { +- std::complex EIGEN_ALIGN16 af[2]; ++ EIGEN_ALIGN16 std::complex af[2]; + af[0] = from[0*stride]; + af[1] = from[1*stride]; + return pload(af); + } + template<> EIGEN_DEVICE_FUNC inline void pscatter, Packet2cf>(std::complex* to, const Packet2cf& from, Index stride) + { +- std::complex EIGEN_ALIGN16 af[2]; ++ EIGEN_ALIGN16 std::complex af[2]; + pstore >((std::complex *) af, from); + to[0*stride] = af[0]; + to[1*stride] = af[1]; +diff --git a/Eigen/src/Core/arch/ZVector/PacketMath.h b/Eigen/src/Core/arch/ZVector/PacketMath.h +index 208e4b167c..a7b59c80ed 100755 +--- a/Eigen/src/Core/arch/ZVector/PacketMath.h ++++ b/Eigen/src/Core/arch/ZVector/PacketMath.h +@@ -358,7 +358,7 @@ pbroadcast4(const double *a, + + template<> EIGEN_DEVICE_FUNC inline Packet4i pgather(const int* from, Index stride) + { +- int EIGEN_ALIGN16 ai[4]; ++ EIGEN_ALIGN16 int ai[4]; + ai[0] = from[0*stride]; + ai[1] = from[1*stride]; + ai[2] = from[2*stride]; +@@ -368,7 +368,7 @@ template<> EIGEN_DEVICE_FUNC inline Packet4i pgather(const int* f + + template<> EIGEN_DEVICE_FUNC inline Packet2d pgather(const double* from, Index stride) + { +- double EIGEN_ALIGN16 af[2]; ++ EIGEN_ALIGN16 double af[2]; + af[0] = from[0*stride]; + af[1] = from[1*stride]; + return pload(af); +@@ -376,7 +376,7 @@ template<> EIGEN_DEVICE_FUNC inline Packet2d pgather(const dou + + template<> EIGEN_DEVICE_FUNC inline void pscatter(int* to, const Packet4i& from, Index stride) + { +- int EIGEN_ALIGN16 ai[4]; ++ EIGEN_ALIGN16 int ai[4]; + pstore((int *)ai, from); + to[0*stride] = ai[0]; + to[1*stride] = ai[1]; +@@ -386,7 +386,7 @@ template<> EIGEN_DEVICE_FUNC inline void pscatter(int* to, const + + template<> EIGEN_DEVICE_FUNC inline void pscatter(double* to, const Packet2d& from, Index stride) + { +- double EIGEN_ALIGN16 af[2]; ++ EIGEN_ALIGN16 double af[2]; + pstore(af, from); + to[0*stride] = af[0]; + to[1*stride] = af[1]; +@@ -460,8 +460,8 @@ template<> EIGEN_STRONG_INLINE void pstoreu(double* to, const Packet2d& + template<> EIGEN_STRONG_INLINE void prefetch(const int* addr) { EIGEN_ZVECTOR_PREFETCH(addr); } + template<> EIGEN_STRONG_INLINE void prefetch(const double* addr) { EIGEN_ZVECTOR_PREFETCH(addr); } + +-template<> EIGEN_STRONG_INLINE int pfirst(const Packet4i& a) { int EIGEN_ALIGN16 x[4]; pstore(x, a); return x[0]; } +-template<> EIGEN_STRONG_INLINE double pfirst(const Packet2d& a) { double EIGEN_ALIGN16 x[2]; pstore(x, a); return x[0]; } ++template<> EIGEN_STRONG_INLINE int pfirst(const Packet4i& a) { EIGEN_ALIGN16 int x[4]; pstore(x, a); return x[0]; } ++template<> EIGEN_STRONG_INLINE double pfirst(const Packet2d& a) { EIGEN_ALIGN16 double x[2]; pstore(x, a); return x[0]; } + + template<> EIGEN_STRONG_INLINE Packet4i preverse(const Packet4i& a) + { +@@ -639,7 +639,7 @@ pbroadcast4(const float *a, + + template<> EIGEN_DEVICE_FUNC inline Packet4f pgather(const float* from, Index stride) + { +- float EIGEN_ALIGN16 ai[4]; ++ EIGEN_ALIGN16 float ai[4]; + ai[0] = from[0*stride]; + ai[1] = from[1*stride]; + ai[2] = from[2*stride]; +@@ -649,7 +649,7 @@ template<> EIGEN_DEVICE_FUNC inline Packet4f pgather(const floa + + template<> EIGEN_DEVICE_FUNC inline void pscatter(float* to, const Packet4f& from, Index stride) + { +- float EIGEN_ALIGN16 ai[4]; ++ EIGEN_ALIGN16 float ai[4]; + pstore((float *)ai, from); + to[0*stride] = ai[0]; + to[1*stride] = ai[1]; +@@ -785,7 +785,7 @@ template<> EIGEN_STRONG_INLINE Packet4f ploaddup(const float* from) + return p; + } + +-template<> EIGEN_STRONG_INLINE float pfirst(const Packet4f& a) { float EIGEN_ALIGN16 x[2]; vec_st2f(a.v4f[0], &x[0]); return x[0]; } ++template<> EIGEN_STRONG_INLINE float pfirst(const Packet4f& a) { EIGEN_ALIGN16 float x[2]; vec_st2f(a.v4f[0], &x[0]); return x[0]; } + + template<> EIGEN_STRONG_INLINE Packet4f preverse(const Packet4f& a) + { +@@ -943,7 +943,7 @@ pbroadcast4(const float *a, + + template<> EIGEN_DEVICE_FUNC inline Packet4f pgather(const float* from, Index stride) + { +- float EIGEN_ALIGN16 af[4]; ++ EIGEN_ALIGN16 float af[4]; + af[0] = from[0*stride]; + af[1] = from[1*stride]; + af[2] = from[2*stride]; +@@ -953,7 +953,7 @@ template<> EIGEN_DEVICE_FUNC inline Packet4f pgather(const floa + + template<> EIGEN_DEVICE_FUNC inline void pscatter(float* to, const Packet4f& from, Index stride) + { +- float EIGEN_ALIGN16 af[4]; ++ EIGEN_ALIGN16 float af[4]; + pstore((float*)af, from); + to[0*stride] = af[0]; + to[1*stride] = af[1]; +@@ -978,7 +978,7 @@ template<> EIGEN_STRONG_INLINE Packet4f pround (const Packet4f& a) { r + template<> EIGEN_STRONG_INLINE Packet4f pceil (const Packet4f& a) { return vec_ceil(a); } + template<> EIGEN_STRONG_INLINE Packet4f pfloor (const Packet4f& a) { return vec_floor(a); } + template<> EIGEN_STRONG_INLINE Packet4f pabs (const Packet4f& a) { return vec_abs(a); } +-template<> EIGEN_STRONG_INLINE float pfirst(const Packet4f& a) { float EIGEN_ALIGN16 x[4]; pstore(x, a); return x[0]; } ++template<> EIGEN_STRONG_INLINE float pfirst(const Packet4f& a) { EIGEN_ALIGN16 float x[4]; pstore(x, a); return x[0]; } + + template<> EIGEN_STRONG_INLINE Packet4f ploaddup(const float* from) + { +-- +GitLab + diff --git a/SPECS/eigen3.spec b/SPECS/eigen3.spec index 1adfd0d..0e85672 100644 --- a/SPECS/eigen3.spec +++ b/SPECS/eigen3.spec @@ -27,12 +27,15 @@ Name: eigen3 Version: 3.4.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A lightweight C++ template library for vector and matrix math License: ASL 2.0 and MPLv2.0 and LGPLv2+ and BSD and Minpack URL: http://eigen.tuxfamily.org/index.php?title=Main_Page Source0: https://gitlab.com/libeigen/eigen/-/archive/%{version}/eigen-%{version}.tar.bz2 +# Upstream patches requested by a partner or customer: +Patch0: 0001-fix_zvector_build.patch +Patch1: 0002-zvector_move_alignas_qualifier_to_come_first.patch BuildRequires: %{blaslib}-devel BuildRequires: fftw-devel @@ -119,6 +122,10 @@ rm -f %{_vpath_builddir}/doc/html/unsupported/installdox %changelog +* Mon May 15 2023 Jiri Kucera - 3.4.0-2 +- Backport upstream patches + Resolves: #2137486 + * Wed Feb 16 2022 Jiri Kucera - 3.4.0-1 - Update to 3.4.0 Resolves: #2032423