summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Neuhaus2021-12-11 08:05:44 +0100
committerFrank Neuhaus2021-12-11 08:05:44 +0100
commitfd402d6f97d8475bb6c4851c86f227129efbbc5a (patch)
tree23df0d409454443ced588250325615f27900f648
parenta02abb1dbbab95b18e1260506e3796be9fc0b8eb (diff)
downloadaur-fd402d6f97d8475bb6c4851c86f227129efbbc5a.tar.gz
- Backport compile fix for TBB from git as requested by xantares
- Pin Eigen Version as suggested from bartus
-rw-r--r--.SRCINFO5
-rw-r--r--0001-Fix-FindTBB-version-detection-with-TBB-2021.1.1.patch44
-rw-r--r--PKGBUILD18
3 files changed, 61 insertions, 6 deletions
diff --git a/.SRCINFO b/.SRCINFO
index a51f392ca9db..49c8179ba60b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = ceres-solver
pkgdesc = Solver for nonlinear least squares problems
pkgver = 2.0.0
- pkgrel = 1
+ pkgrel = 2
url = http://ceres-solver.org/
arch = i686
arch = x86_64
@@ -13,7 +13,8 @@ pkgbase = ceres-solver
optdepends = openmp
options = staticlibs
source = http://ceres-solver.org/ceres-solver-2.0.0.tar.gz
+ source = 0001-Fix-FindTBB-version-detection-with-TBB-2021.1.1.patch
sha256sums = 10298a1d75ca884aa0507d1abb0e0f04800a92871cd400d4c361b56a777a7603
+ sha256sums = 3995ecc44dd32cd00c5708a85f8fa9ca6d1deb6a354e7bc89f00d94f243bab76
pkgname = ceres-solver
-
diff --git a/0001-Fix-FindTBB-version-detection-with-TBB-2021.1.1.patch b/0001-Fix-FindTBB-version-detection-with-TBB-2021.1.1.patch
new file mode 100644
index 000000000000..e05d089e1615
--- /dev/null
+++ b/0001-Fix-FindTBB-version-detection-with-TBB-2021.1.1.patch
@@ -0,0 +1,44 @@
+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 5ae7b61..10e540d 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")
+
+--
+2.34.1
+
diff --git a/PKGBUILD b/PKGBUILD
index 6e7d60c34d03..0dc431eeadd6 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
pkgname=ceres-solver
pkgver=2.0.0
-pkgrel=1
+pkgrel=2
pkgdesc="Solver for nonlinear least squares problems"
arch=('i686' 'x86_64')
url="http://ceres-solver.org/"
@@ -11,8 +11,9 @@ makedepends=('cmake')
depends=('google-glog>=0.3.4' 'eigen>=3.3.0'
'suitesparse>=4.4.5')
optdepends=('openmp')
-source=("http://ceres-solver.org/ceres-solver-2.0.0.tar.gz")
-sha256sums=("10298a1d75ca884aa0507d1abb0e0f04800a92871cd400d4c361b56a777a7603")
+source=("http://ceres-solver.org/ceres-solver-2.0.0.tar.gz" "0001-Fix-FindTBB-version-detection-with-TBB-2021.1.1.patch")
+sha256sums=('10298a1d75ca884aa0507d1abb0e0f04800a92871cd400d4c361b56a777a7603'
+ '3995ecc44dd32cd00c5708a85f8fa9ca6d1deb6a354e7bc89f00d94f243bab76')
options=('staticlibs')
_cmakeopts=('-D CMAKE_BUILD_TYPE=Release'
@@ -23,9 +24,14 @@ _cmakeopts=('-D CMAKE_BUILD_TYPE=Release'
'-D BUILD_EXAMPLES=OFF'
'-D BUILD_BENCHMARKS=OFF')
+prepare() {
+ # apply compile fix for tbb (backported from git repo)
+ echo $(pwd)
+ patch --directory="$pkgname-$pkgver" --forward --strip=1 --input="$srcdir/0001-Fix-FindTBB-version-detection-with-TBB-2021.1.1.patch"
+}
+
build() {
cd $srcdir/$pkgname-$pkgver
-
mkdir -p ./build
cd ./build
cmake ${_cmakeopts[@]} ../ -DLIB_SUFFIX=""
@@ -37,4 +43,8 @@ package ()
cd $srcdir/$pkgname-$pkgver/build/
make DESTDIR=$pkgdir install
install -Dm644 ../LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+
+ # Pin Eigen version preventing version mismatch cmake config after Eigen update.
+ index=$(declare -p depends | sed -n "s,.*\[\([^]]*\)\]=\"eigen.*\".*,\1,p")
+ depends[$index]=$(pacman -Sp --print-format "%n=%v" eigen|cut -d- -f1)
}