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

add gtsam #14339

Closed
wants to merge 6 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
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
48 changes: 48 additions & 0 deletions recipes/gtsam/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{% 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

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

requirements:
build:
- '{{ compiler("c") }}'
- '{{ compiler("cxx") }}'
- ninja
- cmake
host:
- boost-cpp 1.76
- 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
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>
47 changes: 0 additions & 47 deletions recipes/vadersentiment/meta.yaml

This file was deleted.