Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gtsam 4.0.3 with boost 1.7.4 #14363

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions recipes/gtsam/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
mkdir build
cd build

cmake .. ${CMAKE_ARGS} ^
-GNinja ^
-DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF ^
-DGTSAM_USE_SYSTEM_EIGEN=ON ^
-DGTSAM_INSTALL_CPPUNITLITE=OFF

ninja install

@rem ninja check
58 changes: 58 additions & 0 deletions recipes/gtsam/boost_174.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
From 5b930bc1a342724ed53462376605dc4895efdc80 Mon Sep 17 00:00:00 2001
From: ameysutavani <[email protected]>
Date: Sun, 21 Mar 2021 21:24:58 -0700
Subject: [PATCH] Patched boost version.hpp

---
gtsam/base/FastList.h | 1 +
gtsam/linear/LossFunctions.h | 2 +-
gtsam/linear/SubgraphBuilder.h | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/gtsam/base/FastList.h b/gtsam/base/FastList.h
index 380836d1d..525ceb5d5 100644
--- a/gtsam/base/FastList.h
+++ b/gtsam/base/FastList.h
@@ -21,6 +21,7 @@
#include <gtsam/base/FastDefaultAllocator.h>
#include <list>
#include <boost/utility/enable_if.hpp>
+#include <boost/serialization/library_version_type.hpp>
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/list.hpp>

diff --git a/gtsam/linear/LossFunctions.h b/gtsam/linear/LossFunctions.h
index 4e6a2b609..f54ea846b 100644
--- a/gtsam/linear/LossFunctions.h
+++ b/gtsam/linear/LossFunctions.h
@@ -23,12 +23,12 @@
#include <gtsam/base/Testable.h>
#include <gtsam/dllexport.h>

+#include <boost/serialization/version.hpp>
#include <boost/serialization/extended_type_info.hpp>
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/optional.hpp>
#include <boost/serialization/shared_ptr.hpp>
#include <boost/serialization/singleton.hpp>
-#include <boost/serialization/version.hpp>

namespace gtsam {
namespace noiseModel {
diff --git a/gtsam/linear/SubgraphBuilder.h b/gtsam/linear/SubgraphBuilder.h
index 88c771ba5..84a477a5e 100644
--- a/gtsam/linear/SubgraphBuilder.h
+++ b/gtsam/linear/SubgraphBuilder.h
@@ -21,9 +21,9 @@
#include <gtsam/base/types.h>
#include <gtsam/dllexport.h>

+#include <boost/serialization/version.hpp>
#include <boost/serialization/nvp.hpp>
#include <boost/shared_ptr.hpp>
-#include <boost/serialization/version.hpp>

#include <vector>

--
2.17.1
12 changes: 12 additions & 0 deletions recipes/gtsam/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
mkdir build
cd build

cmake .. ${CMAKE_ARGS} \
-GNinja \
-DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF \
-DGTSAM_USE_SYSTEM_EIGEN=ON \
-DGTSAM_INSTALL_CPPUNITLITE=OFF

ninja install

ninja check
50 changes: 50 additions & 0 deletions recipes/gtsam/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{% set name = "gtsam" %}
{% set version = "4.0.3" %}

package:
name: gtsam
version: '{{ version }}'

source:
url: https://github.com/borglab/gtsam/archive/refs/tags/{{ version }}.tar.gz
sha256: eaa561749edf7a2d402981828253e28aed6c717dae35738301c5ab23e2595f25
patches:
- unvendor-ceres.patch
- nobuild-examples-timing.patch
- boost_174.patch

build:
number: 0
run_exports:
- '{{ pin_subpackage(name, max_pin="x.x") }}'

requirements:
build:
- '{{ compiler("c") }}'
- '{{ compiler("cxx") }}'
- ninja
- cmake
host:
- boost-cpp
- eigen
- geographiclib-cpp
- ceres-solver
- metis
- suitesparse
# test:
# files:
# - test/hello_world.xar


about:
home: https://github.com/borglab/gtsam
summary: GTSAM is a library of C++ classes that implement smoothing and mapping (SAM) in robotics and vision
license: BSD
license_file:
- LICENSE
- LICENSE.BSD

extra:
recipe-maintainers:
- wolfv
- ameysutavani
17 changes: 17 additions & 0 deletions recipes/gtsam/nobuild-examples-timing.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index edefbf2ea..45e1e3d79 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -435,10 +435,10 @@ add_subdirectory(gtsam)
add_subdirectory(tests)

# Build examples
-add_subdirectory(examples)
+# add_subdirectory(examples)

# Build timing
-add_subdirectory(timing)
+# add_subdirectory(timing)

# Build gtsam_unstable
if (GTSAM_BUILD_UNSTABLE)
41 changes: 41 additions & 0 deletions recipes/gtsam/unvendor-ceres.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
diff --git a/gtsam/3rdparty/CMakeLists.txt b/gtsam/3rdparty/CMakeLists.txt
index c8fecc339..419100863 100644
--- a/gtsam/3rdparty/CMakeLists.txt
+++ b/gtsam/3rdparty/CMakeLists.txt
@@ -53,7 +53,9 @@ if(GTSAM_SUPPORT_NESTED_DISSECTION)
add_subdirectory(metis)
endif()

-add_subdirectory(ceres)
+# add_subdirectory(ceres)
+find_package(Ceres REQUIRED)
+include_directories(${CERES_INCLUDE_DIRS})

############ NOTE: When updating GeographicLib be sure to disable building their examples
############ and unit tests by commenting out their lines:
diff --git a/gtsam/3rdparty/ceres/example.h b/gtsam/3rdparty/ceres/example.h
index 6b051fce0..a3168fdb4 100644
--- a/gtsam/3rdparty/ceres/example.h
+++ b/gtsam/3rdparty/ceres/example.h
@@ -33,7 +33,7 @@

#pragma once

-#include <gtsam/3rdparty/ceres/rotation.h>
+#include <ceres/rotation.h>

// Templated pinhole camera model for used with Ceres. The camera is
// parameterized using 9 parameters: 3 for rotation, 3 for translation, 1 for
diff --git a/gtsam/nonlinear/AdaptAutoDiff.h b/gtsam/nonlinear/AdaptAutoDiff.h
index 682cca29a..a8ce86dd4 100644
--- a/gtsam/nonlinear/AdaptAutoDiff.h
+++ b/gtsam/nonlinear/AdaptAutoDiff.h
@@ -20,7 +20,7 @@

#include <gtsam/base/VectorSpace.h>
#include <gtsam/base/OptionalJacobian.h>
-#include <gtsam/3rdparty/ceres/autodiff.h>
+#include <ceres/autodiff.h>

#include <boost/static_assert.hpp>
#include <boost/type_traits/is_base_of.hpp>