Skip to content

Commit 9ebe7d6

Browse files
authored
Merge pull request borglab#2253 from nebudev14/remove-geographic-lib
Remove GeographicLib as a 3rd party vendor
2 parents 70a601d + 9455e15 commit 9ebe7d6

File tree

790 files changed

+450
-213444
lines changed

Some content is hidden

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

790 files changed

+450
-213444
lines changed

.github/scripts/unix.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ function configure()
5555
-DGTSAM_USE_BOOST_FEATURES=${GTSAM_USE_BOOST_FEATURES:-OFF} \
5656
-DGTSAM_ENABLE_BOOST_SERIALIZATION=${GTSAM_ENABLE_BOOST_SERIALIZATION:-OFF} \
5757
-DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF \
58-
-DGTSAM_SINGLE_TEST_EXE=${GTSAM_SINGLE_TEST_EXE:-OFF}
58+
-DGTSAM_SINGLE_TEST_EXE=${GTSAM_SINGLE_TEST_EXE:-OFF} \
59+
-DGTSAM_ENABLE_GEOGRAPHICLIB=${GTSAM_ENABLE_GEOGRAPHICLIB:-OFF}
5960
}
6061

6162

.github/workflows/build-linux.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737
ubuntu-24.04-gcc-14,
3838
ubuntu-24.04-clang-16,
3939
ubuntu-24.04-clang-16-boost,
40+
ubuntu-24.04-clang-16-geographiclib,
4041
]
4142

4243
build_type: [Debug, Release]
@@ -66,9 +67,17 @@ jobs:
6667
os: ubuntu-24.04
6768
compiler: clang
6869
version: "16"
70+
71+
- name: ubuntu-24.04-clang-16-geographiclib
72+
os: ubuntu-24.04
73+
compiler: clang
74+
version: "16"
75+
6976
exclude:
7077
- name: ubuntu-24.04-clang-16-boost
7178
build_type: Debug
79+
- name: ubuntu-24.04-clang-16-geographiclib
80+
build_type: Debug
7281

7382
steps:
7483
- name: Checkout
@@ -108,6 +117,12 @@ jobs:
108117
echo "GTSAM_USE_BOOST_FEATURES=ON" >> $GITHUB_ENV
109118
echo "GTSAM_ENABLE_BOOST_SERIALIZATION=ON" >> $GITHUB_ENV
110119
120+
- name: Install GeographicLib (Conditional)
121+
if: contains(matrix.name, 'geographiclib') && matrix.build_type == 'Release'
122+
run: |
123+
sudo apt-get -y install libgeographiclib-dev
124+
echo "GTSAM_ENABLE_GEOGRAPHICLIB=ON" >> $GITHUB_ENV
125+
111126
- name: Build and Test
112127
run: |
113128
# Set linker flags based on compiler

.github/workflows/build-macos.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
macos-13-xcode-14.2,
3434
macos-14-xcode-15.4,
3535
macos-14-xcode-15.4-boost,
36+
macos-14-xcode-15.4-geographiclib,
3637
]
3738

3839
build_type: [Debug, Release]
@@ -53,9 +54,16 @@ jobs:
5354
compiler: xcode
5455
version: "15.4"
5556

57+
- name: macos-14-xcode-15.4-geographiclib
58+
os: macos-14
59+
compiler: xcode
60+
version: "15.4"
61+
5662
exclude:
5763
- name: macos-14-xcode-15.4-boost
5864
build_type: Debug
65+
- name: macos-14-xcode-15.4-geographiclib
66+
build_type: Debug
5967

6068
steps:
6169
- name: Checkout
@@ -76,5 +84,11 @@ jobs:
7684
echo "GTSAM_USE_BOOST_FEATURES=ON" >> $GITHUB_ENV
7785
echo "GTSAM_ENABLE_BOOST_SERIALIZATION=ON" >> $GITHUB_ENV
7886
87+
- name: Install GeographicLib
88+
if: contains(matrix.name, 'geographiclib') && matrix.build_type == 'Release'
89+
run: |
90+
brew upgrade geographiclib --quiet || brew install geographiclib --quiet
91+
echo "GTSAM_ENABLE_GEOGRAPHICLIB=ON" >> $GITHUB_ENV
92+
7993
- name: Build and Test
8094
run: bash .github/scripts/unix.sh -t

CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,15 @@ include(cmake/HandleBoost.cmake)
107107
endif()
108108
######################################################################
109109

110+
# ############## Decide on GeographicLib ######################################
111+
# Enable or disable GeographicLib integration with GTSAM_ENABLE_GEOGRAPHICLIB
112+
option(GTSAM_ENABLE_GEOGRAPHICLIB "Enable Features that use GeographicLib" OFF)
113+
114+
if (GTSAM_ENABLE_GEOGRAPHICLIB)
115+
include(cmake/HandleGeographicLib.cmake)
116+
endif()
117+
# ##############################################################################
118+
110119
# Other Libraries:
111120
include(cmake/HandleCCache.cmake) # ccache
112121
include(cmake/HandleCPack.cmake) # CPack
@@ -200,4 +209,4 @@ include(cmake/HandlePrintConfiguration.cmake)
200209
include(cmake/HandleFinalChecks.cmake)
201210

202211
# Include CPack *after* all flags
203-
include(CPack)
212+
include(CPack)

LICENSE

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
GTSAM is released under the simplified BSD license, reproduced in the file
1+
GTSAM is released under the simplified BSD license, reproduced in the file
22
LICENSE.BSD in this directory.
33

