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 - take 3 #17997

Merged
merged 30 commits into from
Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
42c311d
add gtsam
wolfv Mar 22, 2021
0c7c98d
remove recipe.yaml
wolfv Mar 22, 2021
6a712d0
add win build
wolfv Mar 22, 2021
5878e51
add cmake
wolfv Mar 22, 2021
9753713
add boost 174 patch
wolfv Mar 22, 2021
8e0f8c5
Merge branch 'gtsam' of github.com:wolfv/staged-recipes into gtsam_4.…
ameysutavani Mar 24, 2021
087dd1e
Testing boost174 patch changes; new lines at EOF
ameysutavani Mar 24, 2021
0aff859
testing original patch
ameysutavani Mar 24, 2021
eadcde7
Update meta.yaml
ameysutavani Jul 9, 2021
db213d0
Testing gtsam 4.0.3 with boost 1.7.6
ameysutavani Jul 9, 2021
b452aa7
Updated correct BSD SPDIX identifier
ameysutavani Jul 9, 2021
a00832c
Pinned boost-cpp to 1.76.0
ameysutavani Jul 9, 2021
a7dd3bc
Fix ceres autodiff
ameysutavani Jul 9, 2021
32dea6c
Test disabling ceres unvendor
ameysutavani Jul 9, 2021
b3038d7
try again with gtsam 4.1.1
wolfv Jan 25, 2022
b33dc40
add TobiasFischers suggetions
wolfv Jan 26, 2022
e2db91c
remove mkl, add python to run
wolfv Jan 26, 2022
32e7a34
add python hints for cmake
wolfv Feb 9, 2022
6d7c69e
Add missing boost-cpp run dep
Tobias-Fischer Feb 10, 2022
f8dcf76
Add tests
Tobias-Fischer Feb 10, 2022
d0b8bd7
Try fix osx issues finding system python
Tobias-Fischer Feb 10, 2022
f994582
Update bld.bat
Tobias-Fischer Feb 10, 2022
6ed2162
Do not use boost static libs on Win
Tobias-Fischer Feb 10, 2022
f609658
Last boost fix attempt for Win
Tobias-Fischer Feb 11, 2022
c8ae504
Update bld.bat
Tobias-Fischer Feb 11, 2022
51a8b58
Update meta.yaml
Tobias-Fischer Feb 11, 2022
d0bf8b7
Hopefully fix Python
Tobias-Fischer Feb 11, 2022
97a6139
Update bld.bat
Tobias-Fischer Feb 11, 2022
7d2cb8b
It's getting ridiculous
Tobias-Fischer Feb 11, 2022
a9a553f
Update bld.bat
Tobias-Fischer Feb 11, 2022
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
20 changes: 20 additions & 0 deletions recipes/gtsam/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
mkdir build
cd build

cmake ^
-GNinja ^
-DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF ^
-DGTSAM_USE_SYSTEM_EIGEN=ON ^
-DGTSAM_INSTALL_CPPUNITLITE=OFF ^
-DGTSAM_BUILD_PYTHON=ON ^
-DBoost_USE_STATIC_LIBS=OFF ^
-DBOOST_ROOT="%LIBRARY_PREFIX%" ^
-DBoost_NO_SYSTEM_PATHS=ON ^
-DPython3_EXECUTABLE=%PYTHON% ^
-DPython_EXECUTABLE=%PYTHON% ^
-DPYTHON_EXECUTABLE=%PYTHON% ^
%SRC_DIR%

ninja install

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

cmake .. ${CMAKE_ARGS} \
-GNinja \
-DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF \
-DGTSAM_USE_SYSTEM_EIGEN=ON \
-DGTSAM_INSTALL_CPPUNITLITE=OFF \
-DGTSAM_BUILD_PYTHON=ON \
-DPython3_EXECUTABLE=$PYTHON \
-DPython_EXECUTABLE=$PYTHON \
-DPYTHON_EXECUTABLE=$PYTHON

ninja install

ninja check
36 changes: 36 additions & 0 deletions recipes/gtsam/fix-boost.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
diff --git a/gtsam/base/serialization.h b/gtsam/base/serialization.h
index 24355c684..e615afe83 100644
--- a/gtsam/base/serialization.h
+++ b/gtsam/base/serialization.h
@@ -25,6 +25,7 @@
#include <string>

// includes for standard serialization types
+#include <boost/serialization/version.hpp>
#include <boost/serialization/optional.hpp>
#include <boost/serialization/shared_ptr.hpp>
#include <boost/serialization/vector.hpp>
diff --git a/gtsam/linear/NoiseModel.h b/gtsam/linear/NoiseModel.h
index 54b9d955f..a737c5cc8 100644
--- a/gtsam/linear/NoiseModel.h
+++ b/gtsam/linear/NoiseModel.h
@@ -27,6 +27,7 @@
#include <boost/serialization/extended_type_info.hpp>
#include <boost/serialization/singleton.hpp>
#include <boost/serialization/shared_ptr.hpp>
+#include <boost/serialization/version.hpp>
#include <boost/serialization/optional.hpp>

namespace gtsam {
diff --git a/gtsam/slam/SmartFactorBase.h b/gtsam/slam/SmartFactorBase.h
index ddf56b289..f128bd124 100644
--- a/gtsam/slam/SmartFactorBase.h
+++ b/gtsam/slam/SmartFactorBase.h
@@ -30,6 +30,7 @@
#include <gtsam/geometry/CameraSet.h>

#include <boost/optional.hpp>
+#include <boost/serialization/version.hpp>
#include <boost/serialization/optional.hpp>
#include <boost/make_shared.hpp>
#include <vector>
70 changes: 70 additions & 0 deletions recipes/gtsam/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{% set name = "gtsam" %}
{% set version = "4.1.1" %}

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

source:
url: https://github.com/borglab/gtsam/archive/refs/tags/{{ version }}.tar.gz
sha256: c7b5e6cdad52b141c272778f47baf628975457be3e26ed96a7bc2ae685a00af0
patches:
- nobuild-examples-timing.patch
- fix-boost.patch
build:
number: 0
skip: True # [win]
run_exports:
- '{{ pin_subpackage(name, max_pin="x.x") }}'

requirements:
build:
- '{{ compiler("c") }}'
- '{{ compiler("cxx") }}'
- ninja
- cmake
- pybind11 # [build_platform != target_platform]
- numpy # [build_platform != target_platform]
- python # [build_platform != target_platform]
host:
- python
- boost-cpp
- eigen
- geographiclib-cpp
- metis
- suitesparse
- tbb
- tbb-devel
- pybind11
- pyparsing
- numpy
run:
- python
- pyparsing
- numpy
- boost-cpp

test:
commands:
- test -f ${PREFIX}/lib/libgtsam${SHLIB_EXT} # [not win]
- test -f ${PREFIX}/lib/cmake/gtwrap/gtwrapConfig.cmake # [not win]
- test -f ${PREFIX}/lib/cmake/GTSAM/GTSAMConfig.cmake # [not win]
- test -f ${PREFIX}/include/gtsam/base/types.h # [not win]
- if exist %PREFIX%\\Library\\include\\gtsam\\base\\types.h (exit 0) else (exit 1) # [win]
- if exist $PREFIX$\\Library\\lib\\gtsam.lib (exit 0) else (exit 1) # [win]
- if exist $PREFIX$\\Library\\bin\\gtsam.dll (exit 0) else (exit 1) # [win]


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-3-Clause
license_file:
- LICENSE
- LICENSE.BSD

extra:
recipe-maintainers:
- wolfv
- ameysutavani
- TobiasFischer
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/internal/autodiff.h>

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