diff --git a/eigen3.spec b/eigen3.spec index 1163642..139fe79 100644 --- a/eigen3.spec +++ b/eigen3.spec @@ -4,12 +4,6 @@ # debuginfo package for the empty main package. %global debug_package %{nil} -# FIXME ICE on ppc64le when buildings docs with optflags -%ifarch ppc64le -%global optflags %{nil} -%endif - - %if 0%{?fedora} >= 33 || 0%{?rhel} >= 9 %global blaslib flexiblas %global cmake_blas_flags -DBLA_VENDOR=FlexiBLAS @@ -21,15 +15,14 @@ Name: eigen3 Version: 3.4.0 -Release: 4%{?dist} +Release: 5%{?dist} Summary: A lightweight C++ template library for vector and matrix math License: 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 -# https://bugzilla.redhat.com/show_bug.cgi?id=1996330 -# Temporarily disable EIGEN_ALTIVEC_DISABLE_MMA on PPC64le -Patch0: eigen_mma.patch +# For mingw, read the comment in the file for details +Source1: mingw_TryRunResults.cmake BuildRequires: %{blaslib}-devel BuildRequires: fftw-devel @@ -51,6 +44,20 @@ BuildRequires: doxygen BuildRequires: graphviz BuildRequires: tex(latex) +BuildRequires: mingw32-filesystem >= 95 +BuildRequires: mingw32-gcc-c++ +BuildRequires: mingw32-gcc-gfortran +BuildRequires: mingw32-fftw +BuildRequires: mingw32-gmp +BuildRequires: mingw32-mpfr + +BuildRequires: mingw64-filesystem >= 95 +BuildRequires: mingw64-gcc-c++ +BuildRequires: mingw64-gcc-gfortran +BuildRequires: mingw64-fftw +BuildRequires: mingw64-gmp +BuildRequires: mingw64-mpfr + %description %{summary}. @@ -74,13 +81,29 @@ BuildArch: noarch %description doc Developer documentation for Eigen. +# Mingw32 +%package -n mingw32-%{name} +Summary: %{summary} +BuildArch: noarch + +%description -n mingw32-%{name} +%{summary} + +# Mingw64 +%package -n mingw64-%{name} +Summary: %{summary} +BuildArch: noarch + +%description -n mingw64-%{name} +%{summary} + %prep -%setup -q -n eigen-%{version} -%patch0 -p1 +%autosetup -p1 -n eigen-%{version} %build +# Native build %cmake \ -DINCLUDE_INSTALL_DIR=%{_includedir}/%{name} \ -DCMAKEPACKAGE_INSTALL_DIR=%{_datadir}/cmake/%{name} \ @@ -96,15 +119,21 @@ Developer documentation for Eigen. rm -f %{_vpath_builddir}/doc/html/installdox rm -f %{_vpath_builddir}/doc/html/unsupported/installdox +# MinGW build +MINGW32_CMAKE_ARGS="-DINCLUDE_INSTALL_DIR=%{mingw32_includedir}/%{name} -DCMAKEPACKAGE_INSTALL_DIR=%{mingw32_datadir}/cmake/%{name}" \ +MINGW64_CMAKE_ARGS="-DINCLUDE_INSTALL_DIR=%{mingw64_includedir}/%{name} -DCMAKEPACKAGE_INSTALL_DIR=%{mingw64_datadir}/cmake/%{name}" \ +%mingw_cmake -C%{SOURCE1} -DEIGEN_BUILD_PKGCONFIG:BOOL=ON -DEIGEN_TEST_CXX11=ON + %install %cmake_install +%mingw_make_install %check -# Test fail to build due to compiler crashes -#cmake_build --target buildtests -#ctest +# Building tests takes ages +# cmake_build --target buildtests +# ctest %files devel @@ -116,8 +145,23 @@ rm -f %{_vpath_builddir}/doc/html/unsupported/installdox %files doc %doc %{_vpath_builddir}/doc/html +%files -n mingw32-%{name} +%license COPYING.BSD COPYING.LGPL COPYING.MPL2 COPYING.README +%{mingw32_includedir}/%{name} +%{mingw32_datadir}/pkgconfig/%{name}.pc +%{mingw32_datadir}/cmake/%{name}/ + +%files -n mingw64-%{name} +%license COPYING.BSD COPYING.LGPL COPYING.MPL2 COPYING.README +%{mingw64_includedir}/%{name} +%{mingw64_datadir}/pkgconfig/%{name}.pc +%{mingw64_datadir}/cmake/%{name}/ + %changelog +* Thu Feb 24 2022 Sandro Mani - 3.4.0-5 +- Add mingw subpackages + * Thu Jan 20 2022 Fedora Release Engineering - 3.4.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild diff --git a/eigen_mma.patch b/eigen_mma.patch deleted file mode 100644 index b64249a..0000000 --- a/eigen_mma.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -rupN eigen-3.4.0/Eigen/src/Core/arch/AltiVec/MatrixProduct.h eigen-3.4.0-new/Eigen/src/Core/arch/AltiVec/MatrixProduct.h ---- eigen-3.4.0/Eigen/src/Core/arch/AltiVec/MatrixProduct.h 2021-08-18 22:41:58.000000000 +0200 -+++ eigen-3.4.0-new/Eigen/src/Core/arch/AltiVec/MatrixProduct.h 2021-08-22 17:37:23.626427133 +0200 -@@ -28,6 +28,10 @@ - #endif - #endif - -+#ifdef __PPC64__ -+#define EIGEN_ALTIVEC_DISABLE_MMA -+#endif -+ - #ifdef __has_builtin - #if __has_builtin(__builtin_mma_assemble_acc) - #define ALTIVEC_MMA_SUPPORT diff --git a/mingw_TryRunResults.cmake b/mingw_TryRunResults.cmake new file mode 100644 index 0000000..575c781 --- /dev/null +++ b/mingw_TryRunResults.cmake @@ -0,0 +1,31 @@ +# This file was generated by CMake because it detected TRY_RUN() commands +# in crosscompiling mode. It will be overwritten by the next CMake run. +# Copy it to a safe location, set the variables to appropriate values +# and use it then to preset the CMake cache (using -C). + + +# run_res +# indicates whether the executable would have been able to run on its +# target platform. If so, set run_res to +# the exit code (in many cases 0 for success), otherwise enter "FAILED_TO_RUN". +# run_res__TRYRUN_OUTPUT +# contains the text the executable would have printed on stdout and stderr. +# If the executable would not have been able to run, set run_res__TRYRUN_OUTPUT empty. +# Otherwise check if the output is evaluated by the calling CMake code. If so, +# check what the source file would have printed when called with the given arguments. +# The compile_res variable holds the build result for this TRY_RUN(). +# +# Source file : /home/sandro/rpmbuild/BUILD/eigen-eigen-5097c01bcdc4/build_win32/is64.cpp +# Executable : /home/sandro/rpmbuild/BUILD/eigen-eigen-5097c01bcdc4/build_win32/CMakeFiles/cmTryCompileExec75681192-run_res.exe +# Run arguments : +# Called from: [2] /home/sandro/rpmbuild/BUILD/eigen-eigen-5097c01bcdc4/cmake/EigenConfigureTesting.cmake +# [1] /home/sandro/rpmbuild/BUILD/eigen-eigen-5097c01bcdc4/CMakeLists.txt + +SET( run_res + 0 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( run_res__TRYRUN_OUTPUT + "" + CACHE STRING "Output from TRY_RUN" FORCE) +