Skip to content

Commit 468f903

Browse files
authored
Merge pull request #1167 from borglab/release/4.2a6
Finish release 4.2a6
2 parents a74c7dd + fb3f42f commit 468f903

File tree

180 files changed

+12214
-1335
lines changed

Some content is hidden

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

180 files changed

+12214
-1335
lines changed

.github/scripts/unix.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ function configure()
7171
-DGTSAM_USE_SYSTEM_EIGEN=${GTSAM_USE_SYSTEM_EIGEN:-OFF} \
7272
-DGTSAM_USE_SYSTEM_METIS=${GTSAM_USE_SYSTEM_METIS:-OFF} \
7373
-DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF \
74+
-DGTSAM_SINGLE_TEST_EXE=ON \
7475
-DBOOST_ROOT=$BOOST_ROOT \
7576
-DBoost_NO_SYSTEM_PATHS=ON \
7677
-DBoost_ARCHITECTURE=-x64
@@ -95,7 +96,11 @@ function build ()
9596
configure
9697

9798
if [ "$(uname)" == "Linux" ]; then
98-
make -j$(nproc)
99+
if (($(nproc) > 2)); then
100+
make -j$(nproc)
101+
else
102+
make -j2
103+
fi
99104
elif [ "$(uname)" == "Darwin" ]; then
100105
make -j$(sysctl -n hw.physicalcpu)
101106
fi
@@ -113,7 +118,11 @@ function test ()
113118

114119
# Actual testing
115120
if [ "$(uname)" == "Linux" ]; then
116-
make -j$(nproc) check
121+
if (($(nproc) > 2)); then
122+
make -j$(nproc) check
123+
else
124+
make -j2 check
125+
fi
117126
elif [ "$(uname)" == "Darwin" ]; then
118127
make -j$(sysctl -n hw.physicalcpu) check
119128
fi

.github/workflows/build-windows.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ jobs:
4848
- name: Install Dependencies
4949
shell: powershell
5050
run: |
51-
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
51+
iwr -useb get.scoop.sh -outfile 'install_scoop.ps1'
52+
.\install_scoop.ps1 -RunAsAdmin
53+
5254
scoop install cmake --global # So we don't get issues with CMP0074 policy
5355
scoop install ninja --global
5456
@@ -106,6 +108,21 @@ jobs:
106108
cmake --build build -j 4 --config ${{ matrix.build_type }} --target gtsam
107109
cmake --build build -j 4 --config ${{ matrix.build_type }} --target gtsam_unstable
108110
cmake --build build -j 4 --config ${{ matrix.build_type }} --target wrap
111+
112+
# Run GTSAM tests
109113
cmake --build build -j 4 --config ${{ matrix.build_type }} --target check.base
110-
cmake --build build -j 4 --config ${{ matrix.build_type }} --target check.base_unstable
114+
cmake --build build -j 4 --config ${{ matrix.build_type }} --target check.basis
115+
cmake --build build -j 4 --config ${{ matrix.build_type }} --target check.discrete
116+
#cmake --build build -j 4 --config ${{ matrix.build_type }} --target check.geometry
117+
cmake --build build -j 4 --config ${{ matrix.build_type }} --target check.inference
111118
cmake --build build -j 4 --config ${{ matrix.build_type }} --target check.linear
119+
cmake --build build -j 4 --config ${{ matrix.build_type }} --target check.navigation
120+
#cmake --build build -j 4 --config ${{ matrix.build_type }} --target check.nonlinear
121+
#cmake --build build -j 4 --config ${{ matrix.build_type }} --target check.sam
122+
cmake --build build -j 4 --config ${{ matrix.build_type }} --target check.sfm
123+
#cmake --build build -j 4 --config ${{ matrix.build_type }} --target check.slam
124+
cmake --build build -j 4 --config ${{ matrix.build_type }} --target check.symbolic
125+
126+
# Run GTSAM_UNSTABLE tests
127+
#cmake --build build -j 4 --config ${{ matrix.build_type }} --target check.base_unstable
128+

CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
project(GTSAM CXX C)
21
cmake_minimum_required(VERSION 3.0)
32

43
# new feature to Cmake Version > 2.8.12
@@ -11,14 +10,19 @@ endif()
1110
set (GTSAM_VERSION_MAJOR 4)
1211
set (GTSAM_VERSION_MINOR 2)
1312
set (GTSAM_VERSION_PATCH 0)
14-
set (GTSAM_PRERELEASE_VERSION "a5")
13+
set (GTSAM_PRERELEASE_VERSION "a6")
1514
math (EXPR GTSAM_VERSION_NUMERIC "10000 * ${GTSAM_VERSION_MAJOR} + 100 * ${GTSAM_VERSION_MINOR} + ${GTSAM_VERSION_PATCH}")
1615

