Skip to content

Commit a82f191

Browse files
authored
Merge pull request #1431 from borglab/release/4.2a9
2 parents 9902ccc + c57988f commit a82f191

File tree

385 files changed

+9573
-5215
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

385 files changed

+9573
-5215
lines changed

.github/workflows/build-special.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
if: matrix.flag == 'deprecated'
112112
run: |
113113
echo "GTSAM_ALLOW_DEPRECATED_SINCE_V42=ON" >> $GITHUB_ENV
114-
echo "Allow deprecated since version 4.1"
114+
echo "Allow deprecated since version 4.2"
115115
116116
- name: Set Use Quaternions Flag
117117
if: matrix.flag == 'quaternions'

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ endif()
1010
set (GTSAM_VERSION_MAJOR 4)
1111
set (GTSAM_VERSION_MINOR 2)
1212
set (GTSAM_VERSION_PATCH 0)
13-
set (GTSAM_PRERELEASE_VERSION "a8")
13+
set (GTSAM_PRERELEASE_VERSION "a9")
1414
math (EXPR GTSAM_VERSION_NUMERIC "10000 * ${GTSAM_VERSION_MAJOR} + 100 * ${GTSAM_VERSION_MINOR} + ${GTSAM_VERSION_PATCH}")
1515

1616
if (${GTSAM_VERSION_PATCH} EQUAL 0)

README.md

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ In the root library folder execute:
3131

3232
```sh
3333
#!bash
34-
$ mkdir build
35-
$ cd build
36-
$ cmake ..
37-
$ make check (optional, runs unit tests)
38-
$ make install
34+
mkdir build
35+
cd build
36+
cmake ..
37+
make check (optional, runs unit tests)
38+
make install
3939
```
4040

4141
Prerequisites:
@@ -55,9 +55,7 @@ Optional prerequisites - used automatically if findable by CMake:
5555

5656
GTSAM 4 introduces several new features, most notably Expressions and a Python toolbox. It also introduces traits, a C++ technique that allows optimizing with non-GTSAM types. That opens the door to retiring geometric types such as Point2 and Point3 to pure Eigen types, which we also do. A significant change which will not trigger a compile error is that zero-initializing of Point2 and Point3 is deprecated, so please be aware that this might render functions using their default constructor incorrect.
5757

58-
GTSAM 4 also deprecated some legacy functionality and wrongly named methods. If you are on a 4.0.X release, you can define the flag `GTSAM_ALLOW_DEPRECATED_SINCE_V4` to use the deprecated methods.
59-
60-
GTSAM 4.1 added a new pybind wrapper, and **removed** the deprecated functionality. There is a flag `GTSAM_ALLOW_DEPRECATED_SINCE_V42` for newly deprecated methods since the 4.1 release, which is on by default, allowing anyone to just pull version 4.1 and compile.
58+
There is a flag `GTSAM_ALLOW_DEPRECATED_SINCE_V42` for newly deprecated methods since the 4.2 release, which is on by default, allowing anyone to just pull version 4.2 and compile.
6159

6260

6361
## Wrappers
@@ -68,24 +66,39 @@ We provide support for [MATLAB](matlab/README.md) and [Python](python/README.md)
6866

6967
If you are using GTSAM for academic work, please use the following citation:
7068

