2014-05-06 17:38:01 +02:00
#
2021-08-22 21:38:49 +02:00
# spec file
2014-05-06 17:38:01 +02:00
#
2022-02-05 15:10:30 +01:00
# Copyright (c) 2022 SUSE LLC
2014-05-06 17:38:01 +02:00
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
2019-07-25 18:59:53 +02:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
2014-05-06 17:38:01 +02:00
#
2019-08-06 19:33:40 +02:00
%global flavor @BUILD_FLAVOR@%{nil}
%global pkgname eigen3
2020-10-19 16:36:21 +02:00
%global srcname eigen
2019-08-06 19:33:40 +02:00
2020-12-20 12:57:24 +01:00
# The OpenGL support test fails
%bcond_with opengl_test
# Tests fail for different reasons within the test-suite itself; disable for now
# See e.g. https://gitlab.com/libeigen/eigen/-/issues/2088, https://gitlab.com/libeigen/eigen/-/issues/2092
# Also balloons the resources required: > 32 GiB disk space + >= 12 GiB memory
2019-07-25 18:59:53 +02:00
%bcond_with tests
2014-05-06 17:38:01 +02:00
2019-08-06 19:33:40 +02:00
%if "%{flavor}" == "docs"
%define pkgsuffix -doc
%endif
Name : eigen3%{?pkgsuffix}
2021-08-22 21:38:49 +02:00
Version : 3.4.0
2014-05-06 17:38:01 +02:00
Release : 0
Summary : C++ Template Library for Linear Algebra
2021-08-22 21:38:49 +02:00
License : BSD-3-Clause AND LGPL-2.1-only AND MPL-2.0 AND LGPL-2.1-or-later
2020-09-23 17:38:40 +02:00
URL : http://eigen.tuxfamily.org/
2020-10-19 16:36:21 +02:00
Source0 : https://gitlab.com/libeigen/eigen/-/archive/%{version} /%{srcname} -%{version} .tar.bz2
2014-08-03 15:36:30 +02:00
Patch0 : 0001-Disable-Altivec-for-ppc64le.patch
Patch1 : 0001-Do-stack-allignment-on-ppc.patch
2022-02-05 15:10:30 +01:00
# PATCH-FIX-UPSTREAM -- https://gitlab.com/libeigen/eigen/-/merge_requests/680.patch
Patch2 : fix_ppc64le_always_inline_680.patch
2020-12-20 12:57:24 +01:00
%if %{with tests}
# SECTION Patches to fix tests
# PATCH-FIX-UPSTREAM eigen3-googlehash-detection.patch badshah400@gmail.com -- GoogleHash needs C++11 std to compile test code and be succesfully detected
Patch9 : eigen3-googlehash-detection.patch
# PATCH-FIX-UPSTREAM eigen3-fix-forward_adolc-unit-test.patch badshah400@gmail -- Prevent conflict of std::min/max with eigen's macros by importing eigen test-suite's main.h header only after all system headers have been included
Patch10 : eigen3-fix-forward_adolc-unit-test.patch
# /SECTION
%endif
2014-05-06 17:38:01 +02:00
BuildRequires : adolc-devel
BuildRequires : cmake
BuildRequires : fftw3-devel
BuildRequires : gcc-c++
BuildRequires : gcc-fortran
BuildRequires : gmp-devel
BuildRequires : gsl-devel
2017-03-09 00:59:11 +01:00
BuildRequires : libboost_headers-devel
2019-07-25 18:59:53 +02:00
BuildRequires : metis-devel
2014-05-06 17:38:01 +02:00
BuildRequires : mpfr-devel
BuildRequires : pkg-config
BuildRequires : sparsehash-devel
BuildRequires : suitesparse-devel
2016-07-12 23:50:12 +02:00
BuildRequires : superlu-devel
2019-08-06 19:33:40 +02:00
%if "%{flavor}" == "docs"
2019-07-25 18:59:53 +02:00
BuildRequires : doxygen
BuildRequires : fdupes
BuildRequires : graphviz
BuildRequires : graphviz-gd
2017-01-11 11:53:00 +01:00
BuildRequires : texlive-dvips
2014-05-06 17:38:01 +02:00
BuildRequires : texlive-latex
2019-07-25 18:59:53 +02:00
BuildRequires : tex(newunicodechar.sty)
%endif
2020-12-20 12:57:24 +01:00
%if %{with opengl_test}
2019-07-25 18:59:53 +02:00
BuildRequires : freeglut-devel
BuildRequires : glew-devel
2015-09-11 09:01:18 +02:00
BuildRequires : pkgconfig(gl)
%endif
2019-07-25 18:59:53 +02:00
BuildArch : noarch
2014-05-06 17:38:01 +02:00
%description
Eigen is a C++ template library for linear algebra: matrices, vectors,
numerical solvers, and related algorithms.
%package devel
Summary : C++ Template Library for Linear Algebra
2017-11-08 20:11:24 +01:00
# libeigen3-devel was last used at openSUSE 13.1 (version 3.2.0)
2014-05-06 17:38:01 +02:00
Provides : libeigen3-devel = %{version}
Obsoletes : libeigen3-devel < %{version}
%description devel
Eigen is a C++ template library for linear algebra: matrices, vectors,
numerical solvers, and related algorithms.
2019-08-06 19:33:40 +02:00
%if "%{flavor}" == "docs"
2017-08-12 19:06:59 +02:00
Summary : Documentation for the Eigen3 C++ Template Library for Linear Algebra
2017-07-18 14:42:00 +02:00
2019-08-06 19:33:40 +02:00
%description
2017-07-18 14:42:00 +02:00
Documentation in HTML format for the Eigen3 C++ Template Library
for Linear Algebra
2019-08-06 19:33:40 +02:00
%endif
2017-07-18 14:42:00 +02:00
2014-05-06 17:38:01 +02:00
%prep
2020-11-09 12:34:15 +01:00
%autosetup -p1 -n %{srcname} -%{version}
2014-05-06 17:38:01 +02:00
# Fix rpmlint warning "wrong-file-end-of-line-encoding"
sed -i 's/\r$//' COPYING.MINPACK
# Remove build time references so build-compare can do its work
echo " H T M L _ T I M E S T A M P = N O " >> doc/Doxyfile.in
%build
2015-09-11 09:01:18 +02:00
%cmake \
2021-08-22 21:38:49 +02:00
-DINCLUDE_INSTALL_DIR:PATH=include/eigen3 \
2020-12-20 12:57:24 +01:00
-DCMAKE_SKIP_RPATH:BOOL=OFF \
-DCMAKE_SKIP_INSTALL_RPATH:BOOL=ON \
-DEIGEN_TEST_CXX11:Bool=%{?with_tests:ON}%{!?with_tests:OFF} \
-DEIGEN_TEST_OPENMP:Bool=%{?with_tests:ON}%{!?with_tests:OFF}
2019-08-06 00:54:17 +02:00
2019-08-06 19:33:40 +02:00
%if "%{flavor}" == ""
2022-02-05 15:10:30 +01:00
%cmake_build all %{?with_tests:buildtests}
2019-08-06 19:33:40 +02:00
%else
2022-02-05 15:10:30 +01:00
%cmake_build doc
2019-07-25 18:59:53 +02:00
%endif
rm -f doc/html/*.tgz
find doc -name _formulas.log -print -delete
2014-05-06 17:38:01 +02:00
%install
2019-08-06 19:33:40 +02:00
%if "%{flavor}" == ""
2015-09-11 09:01:18 +02:00
%cmake_install
2019-08-06 19:33:40 +02:00
%else
2015-11-24 22:32:59 +01:00
%fdupes -s build/doc/html/
2019-08-06 19:33:40 +02:00
%endif
2020-12-20 12:57:24 +01:00
%if "%{flavor}" == ""
%if %{with tests}
%check
# Run with a fixed seed to prevent random failures: https://gitlab.com/libeigen/eigen/-/issues/2088
export EIGEN_SEED=100
# Repeat each test once to reduce time spent, since we use a fixed seed anyway
export EIGEN_REPEAT=1
%ctest
%endif
%endif
2019-08-06 19:33:40 +02:00
%if "%{flavor}" == "docs"
%files
%doc build/doc/html/
2014-05-06 17:38:01 +02:00
2019-08-06 19:33:40 +02:00
%else
2021-08-22 21:38:49 +02:00
2014-05-06 17:38:01 +02:00
%files devel
2019-07-25 18:59:53 +02:00
%license COPYING.*
2014-05-06 17:38:01 +02:00
%{_includedir} /eigen3/
2017-03-09 00:59:11 +01:00
%{_datadir} /eigen3/
2014-05-06 17:38:01 +02:00
%{_datadir} /pkgconfig/eigen3.pc
2019-08-06 19:33:40 +02:00
%endif
2017-07-18 14:42:00 +02:00
2014-05-06 17:38:01 +02:00
%changelog