1716
if (${GTSAM_VERSION_PATCH} EQUAL 0)
1817
set (GTSAM_VERSION_STRING "${GTSAM_VERSION_MAJOR}.${GTSAM_VERSION_MINOR}${GTSAM_PRERELEASE_VERSION}")
1918
else()
2019
set (GTSAM_VERSION_STRING "${GTSAM_VERSION_MAJOR}.${GTSAM_VERSION_MINOR}.${GTSAM_VERSION_PATCH}${GTSAM_PRERELEASE_VERSION}")
2120
endif()
21+
22+
project(GTSAM
23+
LANGUAGES CXX C
24+
VERSION "${GTSAM_VERSION_MAJOR}.${GTSAM_VERSION_MINOR}.${GTSAM_VERSION_PATCH}")
25+
2226
message(STATUS "GTSAM Version: ${GTSAM_VERSION_STRING}")
2327

2428
set (CMAKE_PROJECT_VERSION_MAJOR ${GTSAM_VERSION_MAJOR})

DEVELOP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ For example:
1515
```cpp
1616
class GTSAM_EXPORT MyClass { ... };
1717

18-
GTSAM_EXPORT myFunction();
18+
GTSAM_EXPORT return_type myFunction();
1919
```
2020
2121
More details [here](Using-GTSAM-EXPORT.md).

INSTALL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ $ make install
1313
## Important Installation Notes
1414

