Ceres-Solver: new recipe (#5523)

* Ceres-Solver: new recipe
This commit is contained in:
extrowerk
2022-02-27 21:16:19 +01:00
committed by GitHub
parent cc83486660
commit a82742a4a5
2 changed files with 158 additions and 0 deletions

View File

@@ -0,0 +1,111 @@
SUMMARY="A large scale non-linear optimization library"
DESCRIPTION="Ceres Solver 1 is an open source C++ library for modeling and \
solving large, complicated optimization problems. It can be used to solve \
Non-linear Least Squares problems with bounds constraints and general \
unconstrained optimization problems. It is a mature, feature rich, and \
performant library that has been used in production at Google since 2010."
HOMEPAGE="http://ceres-solver.org/"
COPYRIGHT="2015 Google Inc."
LICENSE="BSD (3-clause)
Apache v2"
REVISION="1"
srcGitRev="46b3495a4f84eb5b7832b686a0b053cd71a1acab"
SOURCE_URI="https://github.com/ceres-solver/ceres-solver/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="1a76b9aeb1d8e5565c49ca90a04108242a934270e8d14baeab4dd8672321c9b5"
SOURCE_FILENAME="ceres-solver-$portVersion-tar.gz"
SOURCE_DIR="ceres-solver-$srcGitRev"
#PATCHES="ceres_solver-$portVersion.patchset"
ARCHITECTURES="!x86_gcc2 all"
SECONDARY_ARCHITECTURES="?x86"
libVersion="2.1.0"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
PROVIDES="
ceres_solver$secondaryArchSuffix = $portVersion
lib:libceres$secondaryArchSuffix = $libVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libamd$secondaryArchSuffix
lib:libcamd$secondaryArchSuffix
lib:libccolamd$secondaryArchSuffix
lib:libcholmod$secondaryArchSuffix
lib:libcolamd$secondaryArchSuffix
lib:libglog$secondaryArchSuffix
lib:liblapack$secondaryArchSuffix
lib:libmetis$secondaryArchSuffix
lib:libopenblas$secondaryArchSuffix
lib:libspqr$secondaryArchSuffix
lib:libsuitesparseconfig$secondaryArchSuffix
lib:libtbb$secondaryArchSuffix
"
PROVIDES_devel="
ceres_solver${secondaryArchSuffix}_devel = $portVersion
devel:libceres$secondaryArchSuffix = $libVersionCompat
"
REQUIRES_devel="
ceres_solver$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:eigen$secondaryArchSuffix
devel:libamd$secondaryArchSuffix
devel:libcamd$secondaryArchSuffix
devel:libccolamd$secondaryArchSuffix
devel:libcholmod$secondaryArchSuffix
devel:libcolamd$secondaryArchSuffix
devel:libglog$secondaryArchSuffix
devel:liblapack$secondaryArchSuffix
devel:libmetis$secondaryArchSuffix
devel:libopenblas$secondaryArchSuffix
devel:libspqr$secondaryArchSuffix
devel:libsuitesparseconfig$secondaryArchSuffix
devel:libtbb$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:g++$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
"
defineDebugInfoPackage ceres_solver$secondaryArchSuffix \
$libDir/libceres.so.$libVersion
BUILD()
{
mkdir -p build && cd "$_"
cmake .. \
-DBUILD_SHARED_LIBS=ON \
-DEigen3_DIR=`finddir B_SYSTEM_DATA_DIRECTORY`/eigen3/cmake \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
$cmakeDirArgs
make # parallel builds needs way too much ram
}
INSTALL()
{
cd build
make install $jobArgs
prepareInstalledDevelLib libceres
fixPkgconfig
packageEntries devel \
$developDir \
$libDir/cmake
}
TEST()
{
cd build
make test
}

View File

@@ -0,0 +1,47 @@
From d6c1f99f3f4a2b38f349cf4aefbceefafbfce296 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Wed, 30 Dec 2020 18:19:10 +0000
Subject: Set paths for install
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ea7e9b8..a415b8f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -661,21 +661,21 @@ endif (BUILD_EXAMPLES)
# Setup installation of Ceres public headers.
file(GLOB CERES_HDRS ${Ceres_SOURCE_DIR}/include/ceres/*.h)
-install(FILES ${CERES_HDRS} DESTINATION include/ceres)
+install(FILES ${CERES_HDRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ceres)
file(GLOB CERES_PUBLIC_INTERNAL_HDRS ${Ceres_SOURCE_DIR}/include/ceres/internal/*.h)
-install(FILES ${CERES_PUBLIC_INTERNAL_HDRS} DESTINATION include/ceres/internal)
+install(FILES ${CERES_PUBLIC_INTERNAL_HDRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ceres/internal)
# Also setup installation of Ceres config.h configured with the current
# build options into the installed headers directory.
install(FILES ${Ceres_BINARY_DIR}/config/ceres/internal/config.h
- DESTINATION include/ceres/internal)
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ceres/internal)
if (MINIGLOG)
# Install miniglog header if being used as logging #includes appear in
# installed public Ceres headers.
install(FILES ${Ceres_SOURCE_DIR}/internal/ceres/miniglog/glog/logging.h
- DESTINATION include/ceres/internal/miniglog/glog)
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ceres/internal/miniglog/glog)
endif (MINIGLOG)
# Ceres supports two mechanisms by which it can be detected & imported into
@@ -720,7 +720,7 @@ write_basic_package_version_file("${Ceres_BINARY_DIR}/CeresConfigVersion.cmake"
if (WIN32)
set(RELATIVE_CMAKECONFIG_INSTALL_DIR CMake)
else ()
- set(RELATIVE_CMAKECONFIG_INSTALL_DIR lib${LIB_SUFFIX}/cmake/Ceres)
+ set(RELATIVE_CMAKECONFIG_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}${LIB_SUFFIX}/cmake/Ceres)
endif ()
# This "exports" for installation all targets which have been put into the
--
2.28.0