-
Notifications
You must be signed in to change notification settings - Fork 795
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/between-factor-cmake-flag
- Loading branch information
Showing
47 changed files
with
623 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
############################################################################### | ||
# Metis library | ||
|
||
# For both system or bundle version, a cmake target "metis-gtsam-if" is defined (interface library) | ||
|
||
# Dont try to use metis if GTSAM_SUPPORT_NESTED_DISSECTION is disabled: | ||
if (NOT GTSAM_SUPPORT_NESTED_DISSECTION) | ||
return() | ||
endif() | ||
|
||
option(GTSAM_USE_SYSTEM_METIS "Find and use system-installed libmetis. If 'off', use the one bundled with GTSAM" OFF) | ||
|
||
if(GTSAM_USE_SYSTEM_METIS) | ||
# Debian package: libmetis-dev | ||
|
||
find_path(METIS_INCLUDE_DIR metis.h REQUIRED) | ||
find_library(METIS_LIBRARY metis REQUIRED) | ||
|
||
if(METIS_INCLUDE_DIR AND METIS_LIBRARY) | ||
mark_as_advanced(METIS_INCLUDE_DIR) | ||
mark_as_advanced(METIS_LIBRARY) | ||
|
||
add_library(metis-gtsam-if INTERFACE) | ||
target_include_directories(metis-gtsam-if BEFORE INTERFACE ${METIS_INCLUDE_DIR}) | ||
target_link_libraries(metis-gtsam-if INTERFACE ${METIS_LIBRARY}) | ||
endif() | ||
else() | ||
# Bundled version: | ||
option(GTSAM_BUILD_METIS_EXECUTABLES "Build metis library executables" OFF) | ||
add_subdirectory(${GTSAM_SOURCE_DIR}/gtsam/3rdparty/metis) | ||
|
||
target_include_directories(metis-gtsam BEFORE PUBLIC | ||
$<BUILD_INTERFACE:${GTSAM_SOURCE_DIR}/gtsam/3rdparty/metis/include> | ||
$<BUILD_INTERFACE:${GTSAM_SOURCE_DIR}/gtsam/3rdparty/metis/libmetis> | ||
$<BUILD_INTERFACE:${GTSAM_SOURCE_DIR}/gtsam/3rdparty/metis/GKlib> | ||
$<INSTALL_INTERFACE:include/gtsam/3rdparty/metis/> | ||
) | ||
|
||
add_library(metis-gtsam-if INTERFACE) | ||
target_link_libraries(metis-gtsam-if INTERFACE metis-gtsam) | ||
endif() | ||
|
||
list(APPEND GTSAM_EXPORTED_TARGETS metis-gtsam-if) | ||
install(TARGETS metis-gtsam-if EXPORT GTSAM-exports ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,32 @@ | ||
############################################################################### | ||
# Find TBB | ||
find_package(TBB 4.4 COMPONENTS tbb tbbmalloc) | ||
if (GTSAM_WITH_TBB) | ||
# Find TBB | ||
find_package(TBB 4.4 COMPONENTS tbb tbbmalloc) | ||
|
||
# Set up variables if we're using TBB | ||
if(TBB_FOUND AND GTSAM_WITH_TBB) | ||
set(GTSAM_USE_TBB 1) # This will go into config.h | ||
if ((${TBB_VERSION_MAJOR} GREATER 2020) OR (${TBB_VERSION_MAJOR} EQUAL 2020)) | ||
set(TBB_GREATER_EQUAL_2020 1) | ||
# Set up variables if we're using TBB | ||
if(TBB_FOUND) | ||
set(GTSAM_USE_TBB 1) # This will go into config.h | ||
|
||
if ((${TBB_VERSION} VERSION_GREATER "2021.1") OR (${TBB_VERSION} VERSION_EQUAL "2021.1")) | ||
message(FATAL_ERROR "TBB version greater than 2021.1 (oneTBB API) is not yet supported. Use an older version instead.") | ||
endif() | ||
|
||
if ((${TBB_VERSION_MAJOR} GREATER 2020) OR (${TBB_VERSION_MAJOR} EQUAL 2020)) | ||
set(TBB_GREATER_EQUAL_2020 1) | ||
else() | ||
set(TBB_GREATER_EQUAL_2020 0) | ||
endif() | ||
# all definitions and link requisites will go via imported targets: | ||
# tbb & tbbmalloc | ||
list(APPEND GTSAM_ADDITIONAL_LIBRARIES tbb tbbmalloc) | ||
else() | ||
set(TBB_GREATER_EQUAL_2020 0) | ||
set(GTSAM_USE_TBB 0) # This will go into config.h | ||
endif() | ||
|
||
############################################################################### | ||
# Prohibit Timing build mode in combination with TBB | ||
if(GTSAM_USE_TBB AND (CMAKE_BUILD_TYPE STREQUAL "Timing")) | ||
message(FATAL_ERROR "Timing build mode cannot be used together with TBB. Use a sampling profiler such as Instruments or Intel VTune Amplifier instead.") | ||
endif() | ||
# all definitions and link requisites will go via imported targets: | ||
# tbb & tbbmalloc | ||
list(APPEND GTSAM_ADDITIONAL_LIBRARIES tbb tbbmalloc) | ||
else() | ||
set(GTSAM_USE_TBB 0) # This will go into config.h | ||
endif() | ||
|
||
############################################################################### | ||
# Prohibit Timing build mode in combination with TBB | ||
if(GTSAM_USE_TBB AND (CMAKE_BUILD_TYPE STREQUAL "Timing")) | ||
message(FATAL_ERROR "Timing build mode cannot be used together with TBB. Use a sampling profiler such as Instruments or Intel VTune Amplifier instead.") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,63 @@ | ||
# Instructions | ||
|
||
Build all docker images, in order: | ||
# Images on Docker Hub | ||
|
||
There are 4 images available on https://hub.docker.com/orgs/borglab/repositories: | ||
|
||
- `borglab/ubuntu-boost-tbb`: 18.06 Linux (nicknamed `bionic`) base image, with Boost and TBB installed. | ||
- `borglab/ubuntu-gtsam`: GTSAM Release version installed in `/usr/local`. | ||
- `borglab/ubuntu-gtsam-python`: installed GTSAM with python wrapper. | ||
- `borglab/ubuntu-gtsam-python-vnc`: image with GTSAM+python wrapper that will run a VNC server to connect to. | ||
|
||
# Using the images | ||
|
||
## Just GTSAM | ||
|
||
To start the Docker image, execute | ||
```bash | ||
(cd ubuntu-boost-tbb && ./build.sh) | ||
(cd ubuntu-gtsam && ./build.sh) | ||
(cd ubuntu-gtsam-python && ./build.sh) | ||
(cd ubuntu-gtsam-python-vnc && ./build.sh) | ||
docker run -it borglab/ubuntu-gtsam:bionic | ||
``` | ||
after you will find yourself in a bash shell, in the directory `/usr/src/gtsam/build`. | ||
## GTSAM with Python wrapper | ||
|
||
Then launch with: | ||
To use GTSAM via the python wrapper, similarly execute | ||
```bash | ||
docker run -it borglab/ubuntu-gtsam-python:bionic | ||
``` | ||
and then launch `python3`: | ||
```bash | ||
python3 | ||
>>> import gtsam | ||
>>> gtsam.Pose2(1,2,3) | ||
(1, 2, 3) | ||
``` | ||
|
||
docker run -p 5900:5900 dellaert/ubuntu-gtsam-python-vnc:bionic | ||
## GTSAM with Python wrapper and VNC | ||
|
||
First, start the docker image, which will run a VNC server on port 5900: | ||
```bash | ||
docker run -p 5900:5900 borglab/ubuntu-gtsam-python-vnc:bionic | ||
``` | ||
|
||
Then open a remote VNC X client, for example: | ||
|
||
sudo apt-get install tigervnc-viewer | ||
xtigervncviewer :5900 | ||
### Linux | ||
```bash | ||
sudo apt-get install tigervnc-viewer | ||
xtigervncviewer :5900 | ||
``` | ||
### Mac | ||
The Finder's "Connect to Server..." with `vnc://127.0.0.1` does not work, for some reason. Using the free [VNC Viewer](https://www.realvnc.com/en/connect/download/viewer/), enter `0.0.0.0:5900` as the server. | ||
|
||
# Re-building the images locally | ||
|
||
To build all docker images, in order: | ||
|
||
```bash | ||
(cd ubuntu-boost-tbb && ./build.sh) | ||
(cd ubuntu-gtsam && ./build.sh) | ||
(cd ubuntu-gtsam-python && ./build.sh) | ||
(cd ubuntu-gtsam-python-vnc && ./build.sh) | ||
``` | ||
|
||
Note: building GTSAM can take a lot of memory because of the heavy templating. It is advisable to give Docker enough resources, e.g., 8GB, to avoid OOM errors while compiling. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Build command for Docker image | ||
# TODO(dellaert): use docker compose and/or cmake | ||
docker build --no-cache -t dellaert/ubuntu-boost-tbb:bionic . | ||
docker build --no-cache -t borglab/ubuntu-boost-tbb:bionic . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Build command for Docker image | ||
# TODO(dellaert): use docker compose and/or cmake | ||
# Needs to be run in docker/ubuntu-gtsam-python-vnc directory | ||
docker build -t dellaert/ubuntu-gtsam-python-vnc:bionic . | ||
docker build -t borglab/ubuntu-gtsam-python-vnc:bionic . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Build command for Docker image | ||
# TODO(dellaert): use docker compose and/or cmake | ||
docker build --no-cache -t dellaert/ubuntu-gtsam-python:bionic . | ||
docker build --no-cache -t borglab/ubuntu-gtsam-python:bionic . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Build command for Docker image | ||
# TODO(dellaert): use docker compose and/or cmake | ||
docker build --no-cache -t dellaert/ubuntu-gtsam:bionic . | ||
docker build --no-cache -t borglab/ubuntu-gtsam:bionic . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.