1515
1. GTSAM requires the following libraries to be installed on your system:
16-
- BOOST version 1.65 or greater (install through Linux repositories or MacPorts). Please see [Boost Notes](#boost-notes).
16+
- BOOST version 1.65 or greater (install through Linux repositories or MacPorts). Please see [Boost Notes](#boost-notes) for version recommendations based on your compiler.
1717

1818
- Cmake version 3.0 or higher
1919
- Support for XCode 4.3 command line tools on Mac requires CMake 2.8.8 or higher
@@ -72,7 +72,7 @@ execute commands as follows for an out-of-source build:
7272
Versions of Boost prior to 1.65 have a known bug that prevents proper "deep" serialization of objects, which means that objects encapsulated inside other objects don't get serialized.
7373
This is particularly seen when using `clang` as the C++ compiler.
7474

75-
For this reason we require Boost>=1.65, and recommend installing it through alternative channels when it is not available through your operating system's primary package manager.
75+
For this reason we recommend Boost>=1.65, and recommend installing it through alternative channels when it is not available through your operating system's primary package manager.
7676

7777
## Known Issues
7878

Using-GTSAM-EXPORT.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ To create a DLL in windows, the `GTSAM_EXPORT` keyword has been created and need
88
* At least one of the functions inside that class is declared in a .cpp file and not just the .h file.
99
* You can `GTSAM_EXPORT` any class it inherits from as well. (Note that this implictly requires the class does not derive from a "header-only" class. Note that Eigen is a "header-only" library, so if your class derives from Eigen, _do not_ use `GTSAM_EXPORT` in the class definition!)
1010
3. If you have defined a class using `GTSAM_EXPORT`, do not use `GTSAM_EXPORT` in any of its individual function declarations. (Note that you _can_ put `GTSAM_EXPORT` in the definition of individual functions within a class as long as you don't put `GTSAM_EXPORT` in the class definition.)
11+
4. For template specializations, you need to add `GTSAM_EXPORT` to each individual specialization.
1112

1213
## When is GTSAM_EXPORT being used incorrectly
1314
Unfortunately, using `GTSAM_EXPORT` incorrectly often does not cause a compiler or linker error in the library that is being compiled, but only when you try to use that DLL in a different library. For example, an error in `gtsam/base` will often show up when compiling the `check_base_program` or the MATLAB wrapper, but not when compiling/linking gtsam itself. The most common errors will say something like:

cmake/GtsamBuildTypes.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ if(MSVC)
9393
/wd4267 # warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
9494
)
9595

96+
add_compile_options(/wd4005)
97+
add_compile_options(/wd4101)
98+
add_compile_options(/wd4834)
99+
96100
endif()
97101

98102
# Other (non-preprocessor macros) compiler flags:
@@ -187,7 +191,7 @@ endif()
187191

188192
if (NOT MSVC)
189193
option(GTSAM_BUILD_WITH_MARCH_NATIVE "Enable/Disable building with all instructions supported by native architecture (binary may not be portable!)" ON)
190-
if(GTSAM_BUILD_WITH_MARCH_NATIVE)
194+
if(GTSAM_BUILD_WITH_MARCH_NATIVE AND (APPLE AND NOT CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64"))
191195
# Add as public flag so all dependant projects also use it, as required
192196
# by Eigen to avid crashes due to SIMD vectorization:
193197
list_append_cache(GTSAM_COMPILE_OPTIONS_PUBLIC "-march=native")

cmake/HandleMetis.cmake

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ if(GTSAM_USE_SYSTEM_METIS)
2121
mark_as_advanced(METIS_LIBRARY)
2222

2323
add_library(metis-gtsam-if INTERFACE)
24-
target_include_directories(metis-gtsam-if BEFORE INTERFACE ${METIS_INCLUDE_DIR})
24+
target_include_directories(metis-gtsam-if BEFORE INTERFACE ${METIS_INCLUDE_DIR}
25+
# gtsam_unstable/partition/FindSeparator-inl.h uses internal metislib.h API
26+
# via extern "C"
27+
$<BUILD_INTERFACE:${GTSAM_SOURCE_DIR}/gtsam/3rdparty/metis/libmetis>
28+
$<BUILD_INTERFACE:${GTSAM_SOURCE_DIR}/gtsam/3rdparty/metis/GKlib>
29+
)
2530
target_link_libraries(metis-gtsam-if INTERFACE ${METIS_LIBRARY})
2631
endif()
2732
else()
@@ -30,10 +35,12 @@ else()
3035
add_subdirectory(${GTSAM_SOURCE_DIR}/gtsam/3rdparty/metis)
3136

3237
target_include_directories(metis-gtsam BEFORE PUBLIC
38+
$<INSTALL_INTERFACE:include/gtsam/3rdparty/metis/>
3339
$<BUILD_INTERFACE:${GTSAM_SOURCE_DIR}/gtsam/3rdparty/metis/include>
40+
# gtsam_unstable/partition/FindSeparator-inl.h uses internal metislib.h API
41+
# via extern "C"
3442
$<BUILD_INTERFACE:${GTSAM_SOURCE_DIR}/gtsam/3rdparty/metis/libmetis>
3543
$<BUILD_INTERFACE:${GTSAM_SOURCE_DIR}/gtsam/3rdparty/metis/GKlib>
36-
$<INSTALL_INTERFACE:include/gtsam/3rdparty/metis/>
3744
)
3845

3946
add_library(metis-gtsam-if INTERFACE)

doc/Code/LocalizationExample2.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// add unary measurement factors, like GPS, on all three poses
2-
noiseModel::Diagonal::shared_ptr unaryNoise =
2+
auto unaryNoise =
33
noiseModel::Diagonal::Sigmas(Vector2(0.1, 0.1)); // 10cm std on x,y
4-
graph.add(boost::make_shared<UnaryFactor>(1, 0.0, 0.0, unaryNoise));
5-
graph.add(boost::make_shared<UnaryFactor>(2, 2.0, 0.0, unaryNoise));
6-
graph.add(boost::make_shared<UnaryFactor>(3, 4.0, 0.0, unaryNoise));
4+
graph.emplace_shared<UnaryFactor>(1, 0.0, 0.0, unaryNoise);
5+
graph.emplace_shared<UnaryFactor>(2, 2.0, 0.0, unaryNoise);
6+
graph.emplace_shared<UnaryFactor>(3, 4.0, 0.0, unaryNoise);
77

doc/Code/LocalizationFactor.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
class UnaryFactor: public NoiseModelFactor1<Pose2> {
22
double mx_, my_; ///< X and Y measurements
3-
3+
44
public:
55
UnaryFactor(Key j, double x, double y, const SharedNoiseModel& model):
66
NoiseModelFactor1<Pose2>(model, j), mx_(x), my_(y) {}
77

8-
Vector evaluateError(const Pose2& q,
9-
boost::optional<Matrix&> H = boost::none) const
10-
{
8+
Vector evaluateError(const Pose2& q,
9+
boost::optional<Matrix&> H = boost::none) const override {
1110
const Rot2& R = q.rotation();
1211
if (H) (*H) = (gtsam::Matrix(2, 3) <<
1312
R.c(), -R.s(), 0.0,

0 commit comments

Comments
 (0)