71-
```
69+
```bibtex
7270
@software{gtsam,
73-
author = {Frank Dellaert and Richard Roberts and Varun Agrawal and Alex Cunningham and Chris Beall and Duy-Nguyen Ta and Fan Jiang and lucacarlone and nikai and Jose Luis Blanco-Claraco and Stephen Williams and ydjian and John Lambert and Andy Melim and Zhaoyang Lv and Akshay Krishnan and Jing Dong and Gerry Chen and Krunal Chande and balderdash-devil and DiffDecisionTrees and Sungtae An and mpaluri and Ellon Paiva Mendes and Mike Bosse and Akash Patel and Ayush Baid and Paul Furgale and matthewbroadwaynavenio and roderick-koehle},
71+
author = {Frank Dellaert and GTSAM Contributors},
7472
title = {borglab/gtsam},
75-
month = may,
73+
month = May,
7674
year = 2022,
77-
publisher = {Zenodo},
78-
version = {4.2a7},
75+
publisher = {Georgia Tech Borg Lab},
76+
version = {4.2a8},
7977
doi = {10.5281/zenodo.5794541},
80-
url = {https://doi.org/10.5281/zenodo.5794541}
78+
url = {https://github.com/borglab/gtsam)}}
8179
}
8280
```
8381

84-
You can also get the latest citation available from Zenodo below:
82+
To cite the `Factor Graphs for Robot Perception` book, please use:
83+
```bibtex
84+
@book{factor_graphs_for_robot_perception,
85+
author={Frank Dellaert and Michael Kaess},
86+
year={2017},
87+
title={Factor Graphs for Robot Perception},
88+
publisher={Foundations and Trends in Robotics, Vol. 6},
89+
url={http://www.cs.cmu.edu/~kaess/pub/Dellaert17fnt.pdf}
90+
}
91+
```
8592

86-
[![DOI](https://zenodo.org/badge/86362856.svg)](https://doi.org/10.5281/zenodo.5794541)
93+
If you are using the IMU preintegration scheme, please cite:
94+
```bibtex
95+
@book{imu_preintegration,
96+
author={Christian Forster and Luca Carlone and Frank Dellaert and Davide Scaramuzza},
97+
title={IMU preintegration on Manifold for Efficient Visual-Inertial Maximum-a-Posteriori Estimation},
98+
year={2015}
99+
}
100+
```
87101

88-
Specific formats are available in the bottom-right corner of the Zenodo page.
89102

90103
## The Preintegrated IMU Factor
91104

cmake/GtsamBuildTypes.cmake

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
include(CheckCXXCompilerFlag) # for check_cxx_compiler_flag()
22

3-
# Set cmake policy to recognize the AppleClang compiler
3+
# Set cmake policy to recognize the Apple Clang compiler
44
# independently from the Clang compiler.
55
if(POLICY CMP0025)
66
cmake_policy(SET CMP0025 NEW)
@@ -87,10 +87,10 @@ if(MSVC)
8787
list_append_cache(GTSAM_COMPILE_DEFINITIONS_PRIVATE
8888
WINDOWS_LEAN_AND_MEAN
8989
NOMINMAX
90-
)
90+
)
9191
# Avoid literally hundreds to thousands of warnings:
9292
list_append_cache(GTSAM_COMPILE_OPTIONS_PUBLIC
93-
/wd4267 # warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
93+
/wd4267 # warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
9494
)
9595

9696
add_compile_options(/wd4005)
@@ -183,19 +183,43 @@ set(CMAKE_EXE_LINKER_FLAGS_PROFILING ${GTSAM_CMAKE_EXE_LINKER_FLAGS_PROFILING})
183183

184184
# Clang uses a template depth that is less than standard and is too small
185185
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
186-
# Apple Clang before 5.0 does not support -ftemplate-depth.
187-
if(NOT (APPLE AND "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "5.0"))
188-
list_append_cache(GTSAM_COMPILE_OPTIONS_PUBLIC "-ftemplate-depth=1024")
189-
endif()
186+
# Apple Clang before 5.0 does not support -ftemplate-depth.
187+
if(NOT (APPLE AND "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "5.0"))
188+
list_append_cache(GTSAM_COMPILE_OPTIONS_PUBLIC "-ftemplate-depth=1024")
189+
endif()
190190
endif()
191191

192192
if (NOT MSVC)
193193
option(GTSAM_BUILD_WITH_MARCH_NATIVE "Enable/Disable building with all instructions supported by native architecture (binary may not be portable!)" OFF)
194-
if(GTSAM_BUILD_WITH_MARCH_NATIVE AND (APPLE AND NOT CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64"))
195-
# Add as public flag so all dependant projects also use it, as required
196-
# by Eigen to avid crashes due to SIMD vectorization:
197-
list_append_cache(GTSAM_COMPILE_OPTIONS_PUBLIC "-march=native")
198-
endif()
194+
if(GTSAM_BUILD_WITH_MARCH_NATIVE)
195+
# Check if Apple OS and compiler is [Apple]Clang
196+
if(APPLE AND (${CMAKE_CXX_COMPILER_ID} MATCHES "^(Apple)?Clang$"))
197+
# Check Clang version since march=native is only supported for version 15.0+.
198+
if("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "15.0")
199+
if(NOT CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
200+
# Add as public flag so all dependent projects also use it, as required
201+
# by Eigen to avoid crashes due to SIMD vectorization:
202+
list_append_cache(GTSAM_COMPILE_OPTIONS_PUBLIC "-march=native")
203+
else()
204+
message(WARNING "Option GTSAM_BUILD_WITH_MARCH_NATIVE ignored, because native architecture is not supported for Apple silicon and AppleClang version < 15.0.")
205+
endif() # CMAKE_SYSTEM_PROCESSOR
206+
else()
207+
# Add as public flag so all dependent projects also use it, as required
208+
# by Eigen to avoid crashes due to SIMD vectorization:
209+
list_append_cache(GTSAM_COMPILE_OPTIONS_PUBLIC "-march=native")
210+
endif() # CMAKE_CXX_COMPILER_VERSION
211+
else()
212+
include(CheckCXXCompilerFlag)
213+
CHECK_CXX_COMPILER_FLAG("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE)
214+
if(COMPILER_SUPPORTS_MARCH_NATIVE)
215+
# Add as public flag so all dependent projects also use it, as required
216+
# by Eigen to avoid crashes due to SIMD vectorization:
217+
list_append_cache(GTSAM_COMPILE_OPTIONS_PUBLIC "-march=native")
218+
else()
219+
message(WARNING "Option GTSAM_BUILD_WITH_MARCH_NATIVE ignored, because native architecture is not supported.")
220+
endif() # COMPILER_SUPPORTS_MARCH_NATIVE
221+
endif() # APPLE
222+
endif() # GTSAM_BUILD_WITH_MARCH_NATIVE
199223
endif()
200224

201225
# Set up build type library postfixes

cmake/GtsamPrinting.cmake

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,10 @@ function(print_build_options_for_target target_name_)
5151
# print_padded(GTSAM_COMPILE_DEFINITIONS_PRIVATE)
5252
print_padded(GTSAM_COMPILE_DEFINITIONS_PUBLIC)
5353

54-
foreach(build_type ${GTSAM_CMAKE_CONFIGURATION_TYPES})
55-
string(TOUPPER "${build_type}" build_type_toupper)
56-
# print_padded(GTSAM_COMPILE_OPTIONS_PRIVATE_${build_type_toupper})
57-
print_padded(GTSAM_COMPILE_OPTIONS_PUBLIC_${build_type_toupper})
58-
# print_padded(GTSAM_COMPILE_DEFINITIONS_PRIVATE_${build_type_toupper})
59-
print_padded(GTSAM_COMPILE_DEFINITIONS_PUBLIC_${build_type_toupper})
60-
endforeach()
54+
string(TOUPPER "${CMAKE_BUILD_TYPE}" build_type_toupper)
55+
# print_padded(GTSAM_COMPILE_OPTIONS_PRIVATE_${build_type_toupper})
56+
print_padded(GTSAM_COMPILE_OPTIONS_PUBLIC_${build_type_toupper})
57+
# print_padded(GTSAM_COMPILE_DEFINITIONS_PRIVATE_${build_type_toupper})
58+
print_padded(GTSAM_COMPILE_DEFINITIONS_PUBLIC_${build_type_toupper})
59+
6160
endfunction()

cmake/HandleGeneralOptions.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ option(GTSAM_WITH_EIGEN_MKL_OPENMP "Eigen, when using Intel MKL, will a
2525
option(GTSAM_THROW_CHEIRALITY_EXCEPTION "Throw exception when a triangulated point is behind a camera" ON)
2626
option(GTSAM_BUILD_PYTHON "Enable/Disable building & installation of Python module with pybind11" OFF)
2727
option(GTSAM_INSTALL_MATLAB_TOOLBOX "Enable/Disable installation of matlab toolbox" OFF)
28-
option(GTSAM_ALLOW_DEPRECATED_SINCE_V42 "Allow use of methods/functions deprecated in GTSAM 4.1" ON)
28+
option(GTSAM_ALLOW_DEPRECATED_SINCE_V42 "Allow use of methods/functions deprecated in GTSAM 4.2" ON)
2929
option(GTSAM_SUPPORT_NESTED_DISSECTION "Support Metis-based nested dissection" ON)
3030
option(GTSAM_TANGENT_PREINTEGRATION "Use new ImuFactor with integration on tangent space" ON)
3131
option(GTSAM_SLOW_BUT_CORRECT_BETWEENFACTOR "Use the slower but correct version of BetweenFactor" OFF)

cmake/HandlePrintConfiguration.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ print_enabled_config(${GTSAM_USE_QUATERNIONS} "Quaternions as defaul
8787
print_enabled_config(${GTSAM_ENABLE_CONSISTENCY_CHECKS} "Runtime consistency checking ")
8888
print_enabled_config(${GTSAM_ROT3_EXPMAP} "Rot3 retract is full ExpMap ")
8989
print_enabled_config(${GTSAM_POSE3_EXPMAP} "Pose3 retract is full ExpMap ")
90-
print_enabled_config(${GTSAM_ALLOW_DEPRECATED_SINCE_V42} "Allow features deprecated in GTSAM 4.1")
90+
print_enabled_config(${GTSAM_ALLOW_DEPRECATED_SINCE_V42} "Allow features deprecated in GTSAM 4.2")
9191
print_enabled_config(${GTSAM_SUPPORT_NESTED_DISSECTION} "Metis-based Nested Dissection ")
9292
print_enabled_config(${GTSAM_TANGENT_PREINTEGRATION} "Use tangent-space preintegration")
9393

cmake/HandleTBB.cmake

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ if (GTSAM_WITH_TBB)
77
if(TBB_FOUND)
88
set(GTSAM_USE_TBB 1) # This will go into config.h
99

10-
# if ((${TBB_VERSION} VERSION_GREATER "2021.1") OR (${TBB_VERSION} VERSION_EQUAL "2021.1"))
11-
# message(FATAL_ERROR "TBB version greater than 2021.1 (oneTBB API) is not yet supported. Use an older version instead.")
12-
# endif()
13-
1410
if ((${TBB_VERSION_MAJOR} GREATER 2020) OR (${TBB_VERSION_MAJOR} EQUAL 2020))
1511
set(TBB_GREATER_EQUAL_2020 1)
1612
else()

0 commit comments

Comments
 (0)