Skip to content

Commit

Permalink
(#17933) gtsam: add v4.2.0a9, update package options
Browse files Browse the repository at this point in the history
* gtsam: add missing Boost::program_options requirement

See https://github.com/borglab/gtsam/blob/4.1.1/cmake/HandleBoost.cmake#L26

* gtsam: add transitive_headers/libs to deps

* gtsam: drop test_v1_package

* gtsam: backport a patch for C++17 compatibility

* gtsam: add v4.2.0a9

https://github.com/borglab/gtsam/releases/tag/4.2a9

* gtsam: update package options

- Covers all options that could be found in GTSAM build scripts.
- Added links to source code since they are hard to find otherwise.
- Added `allow_deprecated` option and deprecated `allow_deprecated_since_V4` as the wording of the GTSAM variable keeps changing but the meaning has stayed the same.
- Added vars:
  GTSAM_DEFAULT_ALLOCATOR
  GTSAM_SLOW_BUT_CORRECT_BETWEENFACTOR
  GTSAM_USE_SYSTEM_METIS
  GTSAM_MEX_BUILD_STATIC_MODULE

* gtsam: tweak formatting

* gtsam: get rid of a duplicate patch

* gtsam: handle `build_type_postfixes` option correctly

* gtsam: correct metis lib name in 4.0

* gtsam: correct build_type_postfixes behavior

* gtsam: fix a bug in 4.2.0a9

* gtsam: add 'lib' prefix to libraries on Windows

* gtsam: add patch_source info to conandata.yml

* gtsam: apply "lib" prefix on Windows correctly

* gtsam: drop v4.0.2

To limit the load on CI.
Superseded by v4.0.3.

* gtsam: update onetbb and boost versions

onetbb/2020.3 did not support Conan v2.

* gtsam: better TBB validation

* gtsam: add tcmalloc support with gperftools

* gtsam: fix Eigen version check

* gtsam: enable shared builds on Windows for v4.2

* gtsam: shared builds on Windows are broken in v4.2.0a9

* gtsam: document options with options_description

* gtsam: add use_vendored_metis option

* gtsam: simplify Conan v1 boilerplate

* gtsam: improve default_allocator handling

* gtsam: remove use_vendored_metis option

It no longer builds with the new metis recipe.

---------

Co-authored-by: Francisco Ramírez <franchuti688@gmail.com>
  • Loading branch information
valgur and franramirez688 committed Aug 6, 2023
1 parent 89e0b7b commit bc1eb90
Show file tree
Hide file tree
Showing 13 changed files with 348 additions and 253 deletions.
40 changes: 22 additions & 18 deletions recipes/gtsam/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
sources:
"4.2.0a9":
url: "https://github.com/borglab/gtsam/archive/refs/tags/4.2a9.tar.gz"
sha256: "a9790e5132bfb2705a5985a1505c3cf9cdf95b711be8352ffa9a9299b279f2f8"
"4.1.1":
url: "https://github.com/borglab/gtsam/archive/4.1.1.tar.gz"
sha256: "c7b5e6cdad52b141c272778f47baf628975457be3e26ed96a7bc2ae685a00af0"
"4.0.3":
url: "https://github.com/borglab/gtsam/archive/4.0.3.tar.gz"
sha256: "eaa561749edf7a2d402981828253e28aed6c717dae35738301c5ab23e2595f25"
"4.0.2":
url: "https://github.com/borglab/gtsam/archive/4.0.2.tar.gz"
sha256: "8770a440f1af98c3f0d9d4dffd568de2d4c21b245e7231e987e26bc236aeb5aa"
patches:
"4.2.0a9":
- patch_file: "patches/4.1.1-0001-cmake-boost.patch"
patch_description: "Use boost targets"
patch_type: "conan"
- patch_file: "patches/4.2.0-0001-macos-rpath.patch"
patch_description: "Relocatable shared libs on Apple OS"
patch_type: "conan"
- patch_file: "patches/4.2.0-0002-eigen3-version.patch"
patch_description: "Get Eigen3 version info from Conan"
patch_type: "conan"
- patch_file: "patches/4.2.0a9-0001-fix-invalid-include.patch"
patch_description: "Fix an invalid include for pre-C++17 compatibility"
patch_type: "portability"
patch_source: "https://github.com/borglab/gtsam/pull/1545"
"4.1.1":
- patch_file: "patches/4.1.1-0001-cmake-boost.patch"
patch_description: "Use boost targets"
Expand All @@ -19,9 +33,12 @@ patches:
- patch_file: "patches/4.1.1-0003-macos-rpath.patch"
patch_description: "Relocatable shared libs on Apple OS"
patch_type: "conan"
- patch_file: "patches/4.0.2-0003-cmake-project.patch"
- patch_file: "patches/4.0.3-0004-cmake-project.patch"
patch_description: "CMake: move project() after cmake_minimum_required()"
patch_type: "conan"
- patch_file: "patches/4.1.1-0005-eigen3-version.patch"
patch_description: "Get Eigen3 version info from Conan"
patch_type: "conan"
"4.0.3":
- patch_file: "patches/4.0.3-0001-cmake-boost.patch"
patch_description: "Use boost targets"
Expand All @@ -32,19 +49,6 @@ patches:
- patch_file: "patches/4.0.3-0003-macos-rpath.patch"
patch_description: "Relocatable shared libs on Apple OS"
patch_type: "conan"
- patch_file: "patches/4.0.2-0003-cmake-project.patch"
patch_description: "CMake: move project() after cmake_minimum_required()"
patch_type: "conan"
"4.0.2":
- patch_file: "patches/4.0.2-0001-cmake-boost.patch"
patch_description: "Use boost targets"
patch_type: "conan"
- patch_file: "patches/4.0.2-0002-cmake-eigen.patch"
patch_description: "Use Eigen include variable from CMakeDeps"
patch_type: "conan"
- patch_file: "patches/4.0.2-0003-macos-rpath.patch"
patch_description: "Relocatable shared libs on Apple OS"
patch_type: "conan"
- patch_file: "patches/4.0.2-0003-cmake-project.patch"
- patch_file: "patches/4.0.3-0004-cmake-project.patch"
patch_description: "CMake: move project() after cmake_minimum_required()"
patch_type: "conan"
334 changes: 241 additions & 93 deletions recipes/gtsam/all/conanfile.py

Large diffs are not rendered by default.

61 changes: 0 additions & 61 deletions recipes/gtsam/all/patches/4.0.2-0001-cmake-boost.patch

This file was deleted.

20 changes: 0 additions & 20 deletions recipes/gtsam/all/patches/4.0.2-0002-cmake-eigen.patch

This file was deleted.

34 changes: 0 additions & 34 deletions recipes/gtsam/all/patches/4.0.2-0003-macos-rpath.patch

This file was deleted.

21 changes: 21 additions & 0 deletions recipes/gtsam/all/patches/4.1.1-0005-eigen3-version.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Otherwise the Eigen version detection will fail due to the Eigen path variable containing a generator expression.
diff --git a/cmake/HandleEigen.cmake b/cmake/HandleEigen.cmake
--- a/cmake/HandleEigen.cmake
+++ b/cmake/HandleEigen.cmake
@@ -46,6 +46,8 @@
endif()

# Detect Eigen version:
+set(GTSAM_EIGEN_VERSION "${Eigen3_VERSION_STRING}")
+if (FALSE)
set(EIGEN_VER_H "${GTSAM_EIGEN_INCLUDE_FOR_BUILD}/Eigen/src/Core/util/Macros.h")
if (EXISTS ${EIGEN_VER_H})
file(READ "${EIGEN_VER_H}" STR_EIGEN_VERSION)
@@ -67,6 +69,7 @@
else()
message(WARNING "Cannot determine Eigen version, missing file: `${EIGEN_VER_H}`")
endif ()
+endif()

if (MSVC)
if (BUILD_SHARED_LIBS)
30 changes: 30 additions & 0 deletions recipes/gtsam/all/patches/4.2.0-0001-macos-rpath.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,5 +5,4 @@ cmake_minimum_required(VERSION 3.0)
if(NOT DEFINED CMAKE_MACOSX_RPATH)
- set(CMAKE_MACOSX_RPATH 0)
endif()

# Set the version number for the library
--- a/cmake/HandleGlobalBuildFlags.cmake
+++ b/cmake/HandleGlobalBuildFlags.cmake
@@ -20,7 +20,6 @@ endif()

if (APPLE AND BUILD_SHARED_LIBS)
# Set the default install directory on macOS
- set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
endif()

###############################################################################
--- a/gtsam/3rdparty/metis/libmetis/CMakeLists.txt
+++ b/gtsam/3rdparty/metis/libmetis/CMakeLists.txt
@@ -17,9 +17,6 @@ if(WIN32)
endif()

if (APPLE)
- set_target_properties(metis-gtsam PROPERTIES
- INSTALL_NAME_DIR
- "${CMAKE_INSTALL_PREFIX}/lib")
endif()

install(TARGETS metis-gtsam EXPORT GTSAM-exports
20 changes: 20 additions & 0 deletions recipes/gtsam/all/patches/4.2.0-0002-eigen3-version.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/cmake/HandleEigen.cmake b/cmake/HandleEigen.cmake
--- a/cmake/HandleEigen.cmake
+++ b/cmake/HandleEigen.cmake
@@ -59,6 +59,8 @@
endif()

# Detect Eigen version:
+set(GTSAM_EIGEN_VERSION "${Eigen3_VERSION_STRING}")
+if (FALSE)
set(EIGEN_VER_H "${GTSAM_EIGEN_INCLUDE_FOR_BUILD}/Eigen/src/Core/util/Macros.h")
if (EXISTS ${EIGEN_VER_H})
file(READ "${EIGEN_VER_H}" STR_EIGEN_VERSION)
@@ -80,6 +82,7 @@
else()
message(WARNING "Cannot determine Eigen version, missing file: `${EIGEN_VER_H}`")
endif ()
+endif()

if (MSVC)
if (BUILD_SHARED_LIBS)
12 changes: 12 additions & 0 deletions recipes/gtsam/all/patches/4.2.0a9-0001-fix-invalid-include.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/gtsam/sfm/DsfTrackGenerator.h b/gtsam/sfm/DsfTrackGenerator.h
--- a/gtsam/sfm/DsfTrackGenerator.h (revision c57988fe554e7213c77fe379c1d7c483de26ad33)
+++ b/gtsam/sfm/DsfTrackGenerator.h (revision 26a37d62103a9b3b828d36e8b1a76f875ed842e3)
@@ -22,7 +22,7 @@

#include <Eigen/Core>
#include <map>
-#include <optional>
+#include <boost/optional.hpp>
#include <vector>

namespace gtsam {
8 changes: 0 additions & 8 deletions recipes/gtsam/all/test_v1_package/CMakeLists.txt

This file was deleted.

17 changes: 0 additions & 17 deletions recipes/gtsam/all/test_v1_package/conanfile.py

This file was deleted.

4 changes: 2 additions & 2 deletions recipes/gtsam/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
versions:
"4.2.0a9":
folder: all
"4.1.1":
folder: all
"4.0.3":
folder: all
"4.0.2":
folder: all

0 comments on commit bc1eb90

Please sign in to comment.