44
GTSAM contains several third party libraries, with documentation of licensing
@@ -14,11 +14,8 @@ ordering library
1414
- Includes only auto-diff/jet code, with minor modifications to includes
1515
- http://ceres-solver.org/license.html
1616
- Eigen 3.3.7: General C++ matrix and linear algebra library
17-
- Licenced under MPL2, provided in gtsam/3rdparty/Eigen/COPYING.README
17+
- Licenced under MPL2, provided in gtsam/3rdparty/Eigen/COPYING.README
1818
- Some code that is 3rd-party to Eigen is BSD and LGPL
19-
- GeographicLib 1.35: Charles Karney's geographic conversion utility library
20-
- Included unmodified in gtsam/3rdparty/GeographicLib
21-
- Licenced under MIT, provided in gtsam/3rdparty/GeographicLib/LICENSE.txt
2219
- METIS 5.1.0: Graph partitioning and fill-reducing matrix ordering library
2320
- Included unmodified in gtsam/3rdparty/metis
2421
- Licenced under Apache License v 2.0, provided in

cmake/HandleGeographicLib.cmake

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
find_package(GeographicLib QUIET CONFIG)
2+
3+
if(NOT GeographicLib_FOUND)
4+
find_package(GeographicLib QUIET MODULE)
5+
endif()
6+
7+
if(NOT GeographicLib_FOUND)
8+
find_path(GeographicLib_INCLUDE_DIR
9+
NAMES GeographicLib/Config.h
10+
PATH_SUFFIXES include
11+
)
12+
find_library(GeographicLib_LIBRARY
13+
NAMES Geographic GeographicLib
14+
PATH_SUFFIXES lib lib64
15+
)
16+
17+
include(FindPackageHandleStandardArgs)
18+
find_package_handle_standard_args(GeographicLib
19+
REQUIRED_VARS GeographicLib_INCLUDE_DIR GeographicLib_LIBRARY
20+
)
21+
22+
if(GeographicLib_FOUND AND NOT TARGET GeographicLib::GeographicLib)
23+
add_library(GeographicLib::GeographicLib UNKNOWN IMPORTED)
24+
set_target_properties(GeographicLib::GeographicLib PROPERTIES
25+
IMPORTED_LOCATION "${GeographicLib_LIBRARY}"
26+
INTERFACE_INCLUDE_DIRECTORIES "${GeographicLib_INCLUDE_DIR}"
27+
)
28+
endif()
29+
endif()
30+
31+
set(GTSAM_HAVE_GEOGRAPHICLIB ${GeographicLib_FOUND})
32+
33+
if(TARGET GeographicLib::GeographicLib)
34+
message(STATUS "Using GeographicLib: ${GeographicLib_LIBRARY}")
35+
else()
36+
message(STATUS "GeographicLib not found; Relevant tests disabled.")
37+
endif()

gtsam/3rdparty/CMakeLists.txt

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -53,35 +53,4 @@ endif()
5353

5454
add_subdirectory(ceres)
5555

56-
############ NOTE: When updating GeographicLib be sure to disable building their examples
57-
############ and unit tests by commenting out their lines:
58-
# add_subdirectory (examples)
59-
# set (TOOLS CartConvert ConicProj GeodesicProj GeoConvert GeodSolve
60-
# GeoidEval Gravity MagneticField Planimeter TransverseMercatorProj)
61-
# add_subdirectory (tools)
62-
63-
# Find GeographicLib using the find script distributed with it
64-
unset(GEOGRAPHICLIB_FOUND CACHE)
65-
unset(GeographicLib_INCLUDE_DIRS CACHE)
66-
unset(GeographicLib_LIBRARIES CACHE)
67-
unset(GeographicLib_LIBRARY_DIRS CACHE)
68-
include(GeographicLib/cmake/FindGeographicLib.cmake)
69-
70-
# Set up the option to install GeographicLib
71-
if(GEOGRAPHICLIB-NOTFOUND)
72-
set(install_geographiclib_default ON)
73-
else()
74-
set(install_geographiclib_default OFF)
75-
endif()
76-
option(GTSAM_INSTALL_GEOGRAPHICLIB "Build and install the 3rd-party library GeographicLib" ${install_geographiclib_default})
77-
78-
# Print warning if we'll overwrite GeographicLib
79-
if(GEOGRAPHICLIB_FOUND AND GTSAM_INSTALL_GEOGRAPHICLIB)
80-
message(WARNING "GeographicLib is installed on your system and GTSAM_INSTALL_GEOGRAPHICLIB is enabled. Installing gtsam will either overwrite the installed GeographicLib or install a second version that may conflict. You may want to disable GTSAM_INSTALL_GEOGRAPHICLIB if the installed version was not installed by GTSAM.")
81-
endif()
82-
83-
if(GTSAM_INSTALL_GEOGRAPHICLIB)
84-
add_subdirectory(GeographicLib)
85-
endif()
86-
87-
set(GTSAM_EXPORTED_TARGETS "${GTSAM_EXPORTED_TARGETS}" PARENT_SCOPE)
56+
set(GTSAM_EXPORTED_TARGETS "${GTSAM_EXPORTED_TARGETS}" PARENT_SCOPE)

gtsam/3rdparty/GeographicLib/00README.txt

Lines changed: 0 additions & 69 deletions
This file was deleted.

gtsam/3rdparty/GeographicLib/AUTHORS

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)