From de2e2899c8461cccdd8a56db6c7cd479223270e2 Mon Sep 17 00:00:00 2001 From: kartik arcot Date: Mon, 23 Jan 2023 17:33:42 -0800 Subject: [PATCH] don't compile Gnc when there is no boost --- gtsam/CMakeLists.txt | 7 +++++++ gtsam/nonlinear/nonlinear.i | 3 +++ gtsam_unstable/CMakeLists.txt | 4 ++-- tests/CMakeLists.txt | 4 ++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/gtsam/CMakeLists.txt b/gtsam/CMakeLists.txt index 03ffb54bc..46a45875f 100644 --- a/gtsam/CMakeLists.txt +++ b/gtsam/CMakeLists.txt @@ -48,6 +48,13 @@ else() set(excluded_sources ${excluded_sources} "${CMAKE_CURRENT_SOURCE_DIR}/geometry/Rot3Q.cpp") endif() +# if GTSAM_USE_BOOST_FEATURES is not set, then we need to exclude the following: +if(NOT GTSAM_USE_BOOST_FEATURES) + list (APPEND excluded_sources ${excluded_sources} + "${CMAKE_CURRENT_SOURCE_DIR}/nonlinear/GncOptimizer.h" + ) +endif() + # Common headers file(GLOB gtsam_core_headers "*.h") install(FILES ${gtsam_core_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam) diff --git a/gtsam/nonlinear/nonlinear.i b/gtsam/nonlinear/nonlinear.i index 3e3373f61..bc14efc20 100644 --- a/gtsam/nonlinear/nonlinear.i +++ b/gtsam/nonlinear/nonlinear.i @@ -582,6 +582,8 @@ virtual class DoglegOptimizer : gtsam::NonlinearOptimizer { double getDelta() const; }; +/* Not creating bindings to GncOptimizer since the Chi2Inv currently uses boost */ +/* #include template virtual class GncOptimizer { @@ -598,6 +600,7 @@ virtual class GncOptimizer { typedef gtsam::GncOptimizer> GncGaussNewtonOptimizer; typedef gtsam::GncOptimizer> GncLMOptimizer; +*/ #include virtual class LevenbergMarquardtOptimizer : gtsam::NonlinearOptimizer { diff --git a/gtsam_unstable/CMakeLists.txt b/gtsam_unstable/CMakeLists.txt index 08a97e4d3..d02731af0 100644 --- a/gtsam_unstable/CMakeLists.txt +++ b/gtsam_unstable/CMakeLists.txt @@ -31,12 +31,12 @@ set (excluded_headers # "") # if GTSAM_USE_BOOST_FEATURES is not set, then we need to exclude the following: if(NOT GTSAM_USE_BOOST_FEATURES) - set (excluded_sources ${excluded_sources} + list (APPEND excluded_sources ${excluded_sources} "${CMAKE_CURRENT_SOURCE_DIR}/linear/QPSParser.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/linear/QPSSolver.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/linear/Scheduler.cpp" ) - set (excluded_headers ${excluded_headers} + list (APPEND excluded_headers ${excluded_headers} "${CMAKE_CURRENT_SOURCE_DIR}/linear/QPSParser.h" "${CMAKE_CURRENT_SOURCE_DIR}/linear/QPSSolver.h" "${CMAKE_CURRENT_SOURCE_DIR}/linear/Scheduler.h" diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 5eaad45dc..c0c960e65 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -7,6 +7,10 @@ if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") # might not be best test - Richar list (APPEND tests_exclude "testSerializationSlam.cpp") endif() +if (NOT GTSAM_USE_BOOST_FEATURES) + list(APPEND tests_exclude "testGncOptimizer.cpp") +endif() + # Build tests gtsamAddTestsGlob(tests "test*.cpp" "${tests_exclude}" "gtsam")