SHA256
1
0
forked from pool/ceres-solver
Dominique Leuenberger 2022-02-21 16:46:53 +00:00 committed by Git OBS Bridge
commit 66e5105388
4 changed files with 75 additions and 12 deletions

11
_constraints Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<constraints>
<hardware>
<memory>
<size unit="G">6</size>
</memory>
<memoryperjob>
<size unit="M">1100</size>
</memoryperjob>
</hardware>
</constraints>

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Mon Feb 21 02:16:20 UTC 2022 - Stefan Brüns <stefan.bruens@rwth-aachen.de>
- Fix build with TBB >= 2021.1, add
fix-tbb-2021.1-detection.patch
- Correct License tags.
- Cleanup spec file, remove obsolete CMake options.
- Add _constraints to avoid occasional build failures.
-------------------------------------------------------------------
Sat Jan 16 18:24:07 UTC 2021 - andy great <andythe_great@pm.me>

View File

@ -1,7 +1,7 @@
#
# spec file for package ceres-solver
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -21,14 +21,14 @@ Name: ceres-solver
Version: 2.0.0
Release: 0
Summary: C++ library for modeling and solving optimization problems
License: BSD-3-Clause
License: Apache-2.0 AND BSD-3-Clause AND MIT
Group: Development/Libraries/C and C++
URL: http://ceres-solver.org/
Source: http://ceres-solver.org/%{name}-%{version}.tar.gz
Patch0: https://github.com/ceres-solver/ceres-solver/commit/941ea13475913ef8322584f7401633de9967ccc8.patch#/fix-tbb-2021.1-detection.patch
BuildRequires: cmake >= 3.5.0
BuildRequires: gcc-c++
BuildRequires: glog-devel >= 0.3.1
BuildRequires: libcxsparse3
BuildRequires: suitesparse-devel
BuildRequires: pkgconfig(eigen3) >= 3.3.0
@ -42,7 +42,7 @@ This package is built with Eigen only.
%package -n libceres-devel
Summary: Ceres Solver header files
License: BSD-3-Clause
License: Apache-2.0 AND BSD-3-Clause
Group: Development/Libraries/C and C++
Requires: glog-devel >= 0.3.1
Requires: libceres%{sover} = %{version}
@ -55,10 +55,9 @@ problems.
This package is built with Eigen only.
%package -n libceres%{sover}
Summary: Ceres Solver shared library
License: LGPL-2.1-only
License: Apache-2.0 AND BSD-3-Clause
Group: System/Libraries
%description -n libceres%{sover}
@ -69,12 +68,17 @@ problems.
This package is built with Eigen only.
%prep
%setup -q
%autosetup -p1
%build
%cmake -DCXSPARSE=ON -DSUITESPARSE=ON -DEIGENSPARSE=ON -DOPENMP=ON -DCXX11=ON -DCMAKE_INSTALL_PREFIX=/usr -DEIGEN_INCLUDE_DIR_HINTS=/usr/include/eigen3 -DGFLAGS=OFF -DMINIGLOG=OFF -DBUILD_SHARED_LIBS=ON
%cmake \
-DCXSPARSE=ON \
-DSUITESPARSE=ON \
-DEIGENSPARSE=ON \
-DGFLAGS=OFF \
-DMINIGLOG=OFF \
%{nil}
%cmake_build
%install
@ -85,13 +89,11 @@ This package is built with Eigen only.
%postun -n libceres%{sover} -p /sbin/ldconfig
%files -n libceres-devel
%defattr(-,root,root)
%{_includedir}/ceres/
%{_libdir}/cmake/Ceres/
%{_libdir}/libceres.so
%files -n libceres%{sover}
%defattr(-,root,root)
%{_libdir}/libceres.so.*
%{_libdir}/libceres.so.%{sover}*
%changelog

View File

@ -0,0 +1,41 @@
From 941ea13475913ef8322584f7401633de9967ccc8 Mon Sep 17 00:00:00 2001
From: Alex Stewart <alexs.mac@gmail.com>
Date: Mon, 15 Mar 2021 14:17:59 +0000
Subject: [PATCH] Fix FindTBB version detection with TBB >= 2021.1.1
- Raised as issue #669
Change-Id: Ic2fcaf31aef5e303d19a9caef7d6c679325f554a
---
cmake/FindTBB.cmake | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/cmake/FindTBB.cmake b/cmake/FindTBB.cmake
index 5ae7b6156..10e540da0 100644
--- a/cmake/FindTBB.cmake
+++ b/cmake/FindTBB.cmake
@@ -429,10 +429,23 @@ findpkg_finish(TBB_MALLOC_PROXY tbbmalloc_proxy)
#=============================================================================
#parse all the version numbers from tbb
if(NOT TBB_VERSION)
+ set(TBB_VERSION_FILE_PRIOR_TO_TBB_2021_1
+ "${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h")
+ set(TBB_VERSION_FILE_AFTER_TBB_2021_1
+ "${TBB_INCLUDE_DIR}/oneapi/tbb/version.h")
+
+ if (EXISTS "${TBB_VERSION_FILE_PRIOR_TO_TBB_2021_1}")
+ set(TBB_VERSION_FILE "${TBB_VERSION_FILE_PRIOR_TO_TBB_2021_1}")
+ elseif (EXISTS "${TBB_VERSION_FILE_AFTER_TBB_2021_1}")
+ set(TBB_VERSION_FILE "${TBB_VERSION_FILE_AFTER_TBB_2021_1}")
+ else()
+ message(FATAL_ERROR "Found TBB installation: ${TBB_INCLUDE_DIR} "
+ "missing version header.")
+ endif()
#only read the start of the file
file(STRINGS
- "${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h"
+ "${TBB_VERSION_FILE}"
TBB_VERSION_CONTENTS
REGEX "VERSION")