From 19a3b89eb925b076cb95e09da3e24f2ad62bdada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Mon, 2 Dec 2024 13:29:12 +0100 Subject: [PATCH 01/67] [ceres] Update to port version 2.2.0 --- ports/ceres/0001_cmakelists_fixes.patch | 58 ++++++++- ports/ceres/0002_use_glog_target.patch | 8 +- .../0003_fix_exported_ceres_config.patch | 19 ++- ports/ceres/find-package-required.patch | 112 ------------------ ports/ceres/portfile.cmake | 14 ++- ports/ceres/vcpkg.json | 14 +-- 6 files changed, 80 insertions(+), 145 deletions(-) delete mode 100644 ports/ceres/find-package-required.patch diff --git a/ports/ceres/0001_cmakelists_fixes.patch b/ports/ceres/0001_cmakelists_fixes.patch index bb594272374dd9..b3d81e38d69564 100644 --- a/ports/ceres/0001_cmakelists_fixes.patch +++ b/ports/ceres/0001_cmakelists_fixes.patch @@ -1,11 +1,48 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 33e98b1..f275d68 100644 +index 8e49c19e..707dfb9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -426,27 +426,7 @@ if (MINIGLOG) +@@ -292,7 +292,7 @@ if (SUITESPARSE) + # built with SuiteSparse support. + + # Check for SuiteSparse and dependencies. +- find_package(SuiteSparse 4.5.6 COMPONENTS CHOLMOD SPQR ++ find_package(SuiteSparse 4.5.6 CONFIG COMPONENTS CHOLMOD SPQR + OPTIONAL_COMPONENTS Partition) + if (SuiteSparse_FOUND) + set(SuiteSparse_DEPENDENCY "find_dependency(SuiteSparse ${SuiteSparse_VERSION})") +@@ -301,11 +301,11 @@ if (SUITESPARSE) + message("-- Found SuiteSparse ${SuiteSparse_VERSION}, " + "building with SuiteSparse.") + +- if (SuiteSparse_NO_CMAKE OR NOT SuiteSparse_DIR) ++ if (SuiteSparse_NO_CMAKE OR NOT SuiteSparse_DIR) + install(FILES ${Ceres_SOURCE_DIR}/cmake/FindSuiteSparse.cmake + ${Ceres_SOURCE_DIR}/cmake/FindMETIS.cmake + DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) +- endif (SuiteSparse_NO_CMAKE OR NOT SuiteSparse_DIR) ++ endif (0) + else (SuiteSparse_FOUND) + # Disable use of SuiteSparse if it cannot be found and continue. + message("-- Did not find all SuiteSparse dependencies, disabling " +@@ -395,9 +395,10 @@ endif() + # GFlags. + if (GFLAGS) + # Don't search with REQUIRED as we can continue without gflags. +- find_package(gflags 2.2.0) ++ find_package(gflags CONFIG REQUIRED) + if (gflags_FOUND) +- if (TARGET gflags) ++ if (TARGET gflags::gflags) ++ add_library(gflags ALIAS gflags::gflags) + message("-- Found Google Flags (gflags) version ${gflags_VERSION}: ${gflags_DIR}") + else() + message("-- Detected version of gflags: ${gflags_VERSION} does not define " +@@ -430,28 +431,7 @@ if (MINIGLOG) + mark_as_advanced(FORCE GLOG_INCLUDE_DIR GLOG_LIBRARY) else (MINIGLOG) - unset(MINIGLOG_MAX_LOG_LEVEL CACHE) +- unset(MINIGLOG_MAX_LOG_LEVEL CACHE) - # Don't search with REQUIRED so that configuration continues if not found and - # we can output an error messages explaining MINIGLOG option. - find_package(Glog) @@ -29,9 +66,18 @@ index 33e98b1..f275d68 100644 - message("-- Found Google Log (glog)." ${GLOG_GFLAGS_DEPENDENCY_MESSAGE}) + find_package(Glog REQUIRED) endif (MINIGLOG) - + if (NOT SCHUR_SPECIALIZATIONS) -@@ -760,12 +740,6 @@ install(FILES "${Ceres_BINARY_DIR}/CeresConfig-install.cmake" +@@ -466,7 +446,7 @@ endif (NOT CUSTOM_BLAS) + + if (BUILD_BENCHMARKS) + # Version 1.3 was first to provide import targets +- find_package(benchmark 1.3 QUIET) ++ find_package(benchmark CONFIG REQUIRED) + if (benchmark_FOUND) + message("-- Found Google benchmark library. Building Ceres benchmarks.") + else() +@@ -722,12 +702,6 @@ install(FILES "${Ceres_BINARY_DIR}/CeresConfig-install.cmake" DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) install(FILES "${Ceres_BINARY_DIR}/CeresConfigVersion.cmake" DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) @@ -41,6 +87,6 @@ index 33e98b1..f275d68 100644 - install(FILES "${Ceres_SOURCE_DIR}/cmake/FindGlog.cmake" - DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) -endif() - + if (PROVIDE_UNINSTALL_TARGET) # Create an uninstall target to remove all installed files. diff --git a/ports/ceres/0002_use_glog_target.patch b/ports/ceres/0002_use_glog_target.patch index 01ac27d4aa1575..806025c270b8f2 100644 --- a/ports/ceres/0002_use_glog_target.patch +++ b/ports/ceres/0002_use_glog_target.patch @@ -1,10 +1,10 @@ diff --git a/internal/ceres/CMakeLists.txt b/internal/ceres/CMakeLists.txt -index 0e33263..299b373 100644 +index f9fc2415..0aaabe4d 100644 --- a/internal/ceres/CMakeLists.txt +++ b/internal/ceres/CMakeLists.txt -@@ -101,17 +101,9 @@ endif() - find_package(Threads QUIET) - list(APPEND CERES_LIBRARY_PUBLIC_DEPENDENCIES Threads::Threads) +@@ -85,17 +85,9 @@ endif (SCHUR_SPECIALIZATIONS) + set_source_files_properties(${CERES_INTERNAL_SCHUR_FILES} PROPERTIES + SKIP_UNITY_BUILD_INCLUSION ON) -if (NOT MINIGLOG AND GLOG_FOUND) - list(APPEND CERES_LIBRARY_PUBLIC_DEPENDENCIES ${GLOG_LIBRARIES}) diff --git a/ports/ceres/0003_fix_exported_ceres_config.patch b/ports/ceres/0003_fix_exported_ceres_config.patch index 9505707da17908..ccd2d4496cad63 100644 --- a/ports/ceres/0003_fix_exported_ceres_config.patch +++ b/ports/ceres/0003_fix_exported_ceres_config.patch @@ -1,8 +1,17 @@ diff --git a/cmake/CeresConfig.cmake.in b/cmake/CeresConfig.cmake.in -index 4745483..b55462d 100644 +index ceb7e269..de302f59 100644 --- a/cmake/CeresConfig.cmake.in +++ b/cmake/CeresConfig.cmake.in -@@ -217,55 +217,14 @@ else (Eigen3_FOUND) +@@ -195,7 +195,7 @@ set(CERES_EIGEN_VERSION @Eigen3_VERSION@) + # Search quietly to control the timing of the error message if not found. The + # search should be for an exact match, but for usability reasons do a soft + # match and reject with an explanation below. +-find_package(Eigen3 ${CERES_EIGEN_VERSION} QUIET) ++find_package(Eigen3 CONFIG ${CERES_EIGEN_VERSION} QUIET) + if (Eigen3_FOUND) + if (NOT Eigen3_VERSION VERSION_EQUAL CERES_EIGEN_VERSION) + # CMake's VERSION check in FIND_PACKAGE() will accept any version >= the +@@ -217,55 +217,13 @@ else (Eigen3_FOUND) endif (Eigen3_FOUND) # glog (and maybe gflags). @@ -35,14 +44,14 @@ index 4745483..b55462d 100644 - # Search quietly s/t we control the timing of the error message if not found. - find_package(Glog QUIET) - endif() - +- - if (GLOG_FOUND) - ceres_message(STATUS "Found required Ceres dependency: glog") - else() - ceres_report_not_found("Missing required Ceres dependency: glog.") - endif() -+include (CMakeFindDependencyMacro) -+find_dependency (glog NO_MODULE) ++include(CMakeFindDependencyMacro) ++find_dependency(glog NO_MODULE) - # gflags is only a public dependency of Ceres via glog, thus is not required - # if Ceres was built with MINIGLOG. diff --git a/ports/ceres/find-package-required.patch b/ports/ceres/find-package-required.patch deleted file mode 100644 index 07785dd137e521..00000000000000 --- a/ports/ceres/find-package-required.patch +++ /dev/null @@ -1,112 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2d241fe..b79454d 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -244,7 +244,7 @@ else (CUDA) - endif (CUDA) - - if (LAPACK) -- find_package(LAPACK QUIET) -+ find_package(LAPACK REQUIRED) - if (LAPACK_FOUND) - message("-- Found LAPACK library: ${LAPACK_LIBRARIES}") - else (LAPACK_FOUND) -@@ -266,7 +266,8 @@ if (SUITESPARSE) - # built with SuiteSparse support. - - # Check for SuiteSparse and dependencies. -- find_package(SuiteSparse 4.0 COMPONENTS CHOLMOD SPQR) -+ find_package(suitesparse CONFIG REQUIRED) -+ set(SuiteSparse_FOUND 1) - if (SuiteSparse_FOUND) - set(SuiteSparse_DEPENDENCY "find_dependency(SuiteSparse ${SuiteSparse_VERSION})") - # By default, if all of SuiteSparse's dependencies are found, Ceres is -@@ -274,11 +275,11 @@ if (SUITESPARSE) - message("-- Found SuiteSparse ${SuiteSparse_VERSION}, " - "building with SuiteSparse.") - -- if (SuiteSparse_NO_CMAKE OR NOT SuiteSparse_DIR) -+ if (0) - install(FILES ${Ceres_SOURCE_DIR}/cmake/FindSuiteSparse.cmake - ${Ceres_SOURCE_DIR}/cmake/FindMETIS.cmake - DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) -- endif (SuiteSparse_NO_CMAKE OR NOT SuiteSparse_DIR) -+ endif () - else (SuiteSparse_FOUND) - # Disable use of SuiteSparse if it cannot be found and continue. - message("-- Did not find all SuiteSparse dependencies, disabling " -@@ -294,7 +295,7 @@ endif (SUITESPARSE) - # CXSparse. - if (CXSPARSE) - # Don't search with REQUIRED as we can continue without CXSparse. -- find_package(CXSparse) -+ find_package(CXSparse REQUIRED) - if (CXSparse_FOUND) - set(CXSparse_DEPENDENCY "find_dependency(CXSparse ${CXSparse_VERSION})") - # By default, if CXSparse and all dependencies are found, Ceres is -@@ -302,10 +303,10 @@ if (CXSPARSE) - message("-- Found CXSparse version: ${CXSparse_VERSION}, " - "building with CXSparse.") - -- if (CXSparse_NO_CMAKE OR NOT CXSparse_DIR) -+ if (0) - install(FILES ${Ceres_SOURCE_DIR}/cmake/FindCXSparse.cmake - DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) -- endif (CXSparse_NO_CMAKE OR NOT CXSparse_DIR) -+ endif () - else (CXSparse_FOUND) - # Disable use of CXSparse if it cannot be found and continue. - message("-- Did not find CXSparse, Building without CXSparse.") -@@ -367,9 +368,10 @@ endif() - # GFlags. - if (GFLAGS) - # Don't search with REQUIRED as we can continue without gflags. -- find_package(gflags 2.2.0) -+ find_package(gflags CONFIG REQUIRED) - if (gflags_FOUND) -- if (TARGET gflags) -+ if (TARGET gflags::gflags) -+ add_library(gflags ALIAS gflags::gflags) - message("-- Found Google Flags (gflags) version ${gflags_VERSION}: ${gflags_DIR}") - else() - message("-- Detected version of gflags: ${gflags_VERSION} does not define " -@@ -420,7 +422,7 @@ set_ceres_threading_model("${CERES_THREADING_MODEL}") - - if (BUILD_BENCHMARKS) - # Version 1.3 was first to provide import targets -- find_package(benchmark 1.3 QUIET) -+ find_package(benchmark CONFIG REQUIRED) - if (benchmark_FOUND) - message("-- Found Google benchmark library. Building Ceres benchmarks.") - else() -@@ -611,7 +613,7 @@ create_ceres_config("${CERES_COMPILE_OPTIONS}" - add_subdirectory(internal/ceres) - - if (BUILD_DOCUMENTATION) -- find_package(Sphinx) -+ find_package(Sphinx REQUIRED) - if (NOT SPHINX_FOUND) - message("-- Failed to find Sphinx and/or its dependencies, disabling build of documentation.") - update_cache_variable(BUILD_DOCUMENTATION OFF) -diff --git a/internal/ceres/CMakeLists.txt b/internal/ceres/CMakeLists.txt -index 299b373..33d41d8 100644 ---- a/internal/ceres/CMakeLists.txt -+++ b/internal/ceres/CMakeLists.txt -@@ -108,14 +108,14 @@ endif (NOT MINIGLOG) - if (SUITESPARSE AND SuiteSparse_FOUND) - # Define version information for use in Solver::FullReport. - add_definitions(-DCERES_SUITESPARSE_VERSION="${SuiteSparse_VERSION}") -- list(APPEND CERES_LIBRARY_PRIVATE_DEPENDENCIES SuiteSparse::CHOLMOD -- SuiteSparse::SPQR) -+ list(APPEND CERES_LIBRARY_PRIVATE_DEPENDENCIES SuiteSparse::cholmod -+ SuiteSparse::spqr) - endif (SUITESPARSE AND SuiteSparse_FOUND) - - if (CXSPARSE AND CXSparse_FOUND) - # Define version information for use in Solver::FullReport. - add_definitions(-DCERES_CXSPARSE_VERSION="${CXSparse_VERSION}") -- list(APPEND CERES_LIBRARY_PRIVATE_DEPENDENCIES CXSparse::CXSparse) -+ list(APPEND CERES_LIBRARY_PRIVATE_DEPENDENCIES ${CXSparse_LIBRARIES}) - endif (CXSPARSE AND CXSparse_FOUND) - - if (ACCELERATESPARSE AND AccelerateSparse_FOUND) diff --git a/ports/ceres/portfile.cmake b/ports/ceres/portfile.cmake index 6f856bed4bec59..eab80218be6bfc 100644 --- a/ports/ceres/portfile.cmake +++ b/ports/ceres/portfile.cmake @@ -9,17 +9,15 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ceres-solver/ceres-solver - REF f68321e7de8929fbcdb95dd42877531e64f72f66 #2.1.0 - SHA512 67bbd8a9385a40fe69d118fbc84da0fcc9aa1fbe14dd52f5403ed09686504213a1d931e95a1a0148d293b27ab5ce7c1d618fbf2e8fed95f2bbafab851a1ef449 + REF 85331393dc0dff09f6fb9903ab0c4bfa3e134b01 #2.2.0 + SHA512 16d3f4f3524b7532f666c0a626f1c678170698119eff3d914ade2e7cc65f25e644c2eabb618cd5805cba0fd4e08d3f64658a9f480934d8aace4089ec42b3d691 HEAD_REF master PATCHES 0001_cmakelists_fixes.patch 0002_use_glog_target.patch 0003_fix_exported_ceres_config.patch - find-package-required.patch ) -file(REMOVE "${SOURCE_PATH}/cmake/FindCXSparse.cmake") file(REMOVE "${SOURCE_PATH}/cmake/FindGflags.cmake") file(REMOVE "${SOURCE_PATH}/cmake/FindGlog.cmake") file(REMOVE "${SOURCE_PATH}/cmake/FindEigen.cmake") @@ -30,7 +28,6 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES "schur" SCHUR_SPECIALIZATIONS "suitesparse" SUITESPARSE - "cxsparse" CXSPARSE "lapack" LAPACK "eigensparse" EIGENSPARSE "tools" GFLAGS @@ -44,6 +41,11 @@ foreach (FEATURE ${FEATURE_OPTIONS}) message(STATUS "${FEATURE}") endforeach() +set(USE_CUDA OFF) +if("cuda" IN_LIST FEATURES) + set(USE_CUDA ON) +endif() + set(TARGET_OPTIONS ) if(VCPKG_TARGET_IS_IOS) # Note: CMake uses "OSX" not just for macOS, but also iOS, watchOS and tvOS. @@ -52,6 +54,7 @@ endif() vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" + MAYBE_UNUSED_VARIABLES OPTIONS ${FEATURE_OPTIONS} ${TARGET_OPTIONS} @@ -60,6 +63,7 @@ vcpkg_cmake_configure( -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF -DBUILD_BENCHMARKS=OFF + -DUSE_CUDA=${USE_CUDA} -DPROVIDE_UNINSTALL_TARGET=OFF -DMSVC_USE_STATIC_CRT=${MSVC_USE_STATIC_CRT_VALUE} -DLIB_SUFFIX=${LIB_SUFFIX} diff --git a/ports/ceres/vcpkg.json b/ports/ceres/vcpkg.json index d7471df4d44fb0..45492e32e82c46 100644 --- a/ports/ceres/vcpkg.json +++ b/ports/ceres/vcpkg.json @@ -1,7 +1,6 @@ { "name": "ceres", - "version": "2.1.0", - "port-version": 5, + "version": "2.2.0", "description": "non-linear optimization package", "homepage": "https://github.com/ceres-solver/ceres-solver", "license": "Apache-2.0", @@ -28,17 +27,6 @@ "cuda" ] }, - "cxsparse": { - "description": "CXSparse support for Ceres", - "dependencies": [ - { - "name": "ceres", - "features": [ - "suitesparse" - ] - } - ] - }, "eigensparse": { "description": "Use of Eigen as a sparse linear algebra library in Ceres" }, From 41e4fc1af105b42244d9038acd6fad056aa781d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Mon, 2 Dec 2024 13:35:14 +0100 Subject: [PATCH 02/67] d --- versions/baseline.json | 4 ++-- versions/c-/ceres.json | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/versions/baseline.json b/versions/baseline.json index 4a976b0e093034..cdb23a5d6e9a19 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1585,8 +1585,8 @@ "port-version": 1 }, "ceres": { - "baseline": "2.1.0", - "port-version": 5 + "baseline": "2.2.0", + "port-version": 0 }, "cfitsio": { "baseline": "3.49", diff --git a/versions/c-/ceres.json b/versions/c-/ceres.json index eefdfc508f37b3..fe597b94da1b3c 100644 --- a/versions/c-/ceres.json +++ b/versions/c-/ceres.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "23a0b71f09485fdd71622b4cb08ffb9504a3e781", + "version": "2.2.0", + "port-version": 0 + }, { "git-tree": "213619bf4451443bd69f784f9a7fa32fc2436e07", "version": "2.1.0", From e185abc238ea3c2f20dd53d0ea6a14f303ccfa7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Mon, 2 Dec 2024 13:39:43 +0100 Subject: [PATCH 03/67] d --- ports/openmvg/vcpkg.json | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/openmvg/vcpkg.json b/ports/openmvg/vcpkg.json index 65be709b66d524..394ccfd29f83a4 100644 --- a/ports/openmvg/vcpkg.json +++ b/ports/openmvg/vcpkg.json @@ -10,7 +10,6 @@ { "name": "ceres", "features": [ - "cxsparse", "suitesparse" ] }, From 73c312abccbddc4c4b7d9b8a64ed2df756693a3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Mon, 2 Dec 2024 13:40:00 +0100 Subject: [PATCH 04/67] d --- versions/o-/openmvg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/o-/openmvg.json b/versions/o-/openmvg.json index cc9941057f932b..366c1ff46a6b84 100644 --- a/versions/o-/openmvg.json +++ b/versions/o-/openmvg.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "e08aec4337f9a281817b2c84d04fee5a079551d8", + "git-tree": "ce150540ea4d0c70dbef977eac1c630c532f0ec9", "version": "2.0", "port-version": 11 }, From ba5ccff499ff356ca155e71174be2d80e0f4a1ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Tue, 3 Dec 2024 22:43:03 +0100 Subject: [PATCH 05/67] d --- ports/ceres/0003_fix_exported_ceres_config.patch | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/ports/ceres/0003_fix_exported_ceres_config.patch b/ports/ceres/0003_fix_exported_ceres_config.patch index ccd2d4496cad63..008d798bafd569 100644 --- a/ports/ceres/0003_fix_exported_ceres_config.patch +++ b/ports/ceres/0003_fix_exported_ceres_config.patch @@ -1,5 +1,5 @@ diff --git a/cmake/CeresConfig.cmake.in b/cmake/CeresConfig.cmake.in -index ceb7e269..de302f59 100644 +index ceb7e269..5dee7e3c 100644 --- a/cmake/CeresConfig.cmake.in +++ b/cmake/CeresConfig.cmake.in @@ -195,7 +195,7 @@ set(CERES_EIGEN_VERSION @Eigen3_VERSION@) @@ -11,7 +11,7 @@ index ceb7e269..de302f59 100644 if (Eigen3_FOUND) if (NOT Eigen3_VERSION VERSION_EQUAL CERES_EIGEN_VERSION) # CMake's VERSION check in FIND_PACKAGE() will accept any version >= the -@@ -217,55 +217,13 @@ else (Eigen3_FOUND) +@@ -217,55 +217,8 @@ else (Eigen3_FOUND) endif (Eigen3_FOUND) # glog (and maybe gflags). @@ -50,9 +50,7 @@ index ceb7e269..de302f59 100644 - else() - ceres_report_not_found("Missing required Ceres dependency: glog.") - endif() -+include(CMakeFindDependencyMacro) -+find_dependency(glog NO_MODULE) - +- - # gflags is only a public dependency of Ceres via glog, thus is not required - # if Ceres was built with MINIGLOG. - if (CERES_USES_GFLAGS) @@ -66,10 +64,8 @@ index ceb7e269..de302f59 100644 - endif() - endif() -endif(CERES_USES_MINIGLOG) -+# SuiteSparse -+if (@SUITESPARSE@) -+ find_dependency(SuiteSparse CONFIG) -+endif() ++include(CMakeFindDependencyMacro) ++find_dependency(glog NO_MODULE) # Import exported Ceres targets, if they have not already been imported. if (NOT TARGET ceres AND NOT Ceres_BINARY_DIR) From 7bcc754421146ee885dcbd2ced4bc85951ec4256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Tue, 3 Dec 2024 22:44:33 +0100 Subject: [PATCH 06/67] d --- ports/openmvg/vcpkg.json | 2 +- versions/o-/openmvg.json | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ports/openmvg/vcpkg.json b/ports/openmvg/vcpkg.json index 394ccfd29f83a4..704d0537bb1f31 100644 --- a/ports/openmvg/vcpkg.json +++ b/ports/openmvg/vcpkg.json @@ -1,7 +1,7 @@ { "name": "openmvg", "version": "2.0", - "port-version": 11, + "port-version": 12, "description": "open Multiple View Geometry library. Basis for 3D computer vision and Structure from Motion.", "license": "MPL-2.0-no-copyleft-exception", "supports": "(x86 | x64 | arm64) & !xbox", diff --git a/versions/o-/openmvg.json b/versions/o-/openmvg.json index 366c1ff46a6b84..f801774fd98f90 100644 --- a/versions/o-/openmvg.json +++ b/versions/o-/openmvg.json @@ -3,6 +3,11 @@ { "git-tree": "ce150540ea4d0c70dbef977eac1c630c532f0ec9", "version": "2.0", + "port-version": 12 + }, + { + "git-tree": "e08aec4337f9a281817b2c84d04fee5a079551d8", + "version": "2.0", "port-version": 11 }, { From 14e6951ccf3d86d972619ad51df1b25bdd3970f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Tue, 3 Dec 2024 22:46:06 +0100 Subject: [PATCH 07/67] d --- versions/baseline.json | 2 +- versions/c-/ceres.json | 2 +- versions/o-/openmvg.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/versions/baseline.json b/versions/baseline.json index cdb23a5d6e9a19..2f619798b3c231 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6730,7 +6730,7 @@ }, "openmvg": { "baseline": "2.0", - "port-version": 11 + "port-version": 12 }, "openmvs": { "baseline": "2.1.0", diff --git a/versions/c-/ceres.json b/versions/c-/ceres.json index fe597b94da1b3c..0eacc29d448b07 100644 --- a/versions/c-/ceres.json +++ b/versions/c-/ceres.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "23a0b71f09485fdd71622b4cb08ffb9504a3e781", + "git-tree": "c8fa614778984105f589546429c66baae3c2cb4f", "version": "2.2.0", "port-version": 0 }, diff --git a/versions/o-/openmvg.json b/versions/o-/openmvg.json index f801774fd98f90..2442a1cbcec263 100644 --- a/versions/o-/openmvg.json +++ b/versions/o-/openmvg.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "ce150540ea4d0c70dbef977eac1c630c532f0ec9", + "git-tree": "4d295167110da197b9fa74056de4c0863d1953c9", "version": "2.0", "port-version": 12 }, From 68bea469ce36dadcf112b8b3ed4b5b92e1b2a72f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Tue, 3 Dec 2024 22:56:26 +0100 Subject: [PATCH 08/67] d --- ports/colmap/0001_cmakelists_fixes.patch | 94 ++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 ports/colmap/0001_cmakelists_fixes.patch diff --git a/ports/colmap/0001_cmakelists_fixes.patch b/ports/colmap/0001_cmakelists_fixes.patch new file mode 100644 index 00000000000000..de2d4c1652a306 --- /dev/null +++ b/ports/colmap/0001_cmakelists_fixes.patch @@ -0,0 +1,94 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8e49c19e..28059c7d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -292,20 +292,20 @@ if (SUITESPARSE) + # built with SuiteSparse support. + + # Check for SuiteSparse and dependencies. +- find_package(SuiteSparse 4.5.6 COMPONENTS CHOLMOD SPQR ++ find_package(SuiteSparse 4.5.6 CONFIG COMPONENTS CHOLMOD SPQR + OPTIONAL_COMPONENTS Partition) + if (SuiteSparse_FOUND) +- set(SuiteSparse_DEPENDENCY "find_dependency(SuiteSparse ${SuiteSparse_VERSION})") ++ set(SuiteSparse_DEPENDENCY "find_dependency(SuiteSparse ${SuiteSparse_VERSION} CONFIG)") + # By default, if all of SuiteSparse's dependencies are found, Ceres is + # built with SuiteSparse support. + message("-- Found SuiteSparse ${SuiteSparse_VERSION}, " + "building with SuiteSparse.") + +- if (SuiteSparse_NO_CMAKE OR NOT SuiteSparse_DIR) ++ if (SuiteSparse_NO_CMAKE OR NOT SuiteSparse_DIR) + install(FILES ${Ceres_SOURCE_DIR}/cmake/FindSuiteSparse.cmake + ${Ceres_SOURCE_DIR}/cmake/FindMETIS.cmake + DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) +- endif (SuiteSparse_NO_CMAKE OR NOT SuiteSparse_DIR) ++ endif (0) + else (SuiteSparse_FOUND) + # Disable use of SuiteSparse if it cannot be found and continue. + message("-- Did not find all SuiteSparse dependencies, disabling " +@@ -395,9 +395,10 @@ endif() + # GFlags. + if (GFLAGS) + # Don't search with REQUIRED as we can continue without gflags. +- find_package(gflags 2.2.0) ++ find_package(gflags CONFIG REQUIRED) + if (gflags_FOUND) +- if (TARGET gflags) ++ if (TARGET gflags::gflags) ++ add_library(gflags ALIAS gflags::gflags) + message("-- Found Google Flags (gflags) version ${gflags_VERSION}: ${gflags_DIR}") + else() + message("-- Detected version of gflags: ${gflags_VERSION} does not define " +@@ -430,28 +431,7 @@ if (MINIGLOG) + mark_as_advanced(FORCE GLOG_INCLUDE_DIR + GLOG_LIBRARY) + else (MINIGLOG) +- unset(MINIGLOG_MAX_LOG_LEVEL CACHE) +- # Don't search with REQUIRED so that configuration continues if not found and +- # we can output an error messages explaining MINIGLOG option. +- find_package(Glog) +- if (NOT GLOG_FOUND) +- message(FATAL_ERROR "Can't find Google Log (glog). Please set either: " +- "glog_DIR (newer CMake built versions of glog) or GLOG_INCLUDE_DIR & " +- "GLOG_LIBRARY or enable MINIGLOG option to use minimal glog " +- "implementation.") +- endif(NOT GLOG_FOUND) +- # By default, assume gflags was found, updating the message if it was not. +- set(GLOG_GFLAGS_DEPENDENCY_MESSAGE +- " Assuming glog was built with gflags support as gflags was found. " +- "This will make gflags a public dependency of Ceres.") +- if (NOT gflags_FOUND) +- set(GLOG_GFLAGS_DEPENDENCY_MESSAGE +- " Assuming glog was NOT built with gflags support as gflags was " +- "not found. If glog was built with gflags, please set the " +- "gflags search locations such that it can be found by Ceres. " +- "Otherwise, Ceres may fail to link due to missing gflags symbols.") +- endif(NOT gflags_FOUND) +- message("-- Found Google Log (glog)." ${GLOG_GFLAGS_DEPENDENCY_MESSAGE}) ++ find_package(Glog REQUIRED) + endif (MINIGLOG) + + if (NOT SCHUR_SPECIALIZATIONS) +@@ -466,7 +446,7 @@ endif (NOT CUSTOM_BLAS) + + if (BUILD_BENCHMARKS) + # Version 1.3 was first to provide import targets +- find_package(benchmark 1.3 QUIET) ++ find_package(benchmark CONFIG REQUIRED) + if (benchmark_FOUND) + message("-- Found Google benchmark library. Building Ceres benchmarks.") + else() +@@ -722,12 +702,6 @@ install(FILES "${Ceres_BINARY_DIR}/CeresConfig-install.cmake" + DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) + install(FILES "${Ceres_BINARY_DIR}/CeresConfigVersion.cmake" + DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) +-if (GLOG_FOUND AND NOT FOUND_INSTALLED_GLOG_CMAKE_CONFIGURATION) +- # Version of glog detected was not built with CMake, install our glog module +- # file to enable detection in CeresConfig. +- install(FILES "${Ceres_SOURCE_DIR}/cmake/FindGlog.cmake" +- DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) +-endif() + + if (PROVIDE_UNINSTALL_TARGET) + # Create an uninstall target to remove all installed files. From adbc51b0fbd1f01193befe03f30aa9c31513fcc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 4 Dec 2024 08:47:33 +0100 Subject: [PATCH 09/67] cartographer --- ports/cartographer/fix-build-error.patch | 25 - ports/cartographer/fix-cmake-location.patch | 22 - ports/cartographer/fix-errors.patch | 1591 +++++++++++++++++ ports/cartographer/fix-find-packages.patch | 175 -- ports/cartographer/portfile.cmake | 7 +- ...ographer-to-deal-with-newer-ceres-24.patch | 604 +++++++ ports/cartographer/vcpkg.json | 4 +- ports/ceres/0001_cmakelists_fixes.patch | 52 +- 8 files changed, 2235 insertions(+), 245 deletions(-) delete mode 100644 ports/cartographer/fix-build-error.patch delete mode 100644 ports/cartographer/fix-cmake-location.patch create mode 100644 ports/cartographer/fix-errors.patch delete mode 100644 ports/cartographer/fix-find-packages.patch create mode 100644 ports/cartographer/update-cartographer-to-deal-with-newer-ceres-24.patch diff --git a/ports/cartographer/fix-build-error.patch b/ports/cartographer/fix-build-error.patch deleted file mode 100644 index 9474c78dc12b3e..00000000000000 --- a/ports/cartographer/fix-build-error.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/cartographer/common/internal/testing/thread_pool_for_testing.cc b/cartographer/common/internal/testing/thread_pool_for_testing.cc -index f804e13..c987f68 100644 ---- a/cartographer/common/internal/testing/thread_pool_for_testing.cc -+++ b/cartographer/common/internal/testing/thread_pool_for_testing.cc -@@ -16,7 +16,7 @@ - - #include "cartographer/common/internal/testing/thread_pool_for_testing.h" - --#include -+//#include - #include - #include - #include -diff --git a/cartographer/mapping/pose_graph_interface.h b/cartographer/mapping/pose_graph_interface.h -index 6483ef4..6456720 100644 ---- a/cartographer/mapping/pose_graph_interface.h -+++ b/cartographer/mapping/pose_graph_interface.h -@@ -18,6 +18,7 @@ - #define CARTOGRAPHER_MAPPING_POSE_GRAPH_INTERFACE_H_ - - #include -+#include - - #include "cartographer/common/optional.h" - #include "cartographer/mapping/id.h" diff --git a/ports/cartographer/fix-cmake-location.patch b/ports/cartographer/fix-cmake-location.patch deleted file mode 100644 index b0eb12397fccd3..00000000000000 --- a/ports/cartographer/fix-cmake-location.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2e3a686be..f2a0c5d8e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -300,7 +300,7 @@ foreach(HDR ${INSTALL_GENERATED_HDRS}) - ) - endforeach() - --set(CARTOGRAPHER_CMAKE_DIR share/cartographer/cmake) -+set(CARTOGRAPHER_CMAKE_DIR share/cartographer) - include(CMakePackageConfigHelpers) - configure_package_config_file( - cartographer-config.cmake.in -@@ -311,7 +311,7 @@ configure_package_config_file( - - install( - EXPORT CartographerExport -- DESTINATION share/cartographer/cmake/ -+ DESTINATION share/cartographer/ - FILE CartographerTargets.cmake - ) - diff --git a/ports/cartographer/fix-errors.patch b/ports/cartographer/fix-errors.patch new file mode 100644 index 00000000000000..bf71646b91492b --- /dev/null +++ b/ports/cartographer/fix-errors.patch @@ -0,0 +1,1591 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ef2fcb3..fdbe96e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -16,7 +16,7 @@ cmake_minimum_required(VERSION 3.2) + + project(cartographer) + +-set(CARTOGRAPHER_MAJOR_VERSION 1) ++set(CARTOGRAPHER_MAJOR_VERSION 2) + set(CARTOGRAPHER_MINOR_VERSION 0) + set(CARTOGRAPHER_PATCH_VERSION 0) + set(CARTOGRAPHER_VERSION ${CARTOGRAPHER_MAJOR_VERSION}.${CARTOGRAPHER_MINOR_VERSION}.${CARTOGRAPHER_PATCH_VERSION}) +@@ -26,8 +26,6 @@ set(CARTOGRAPHER_HAS_GRPC ${BUILD_GRPC}) + option(BUILD_PROMETHEUS "build Prometheus monitoring support" false) + + include("${PROJECT_SOURCE_DIR}/cmake/functions.cmake") +-google_initialize_cartographer_project() +-google_enable_testing() + + find_package(absl REQUIRED) + set(BOOST_COMPONENTS iostreams) +@@ -38,14 +36,10 @@ endif() + find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS}) + find_package(Ceres REQUIRED COMPONENTS SuiteSparse) + find_package(Eigen3 REQUIRED) +-find_package(LuaGoogle REQUIRED) +-if(WIN32) +- # On Windows, Protobuf is incorrectly found by the bundled CMake module, so prefer native CMake config. +- set(protobuf_MODULE_COMPATIBLE TRUE CACHE INTERNAL "") +- find_package(Protobuf 3.0.0 CONFIG) +-else() +- find_package(Protobuf 3.0.0 REQUIRED) +-endif() ++find_package(Lua REQUIRED) ++find_package(Protobuf REQUIRED) ++find_package(glog REQUIRED) ++find_package(gflags REQUIRED) + + if (${BUILD_GRPC}) + find_package(async_grpc REQUIRED) +@@ -55,18 +49,7 @@ if(${BUILD_PROMETHEUS}) + find_package( ZLIB REQUIRED ) + endif() + +-include(FindPkgConfig) +-if (NOT WIN32) +- PKG_SEARCH_MODULE(CAIRO REQUIRED cairo>=1.12.16) +-else() +- find_library(CAIRO_LIBRARIES cairo) +-endif() +- +-# Only build the documentation if we can find Sphinx. +-find_package(Sphinx) +-if(SPHINX_FOUND) +- add_subdirectory("docs") +-endif() ++find_library(CAIRO_LIBRARY cairo${CAIRO_LIB_SUFFIX}) + + # Install catkin package.xml + install(FILES package.xml DESTINATION share/cartographer) +@@ -190,26 +173,6 @@ configure_file( + ${PROJECT_SOURCE_DIR}/cartographer/common/config.h.cmake + ${PROJECT_BINARY_DIR}/cartographer/common/config.h) + +-google_binary(cartographer_autogenerate_ground_truth +- SRCS +- cartographer/ground_truth/autogenerate_ground_truth_main.cc +-) +- +-google_binary(cartographer_compute_relations_metrics +- SRCS +- cartographer/ground_truth/compute_relations_metrics_main.cc +-) +- +-google_binary(cartographer_pbstream +- SRCS +- cartographer/io/pbstream_main.cc +-) +- +-google_binary(cartographer_print_configuration +- SRCS +- cartographer/common/print_configuration_main.cc +-) +- + if(${BUILD_GRPC}) + google_binary(cartographer_grpc_server + SRCS +@@ -247,8 +210,6 @@ else() + set(GLOG_LIBRARY glog) + endif() + +-target_link_libraries(${PROJECT_NAME} PUBLIC ${GLOG_LIBRARY}) +-target_link_libraries(${PROJECT_NAME} PUBLIC gflags) + if(WIN32) + # Needed to fix conflict with MSVC's error macro. + target_compile_definitions(${PROJECT_NAME} PUBLIC -DGLOG_NO_ABBREVIATED_SEVERITIES) +@@ -258,17 +219,11 @@ if(MSVC) + target_compile_definitions(${PROJECT_NAME} PUBLIC -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_USE_MATH_DEFINES) + endif() + +-if("${CAIRO_INCLUDE_DIRS}") +- target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC +- "${CAIRO_INCLUDE_DIRS}") +-endif() +-target_link_libraries(${PROJECT_NAME} PUBLIC ${CAIRO_LIBRARIES}) +- + target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC + ${PROTOBUF_INCLUDE_DIR}) + # TODO(hrapp): This should not explicitly list pthread and use + # PROTOBUF_LIBRARIES, but that failed on first try. +-target_link_libraries(${PROJECT_NAME} PUBLIC ${PROTOBUF_LIBRARY} ++target_link_libraries(${PROJECT_NAME} PUBLIC protobuf::libprotobuf + absl::algorithm + absl::base + absl::debugging +@@ -300,6 +255,7 @@ set(TARGET_COMPILE_FLAGS "${TARGET_COMPILE_FLAGS} ${GOOG_CXX_FLAGS}") + set_target_properties(${PROJECT_NAME} PROPERTIES + COMPILE_FLAGS ${TARGET_COMPILE_FLAGS}) + ++ if(0) + set(TEST_LIB + cartographer_test_library + ) +@@ -333,6 +289,7 @@ foreach(ABS_FIL ${ALL_TESTS}) + endif() + target_link_libraries("${TEST_TARGET_NAME}" PUBLIC ${TEST_LIB}) + endforeach() ++endif() + + # Add the binary directory first, so that port.h is included after it has + # been generated. +@@ -368,7 +325,7 @@ foreach(HDR ${INSTALL_GENERATED_HDRS}) + ) + endforeach() + +-set(CARTOGRAPHER_CMAKE_DIR share/cartographer/cmake) ++set(CARTOGRAPHER_CMAKE_DIR share/cartographer) + include(CMakePackageConfigHelpers) + configure_package_config_file( + cartographer-config.cmake.in +@@ -379,7 +336,7 @@ configure_package_config_file( + + install( + EXPORT CartographerExport +- DESTINATION share/cartographer/cmake/ ++ DESTINATION share/cartographer/ + FILE CartographerTargets.cmake + ) + +diff --git a/cartographer/cloud/internal/map_builder_server.h b/cartographer/cloud/internal/map_builder_server.h +index 03a70aa..3687f3d 100644 +--- a/cartographer/cloud/internal/map_builder_server.h ++++ b/cartographer/cloud/internal/map_builder_server.h +@@ -137,10 +137,10 @@ class MapBuilderServer : public MapBuilderServerInterface { + absl::Mutex subscriptions_lock_; + int current_subscription_index_ = 0; + std::map +- local_slam_subscriptions_ GUARDED_BY(subscriptions_lock_); ++ local_slam_subscriptions_ ABSL_GUARDED_BY(subscriptions_lock_); + std::map +- global_slam_subscriptions_ GUARDED_BY(subscriptions_lock_); ++ global_slam_subscriptions_ ABSL_GUARDED_BY(subscriptions_lock_); + std::unique_ptr local_trajectory_uploader_; + int starting_submap_index_ = 0; + }; +diff --git a/cartographer/common/internal/blocking_queue.h b/cartographer/common/internal/blocking_queue.h +index cba91c0..7e3a787 100644 +--- a/cartographer/common/internal/blocking_queue.h ++++ b/cartographer/common/internal/blocking_queue.h +@@ -47,7 +47,7 @@ class BlockingQueue { + + // Pushes a value onto the queue. Blocks if the queue is full. + void Push(T t) { +- const auto predicate = [this]() EXCLUSIVE_LOCKS_REQUIRED(mutex_) { ++ const auto predicate = [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_) { + return QueueNotFullCondition(); + }; + absl::MutexLock lock(&mutex_); +@@ -57,7 +57,7 @@ class BlockingQueue { + + // Like push, but returns false if 'timeout' is reached. + bool PushWithTimeout(T t, const common::Duration timeout) { +- const auto predicate = [this]() EXCLUSIVE_LOCKS_REQUIRED(mutex_) { ++ const auto predicate = [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_) { + return QueueNotFullCondition(); + }; + absl::MutexLock lock(&mutex_); +@@ -71,7 +71,7 @@ class BlockingQueue { + + // Pops the next value from the queue. Blocks until a value is available. + T Pop() { +- const auto predicate = [this]() EXCLUSIVE_LOCKS_REQUIRED(mutex_) { ++ const auto predicate = [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_) { + return !QueueEmptyCondition(); + }; + absl::MutexLock lock(&mutex_); +@@ -84,7 +84,7 @@ class BlockingQueue { + + // Like Pop, but can timeout. Returns nullptr in this case. + T PopWithTimeout(const common::Duration timeout) { +- const auto predicate = [this]() EXCLUSIVE_LOCKS_REQUIRED(mutex_) { ++ const auto predicate = [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_) { + return !QueueEmptyCondition(); + }; + absl::MutexLock lock(&mutex_); +@@ -100,7 +100,7 @@ class BlockingQueue { + // Like Peek, but can timeout. Returns nullptr in this case. + template + R* PeekWithTimeout(const common::Duration timeout) { +- const auto predicate = [this]() EXCLUSIVE_LOCKS_REQUIRED(mutex_) { ++ const auto predicate = [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_) { + return !QueueEmptyCondition(); + }; + absl::MutexLock lock(&mutex_); +@@ -131,7 +131,7 @@ class BlockingQueue { + + // Blocks until the queue is empty. + void WaitUntilEmpty() { +- const auto predicate = [this]() EXCLUSIVE_LOCKS_REQUIRED(mutex_) { ++ const auto predicate = [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_) { + return QueueEmptyCondition(); + }; + absl::MutexLock lock(&mutex_); +@@ -140,18 +140,18 @@ class BlockingQueue { + + private: + // Returns true iff the queue is empty. +- bool QueueEmptyCondition() EXCLUSIVE_LOCKS_REQUIRED(mutex_) { ++ bool QueueEmptyCondition() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_) { + return deque_.empty(); + } + + // Returns true iff the queue is not full. +- bool QueueNotFullCondition() EXCLUSIVE_LOCKS_REQUIRED(mutex_) { ++ bool QueueNotFullCondition() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_) { + return queue_size_ == kInfiniteQueueSize || deque_.size() < queue_size_; + } + + absl::Mutex mutex_; +- const size_t queue_size_ GUARDED_BY(mutex_); +- std::deque deque_ GUARDED_BY(mutex_); ++ const size_t queue_size_ ABSL_GUARDED_BY(mutex_); ++ std::deque deque_ ABSL_GUARDED_BY(mutex_); + }; + + } // namespace common +diff --git a/cartographer/common/internal/testing/thread_pool_for_testing.cc b/cartographer/common/internal/testing/thread_pool_for_testing.cc +index 89744ba..a4d540b 100644 +--- a/cartographer/common/internal/testing/thread_pool_for_testing.cc ++++ b/cartographer/common/internal/testing/thread_pool_for_testing.cc +@@ -72,7 +72,7 @@ std::weak_ptr ThreadPoolForTesting::Schedule(std::unique_ptr task) { + + void ThreadPoolForTesting::WaitUntilIdle() { + const auto predicate = [this]() +- EXCLUSIVE_LOCKS_REQUIRED(mutex_) { return idle_; }; ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_) { return idle_; }; + for (;;) { + { + absl::MutexLock locker(&mutex_); +@@ -85,7 +85,7 @@ void ThreadPoolForTesting::WaitUntilIdle() { + } + + void ThreadPoolForTesting::DoWork() { +- const auto predicate = [this]() EXCLUSIVE_LOCKS_REQUIRED(mutex_) { ++ const auto predicate = [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_) { + return !task_queue_.empty() || !running_; + }; + for (;;) { +diff --git a/cartographer/common/internal/testing/thread_pool_for_testing.h b/cartographer/common/internal/testing/thread_pool_for_testing.h +index f733d0f..9a10dfd 100644 +--- a/cartographer/common/internal/testing/thread_pool_for_testing.h ++++ b/cartographer/common/internal/testing/thread_pool_for_testing.h +@@ -35,7 +35,7 @@ class ThreadPoolForTesting : public ThreadPoolInterface { + ~ThreadPoolForTesting(); + + std::weak_ptr Schedule(std::unique_ptr task) +- LOCKS_EXCLUDED(mutex_) override; ++ ABSL_LOCKS_EXCLUDED(mutex_) override; + + void WaitUntilIdle(); + +@@ -44,14 +44,14 @@ class ThreadPoolForTesting : public ThreadPoolInterface { + + void DoWork(); + +- void NotifyDependenciesCompleted(Task* task) LOCKS_EXCLUDED(mutex_) override; ++ void NotifyDependenciesCompleted(Task* task) ABSL_LOCKS_EXCLUDED(mutex_) override; + + absl::Mutex mutex_; +- bool running_ GUARDED_BY(mutex_) = true; +- bool idle_ GUARDED_BY(mutex_) = true; +- std::deque> task_queue_ GUARDED_BY(mutex_); +- std::map> tasks_not_ready_ GUARDED_BY(mutex_); +- std::thread thread_ GUARDED_BY(mutex_); ++ bool running_ ABSL_GUARDED_BY(mutex_) = true; ++ bool idle_ ABSL_GUARDED_BY(mutex_) = true; ++ std::deque> task_queue_ ABSL_GUARDED_BY(mutex_); ++ std::map> tasks_not_ready_ ABSL_GUARDED_BY(mutex_); ++ std::thread thread_ ABSL_GUARDED_BY(mutex_); + }; + + } // namespace testing +diff --git a/cartographer/common/math.h b/cartographer/common/math.h +index c4a77ef..0248f66 100644 +--- a/cartographer/common/math.h ++++ b/cartographer/common/math.h +@@ -17,6 +17,10 @@ + #ifndef CARTOGRAPHER_COMMON_MATH_H_ + #define CARTOGRAPHER_COMMON_MATH_H_ + ++#ifndef M_PI ++#define M_PI 3.14159265358979323846 ++#endif ++ + #include + #include + +diff --git a/cartographer/common/task.h b/cartographer/common/task.h +index ae44fb1..4256225 100644 +--- a/cartographer/common/task.h ++++ b/cartographer/common/task.h +@@ -38,34 +38,34 @@ class Task { + Task() = default; + ~Task(); + +- State GetState() LOCKS_EXCLUDED(mutex_); ++ State GetState() ABSL_LOCKS_EXCLUDED(mutex_); + + // State must be 'NEW'. +- void SetWorkItem(const WorkItem& work_item) LOCKS_EXCLUDED(mutex_); ++ void SetWorkItem(const WorkItem& work_item) ABSL_LOCKS_EXCLUDED(mutex_); + + // State must be 'NEW'. 'dependency' may be nullptr, in which case it is + // assumed completed. +- void AddDependency(std::weak_ptr dependency) LOCKS_EXCLUDED(mutex_); ++ void AddDependency(std::weak_ptr dependency) ABSL_LOCKS_EXCLUDED(mutex_); + + private: + // Allowed in all states. + void AddDependentTask(Task* dependent_task); + + // State must be 'DEPENDENCIES_COMPLETED' and becomes 'COMPLETED'. +- void Execute() LOCKS_EXCLUDED(mutex_); ++ void Execute() ABSL_LOCKS_EXCLUDED(mutex_); + + // State must be 'NEW' and becomes 'DISPATCHED' or 'DEPENDENCIES_COMPLETED'. +- void SetThreadPool(ThreadPoolInterface* thread_pool) LOCKS_EXCLUDED(mutex_); ++ void SetThreadPool(ThreadPoolInterface* thread_pool) ABSL_LOCKS_EXCLUDED(mutex_); + + // State must be 'NEW' or 'DISPATCHED'. If 'DISPATCHED', may become + // 'DEPENDENCIES_COMPLETED'. + void OnDependenyCompleted(); + +- WorkItem work_item_ GUARDED_BY(mutex_); +- ThreadPoolInterface* thread_pool_to_notify_ GUARDED_BY(mutex_) = nullptr; +- State state_ GUARDED_BY(mutex_) = NEW; +- unsigned int uncompleted_dependencies_ GUARDED_BY(mutex_) = 0; +- std::set dependent_tasks_ GUARDED_BY(mutex_); ++ WorkItem work_item_ ABSL_GUARDED_BY(mutex_); ++ ThreadPoolInterface* thread_pool_to_notify_ ABSL_GUARDED_BY(mutex_) = nullptr; ++ State state_ ABSL_GUARDED_BY(mutex_) = NEW; ++ unsigned int uncompleted_dependencies_ ABSL_GUARDED_BY(mutex_) = 0; ++ std::set dependent_tasks_ ABSL_GUARDED_BY(mutex_); + + absl::Mutex mutex_; + }; +diff --git a/cartographer/common/thread_pool.cc b/cartographer/common/thread_pool.cc +index 2457152..f4681fa 100644 +--- a/cartographer/common/thread_pool.cc ++++ b/cartographer/common/thread_pool.cc +@@ -83,7 +83,7 @@ void ThreadPool::DoWork() { + // away CPU resources from more important foreground threads. + CHECK_NE(nice(10), -1); + #endif +- const auto predicate = [this]() EXCLUSIVE_LOCKS_REQUIRED(mutex_) { ++ const auto predicate = [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_) { + return !task_queue_.empty() || !running_; + }; + for (;;) { +diff --git a/cartographer/common/thread_pool.h b/cartographer/common/thread_pool.h +index 3f6b94c..e98311b 100644 +--- a/cartographer/common/thread_pool.h ++++ b/cartographer/common/thread_pool.h +@@ -65,19 +65,19 @@ class ThreadPool : public ThreadPoolInterface { + // When the returned weak pointer is expired, 'task' has certainly completed, + // so dependants no longer need to add it as a dependency. + std::weak_ptr Schedule(std::unique_ptr task) +- LOCKS_EXCLUDED(mutex_) override; ++ ABSL_LOCKS_EXCLUDED(mutex_) override; + + private: + void DoWork(); + +- void NotifyDependenciesCompleted(Task* task) LOCKS_EXCLUDED(mutex_) override; ++ void NotifyDependenciesCompleted(Task* task) ABSL_LOCKS_EXCLUDED(mutex_) override; + + absl::Mutex mutex_; +- bool running_ GUARDED_BY(mutex_) = true; +- std::vector pool_ GUARDED_BY(mutex_); +- std::deque> task_queue_ GUARDED_BY(mutex_); ++ bool running_ ABSL_GUARDED_BY(mutex_) = true; ++ std::vector pool_ ABSL_GUARDED_BY(mutex_); ++ std::deque> task_queue_ ABSL_GUARDED_BY(mutex_); + absl::flat_hash_map> tasks_not_ready_ +- GUARDED_BY(mutex_); ++ ABSL_GUARDED_BY(mutex_); + }; + + } // namespace common +diff --git a/cartographer/common/thread_pool_test.cc b/cartographer/common/thread_pool_test.cc +index fec82ee..6b44f32 100644 +--- a/cartographer/common/thread_pool_test.cc ++++ b/cartographer/common/thread_pool_test.cc +@@ -34,7 +34,7 @@ class Receiver { + + void WaitForNumberSequence(const std::vector& expected_numbers) { + const auto predicate = +- [this, &expected_numbers]() EXCLUSIVE_LOCKS_REQUIRED(mutex_) { ++ [this, &expected_numbers]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_) { + return (received_numbers_.size() >= expected_numbers.size()); + }; + absl::MutexLock locker(&mutex_); +@@ -43,7 +43,7 @@ class Receiver { + } + + absl::Mutex mutex_; +- std::vector received_numbers_ GUARDED_BY(mutex_); ++ std::vector received_numbers_ ABSL_GUARDED_BY(mutex_); + }; + + TEST(ThreadPoolTest, RunTask) { +diff --git a/cartographer/mapping/internal/2d/pose_graph_2d.cc b/cartographer/mapping/internal/2d/pose_graph_2d.cc +index 060277e..e912442 100644 +--- a/cartographer/mapping/internal/2d/pose_graph_2d.cc ++++ b/cartographer/mapping/internal/2d/pose_graph_2d.cc +@@ -164,7 +164,7 @@ NodeId PoseGraph2D::AddNode( + // execute the lambda. + const bool newly_finished_submap = + insertion_submaps.front()->insertion_finished(); +- AddWorkItem([=]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { + return ComputeConstraintsForNode(node_id, insertion_submaps, + newly_finished_submap); + }); +@@ -208,7 +208,7 @@ void PoseGraph2D::AddTrajectoryIfNeeded(const int trajectory_id) { + + void PoseGraph2D::AddImuData(const int trajectory_id, + const sensor::ImuData& imu_data) { +- AddWorkItem([=]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + if (CanAddWorkItemModifying(trajectory_id)) { + optimization_problem_->AddImuData(trajectory_id, imu_data); +@@ -219,7 +219,7 @@ void PoseGraph2D::AddImuData(const int trajectory_id, + + void PoseGraph2D::AddOdometryData(const int trajectory_id, + const sensor::OdometryData& odometry_data) { +- AddWorkItem([=]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + if (CanAddWorkItemModifying(trajectory_id)) { + optimization_problem_->AddOdometryData(trajectory_id, odometry_data); +@@ -231,7 +231,7 @@ void PoseGraph2D::AddOdometryData(const int trajectory_id, + void PoseGraph2D::AddFixedFramePoseData( + const int trajectory_id, + const sensor::FixedFramePoseData& fixed_frame_pose_data) { +- AddWorkItem([=]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + if (CanAddWorkItemModifying(trajectory_id)) { + optimization_problem_->AddFixedFramePoseData(trajectory_id, +@@ -243,7 +243,7 @@ void PoseGraph2D::AddFixedFramePoseData( + + void PoseGraph2D::AddLandmarkData(int trajectory_id, + const sensor::LandmarkData& landmark_data) { +- AddWorkItem([=]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + if (CanAddWorkItemModifying(trajectory_id)) { + for (const auto& observation : landmark_data.landmark_observations) { +@@ -572,7 +572,7 @@ void PoseGraph2D::WaitForAllComputations() { + // a WhenDone() callback. + { + const auto predicate = [this]() +- EXCLUSIVE_LOCKS_REQUIRED(work_queue_mutex_) { ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_queue_mutex_) { + return work_queue_ == nullptr; + }; + absl::MutexLock locker(&work_queue_mutex_); +@@ -589,13 +589,13 @@ void PoseGraph2D::WaitForAllComputations() { + constraint_builder_.WhenDone( + [this, + ¬ification](const constraints::ConstraintBuilder2D::Result& result) +- LOCKS_EXCLUDED(mutex_) { ++ ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + data_.constraints.insert(data_.constraints.end(), result.begin(), + result.end()); + notification = true; + }); +- const auto predicate = [¬ification]() EXCLUSIVE_LOCKS_REQUIRED(mutex_) { ++ const auto predicate = [¬ification]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_) { + return notification; + }; + while (!mutex_.AwaitWithTimeout(absl::Condition(&predicate), +@@ -618,7 +618,7 @@ void PoseGraph2D::DeleteTrajectory(const int trajectory_id) { + it->second.deletion_state = + InternalTrajectoryState::DeletionState::SCHEDULED_FOR_DELETION; + } +- AddWorkItem([this, trajectory_id]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([this, trajectory_id]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + CHECK(data_.trajectories_state.at(trajectory_id).state != + TrajectoryState::ACTIVE); +@@ -633,7 +633,7 @@ void PoseGraph2D::DeleteTrajectory(const int trajectory_id) { + } + + void PoseGraph2D::FinishTrajectory(const int trajectory_id) { +- AddWorkItem([this, trajectory_id]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([this, trajectory_id]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + CHECK(!IsTrajectoryFinished(trajectory_id)); + data_.trajectories_state[trajectory_id].state = TrajectoryState::FINISHED; +@@ -656,7 +656,7 @@ void PoseGraph2D::FreezeTrajectory(const int trajectory_id) { + absl::MutexLock locker(&mutex_); + data_.trajectory_connectivity_state.Add(trajectory_id); + } +- AddWorkItem([this, trajectory_id]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([this, trajectory_id]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + CHECK(!IsTrajectoryFrozen(trajectory_id)); + // Connect multiple frozen trajectories among each other. +@@ -720,7 +720,7 @@ void PoseGraph2D::AddSubmapFromProto( + } + + AddWorkItem( +- [this, submap_id, global_submap_pose_2d]() LOCKS_EXCLUDED(mutex_) { ++ [this, submap_id, global_submap_pose_2d]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + data_.submap_data.at(submap_id).state = SubmapState::kFinished; + optimization_problem_->InsertSubmap(submap_id, global_submap_pose_2d); +@@ -743,7 +743,7 @@ void PoseGraph2D::AddNodeFromProto(const transform::Rigid3d& global_pose, + TrajectoryNode{constant_data, global_pose}); + } + +- AddWorkItem([this, node_id, global_pose]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([this, node_id, global_pose]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + const auto& constant_data = + data_.trajectory_nodes.at(node_id).constant_data; +@@ -772,7 +772,7 @@ void PoseGraph2D::SetTrajectoryDataFromProto( + + const int trajectory_id = data.trajectory_id(); + AddWorkItem([this, trajectory_id, trajectory_data]() +- LOCKS_EXCLUDED(mutex_) { ++ ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + if (CanAddWorkItemModifying(trajectory_id)) { + optimization_problem_->SetTrajectoryData( +@@ -785,7 +785,7 @@ void PoseGraph2D::SetTrajectoryDataFromProto( + + void PoseGraph2D::AddNodeToSubmap(const NodeId& node_id, + const SubmapId& submap_id) { +- AddWorkItem([this, node_id, submap_id]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([this, node_id, submap_id]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + if (CanAddWorkItemModifying(submap_id.trajectory_id)) { + data_.submap_data.at(submap_id).node_ids.insert(node_id); +@@ -796,7 +796,7 @@ void PoseGraph2D::AddNodeToSubmap(const NodeId& node_id, + + void PoseGraph2D::AddSerializedConstraints( + const std::vector& constraints) { +- AddWorkItem([this, constraints]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([this, constraints]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + for (const auto& constraint : constraints) { + CHECK(data_.trajectory_nodes.Contains(constraint.node_id)); +@@ -831,7 +831,7 @@ void PoseGraph2D::AddSerializedConstraints( + void PoseGraph2D::AddTrimmer(std::unique_ptr trimmer) { + // C++11 does not allow us to move a unique_ptr into a lambda. + PoseGraphTrimmer* const trimmer_ptr = trimmer.release(); +- AddWorkItem([this, trimmer_ptr]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([this, trimmer_ptr]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + trimmers_.emplace_back(trimmer_ptr); + return WorkItem::Result::kDoNotRunOptimization; +@@ -840,13 +840,13 @@ void PoseGraph2D::AddTrimmer(std::unique_ptr trimmer) { + + void PoseGraph2D::RunFinalOptimization() { + { +- AddWorkItem([this]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([this]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + optimization_problem_->SetMaxNumIterations( + options_.max_num_final_iterations()); + return WorkItem::Result::kRunOptimization; + }); +- AddWorkItem([this]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([this]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + optimization_problem_->SetMaxNumIterations( + options_.optimization_problem_options() +@@ -985,7 +985,7 @@ std::map PoseGraph2D::GetLandmarkPoses() + void PoseGraph2D::SetLandmarkPose(const std::string& landmark_id, + const transform::Rigid3d& global_pose, + const bool frozen) { +- AddWorkItem([=]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + data_.landmark_nodes[landmark_id].global_landmark_pose = global_pose; + data_.landmark_nodes[landmark_id].frozen = frozen; +diff --git a/cartographer/mapping/internal/2d/pose_graph_2d.h b/cartographer/mapping/internal/2d/pose_graph_2d.h +index 3733425..a90174b 100644 +--- a/cartographer/mapping/internal/2d/pose_graph_2d.h ++++ b/cartographer/mapping/internal/2d/pose_graph_2d.h +@@ -81,28 +81,28 @@ class PoseGraph2D : public PoseGraph { + std::shared_ptr constant_data, + int trajectory_id, + const std::vector>& insertion_submaps) +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + + void AddImuData(int trajectory_id, const sensor::ImuData& imu_data) override +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + void AddOdometryData(int trajectory_id, + const sensor::OdometryData& odometry_data) override +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + void AddFixedFramePoseData( + int trajectory_id, + const sensor::FixedFramePoseData& fixed_frame_pose_data) override +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + void AddLandmarkData(int trajectory_id, + const sensor::LandmarkData& landmark_data) override +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + + void DeleteTrajectory(int trajectory_id) override; + void FinishTrajectory(int trajectory_id) override; + bool IsTrajectoryFinished(int trajectory_id) const override +- EXCLUSIVE_LOCKS_REQUIRED(mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + void FreezeTrajectory(int trajectory_id) override; + bool IsTrajectoryFrozen(int trajectory_id) const override +- EXCLUSIVE_LOCKS_REQUIRED(mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + void AddSubmapFromProto(const transform::Rigid3d& global_submap_pose, + const proto::Submap& submap) override; + void AddNodeFromProto(const transform::Rigid3d& global_pose, +@@ -115,61 +115,61 @@ class PoseGraph2D : public PoseGraph { + void AddTrimmer(std::unique_ptr trimmer) override; + void RunFinalOptimization() override; + std::vector> GetConnectedTrajectories() const override +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + PoseGraphInterface::SubmapData GetSubmapData(const SubmapId& submap_id) const +- LOCKS_EXCLUDED(mutex_) override; ++ ABSL_LOCKS_EXCLUDED(mutex_) override; + MapById GetAllSubmapData() const +- LOCKS_EXCLUDED(mutex_) override; ++ ABSL_LOCKS_EXCLUDED(mutex_) override; + MapById GetAllSubmapPoses() const +- LOCKS_EXCLUDED(mutex_) override; ++ ABSL_LOCKS_EXCLUDED(mutex_) override; + transform::Rigid3d GetLocalToGlobalTransform(int trajectory_id) const +- LOCKS_EXCLUDED(mutex_) override; ++ ABSL_LOCKS_EXCLUDED(mutex_) override; + MapById GetTrajectoryNodes() const override +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + MapById GetTrajectoryNodePoses() const override +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + std::map GetTrajectoryStates() const override +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + std::map GetLandmarkPoses() const override +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + void SetLandmarkPose(const std::string& landmark_id, + const transform::Rigid3d& global_pose, + const bool frozen = false) override +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + sensor::MapByTime GetImuData() const override +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + sensor::MapByTime GetOdometryData() const override +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + sensor::MapByTime GetFixedFramePoseData() +- const override LOCKS_EXCLUDED(mutex_); ++ const override ABSL_LOCKS_EXCLUDED(mutex_); + std::map +- GetLandmarkNodes() const override LOCKS_EXCLUDED(mutex_); ++ GetLandmarkNodes() const override ABSL_LOCKS_EXCLUDED(mutex_); + std::map GetTrajectoryData() const override +- LOCKS_EXCLUDED(mutex_); +- std::vector constraints() const override LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); ++ std::vector constraints() const override ABSL_LOCKS_EXCLUDED(mutex_); + void SetInitialTrajectoryPose(int from_trajectory_id, int to_trajectory_id, + const transform::Rigid3d& pose, + const common::Time time) override +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + void SetGlobalSlamOptimizationCallback( + PoseGraphInterface::GlobalSlamOptimizationCallback callback) override; + transform::Rigid3d GetInterpolatedGlobalTrajectoryPose( + int trajectory_id, const common::Time time) const +- EXCLUSIVE_LOCKS_REQUIRED(mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + + static void RegisterMetrics(metrics::FamilyFactory* family_factory); + + private: + MapById GetSubmapDataUnderLock() +- const EXCLUSIVE_LOCKS_REQUIRED(mutex_); ++ const ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + + // Handles a new work item. + void AddWorkItem(const std::function& work_item) +- LOCKS_EXCLUDED(mutex_) LOCKS_EXCLUDED(work_queue_mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_) ABSL_LOCKS_EXCLUDED(work_queue_mutex_); + + // Adds connectivity and sampler for a trajectory if it does not exist. + void AddTrajectoryIfNeeded(int trajectory_id) +- EXCLUSIVE_LOCKS_REQUIRED(mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + + // Appends the new node and submap (if needed) to the internal data + // structures. +@@ -177,66 +177,66 @@ class PoseGraph2D : public PoseGraph { + std::shared_ptr constant_data, + int trajectory_id, + const std::vector>& insertion_submaps, +- const transform::Rigid3d& optimized_pose) LOCKS_EXCLUDED(mutex_); ++ const transform::Rigid3d& optimized_pose) ABSL_LOCKS_EXCLUDED(mutex_); + + // Grows the optimization problem to have an entry for every element of + // 'insertion_submaps'. Returns the IDs for the 'insertion_submaps'. + std::vector InitializeGlobalSubmapPoses( + int trajectory_id, const common::Time time, + const std::vector>& insertion_submaps) +- EXCLUSIVE_LOCKS_REQUIRED(mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + + // Adds constraints for a node, and starts scan matching in the background. + WorkItem::Result ComputeConstraintsForNode( + const NodeId& node_id, + std::vector> insertion_submaps, +- bool newly_finished_submap) LOCKS_EXCLUDED(mutex_); ++ bool newly_finished_submap) ABSL_LOCKS_EXCLUDED(mutex_); + + // Computes constraints for a node and submap pair. + void ComputeConstraint(const NodeId& node_id, const SubmapId& submap_id) +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + + // Deletes trajectories waiting for deletion. Must not be called during + // constraint search. +- void DeleteTrajectoriesIfNeeded() EXCLUSIVE_LOCKS_REQUIRED(mutex_); ++ void DeleteTrajectoriesIfNeeded() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + + // Runs the optimization, executes the trimmers and processes the work queue. + void HandleWorkQueue(const constraints::ConstraintBuilder2D::Result& result) +- LOCKS_EXCLUDED(mutex_) LOCKS_EXCLUDED(work_queue_mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_) ABSL_LOCKS_EXCLUDED(work_queue_mutex_); + + // Process pending tasks in the work queue on the calling thread, until the + // queue is either empty or an optimization is required. +- void DrainWorkQueue() LOCKS_EXCLUDED(mutex_) +- LOCKS_EXCLUDED(work_queue_mutex_); ++ void DrainWorkQueue() ABSL_LOCKS_EXCLUDED(mutex_) ++ ABSL_LOCKS_EXCLUDED(work_queue_mutex_); + + // Waits until we caught up (i.e. nothing is waiting to be scheduled), and + // all computations have finished. +- void WaitForAllComputations() LOCKS_EXCLUDED(mutex_) +- LOCKS_EXCLUDED(work_queue_mutex_); ++ void WaitForAllComputations() ABSL_LOCKS_EXCLUDED(mutex_) ++ ABSL_LOCKS_EXCLUDED(work_queue_mutex_); + + // Runs the optimization. Callers have to make sure, that there is only one + // optimization being run at a time. +- void RunOptimization() LOCKS_EXCLUDED(mutex_); ++ void RunOptimization() ABSL_LOCKS_EXCLUDED(mutex_); + + bool CanAddWorkItemModifying(int trajectory_id) +- EXCLUSIVE_LOCKS_REQUIRED(mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + + // Computes the local to global map frame transform based on the given + // 'global_submap_poses'. + transform::Rigid3d ComputeLocalToGlobalTransform( + const MapById& global_submap_poses, +- int trajectory_id) const EXCLUSIVE_LOCKS_REQUIRED(mutex_); ++ int trajectory_id) const ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + + SubmapData GetSubmapDataUnderLock(const SubmapId& submap_id) const +- EXCLUSIVE_LOCKS_REQUIRED(mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + + common::Time GetLatestNodeTime(const NodeId& node_id, + const SubmapId& submap_id) const +- EXCLUSIVE_LOCKS_REQUIRED(mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + + // Updates the trajectory connectivity structure with a new constraint. + void UpdateTrajectoryConnectivity(const Constraint& constraint) +- EXCLUSIVE_LOCKS_REQUIRED(mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + + const proto::PoseGraphOptions options_; + GlobalSlamOptimizationCallback global_slam_optimization_callback_; +@@ -245,14 +245,14 @@ class PoseGraph2D : public PoseGraph { + + // If it exists, further work items must be added to this queue, and will be + // considered later. +- std::unique_ptr work_queue_ GUARDED_BY(work_queue_mutex_); ++ std::unique_ptr work_queue_ ABSL_GUARDED_BY(work_queue_mutex_); + + // We globally localize a fraction of the nodes from each trajectory. + absl::flat_hash_map> +- global_localization_samplers_ GUARDED_BY(mutex_); ++ global_localization_samplers_ ABSL_GUARDED_BY(mutex_); + + // Number of nodes added since last loop closure. +- int num_nodes_since_last_loop_closure_ GUARDED_BY(mutex_) = 0; ++ int num_nodes_since_last_loop_closure_ ABSL_GUARDED_BY(mutex_) = 0; + + // Current optimization problem. + std::unique_ptr optimization_problem_; +@@ -262,9 +262,9 @@ class PoseGraph2D : public PoseGraph { + common::ThreadPool* const thread_pool_; + + // List of all trimmers to consult when optimizations finish. +- std::vector> trimmers_ GUARDED_BY(mutex_); ++ std::vector> trimmers_ ABSL_GUARDED_BY(mutex_); + +- PoseGraphData data_ GUARDED_BY(mutex_); ++ PoseGraphData data_ ABSL_GUARDED_BY(mutex_); + + ValueConversionTables conversion_tables_; + +@@ -278,17 +278,17 @@ class PoseGraph2D : public PoseGraph { + int num_submaps(int trajectory_id) const override; + std::vector GetSubmapIds(int trajectory_id) const override; + MapById GetOptimizedSubmapData() const override +- EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); + const MapById& GetTrajectoryNodes() const override +- EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); + const std::vector& GetConstraints() const override +- EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); + void TrimSubmap(const SubmapId& submap_id) +- EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_) override; ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_) override; + bool IsFinished(int trajectory_id) const override +- EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); + void SetTrajectoryState(int trajectory_id, TrajectoryState state) override +- EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); + + private: + PoseGraph2D* const parent_; +diff --git a/cartographer/mapping/internal/3d/pose_graph_3d.cc b/cartographer/mapping/internal/3d/pose_graph_3d.cc +index 8a91e59..26a8677 100644 +--- a/cartographer/mapping/internal/3d/pose_graph_3d.cc ++++ b/cartographer/mapping/internal/3d/pose_graph_3d.cc +@@ -152,7 +152,7 @@ NodeId PoseGraph3D::AddNode( + // execute the lambda. + const bool newly_finished_submap = + insertion_submaps.front()->insertion_finished(); +- AddWorkItem([=]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { + return ComputeConstraintsForNode(node_id, insertion_submaps, + newly_finished_submap); + }); +@@ -196,7 +196,7 @@ void PoseGraph3D::AddTrajectoryIfNeeded(const int trajectory_id) { + + void PoseGraph3D::AddImuData(const int trajectory_id, + const sensor::ImuData& imu_data) { +- AddWorkItem([=]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + if (CanAddWorkItemModifying(trajectory_id)) { + optimization_problem_->AddImuData(trajectory_id, imu_data); +@@ -207,7 +207,7 @@ void PoseGraph3D::AddImuData(const int trajectory_id, + + void PoseGraph3D::AddOdometryData(const int trajectory_id, + const sensor::OdometryData& odometry_data) { +- AddWorkItem([=]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + if (CanAddWorkItemModifying(trajectory_id)) { + optimization_problem_->AddOdometryData(trajectory_id, odometry_data); +@@ -219,7 +219,7 @@ void PoseGraph3D::AddOdometryData(const int trajectory_id, + void PoseGraph3D::AddFixedFramePoseData( + const int trajectory_id, + const sensor::FixedFramePoseData& fixed_frame_pose_data) { +- AddWorkItem([=]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + if (CanAddWorkItemModifying(trajectory_id)) { + optimization_problem_->AddFixedFramePoseData(trajectory_id, +@@ -231,7 +231,7 @@ void PoseGraph3D::AddFixedFramePoseData( + + void PoseGraph3D::AddLandmarkData(int trajectory_id, + const sensor::LandmarkData& landmark_data) { +- AddWorkItem([=]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + if (CanAddWorkItemModifying(trajectory_id)) { + for (const auto& observation : landmark_data.landmark_observations) { +@@ -559,7 +559,7 @@ void PoseGraph3D::WaitForAllComputations() { + // a WhenDone() callback. + { + const auto predicate = [this]() +- EXCLUSIVE_LOCKS_REQUIRED(work_queue_mutex_) { ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_queue_mutex_) { + return work_queue_ == nullptr; + }; + absl::MutexLock locker(&work_queue_mutex_); +@@ -576,13 +576,13 @@ void PoseGraph3D::WaitForAllComputations() { + constraint_builder_.WhenDone( + [this, + ¬ification](const constraints::ConstraintBuilder3D::Result& result) +- LOCKS_EXCLUDED(mutex_) { ++ ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + data_.constraints.insert(data_.constraints.end(), result.begin(), + result.end()); + notification = true; + }); +- const auto predicate = [¬ification]() EXCLUSIVE_LOCKS_REQUIRED(mutex_) { ++ const auto predicate = [¬ification]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_) { + return notification; + }; + while (!mutex_.AwaitWithTimeout(absl::Condition(&predicate), +@@ -605,7 +605,7 @@ void PoseGraph3D::DeleteTrajectory(const int trajectory_id) { + it->second.deletion_state = + InternalTrajectoryState::DeletionState::SCHEDULED_FOR_DELETION; + } +- AddWorkItem([this, trajectory_id]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([this, trajectory_id]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + CHECK(data_.trajectories_state.at(trajectory_id).state != + TrajectoryState::ACTIVE); +@@ -620,7 +620,7 @@ void PoseGraph3D::DeleteTrajectory(const int trajectory_id) { + } + + void PoseGraph3D::FinishTrajectory(const int trajectory_id) { +- AddWorkItem([this, trajectory_id]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([this, trajectory_id]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + CHECK(!IsTrajectoryFinished(trajectory_id)); + data_.trajectories_state[trajectory_id].state = TrajectoryState::FINISHED; +@@ -643,7 +643,7 @@ void PoseGraph3D::FreezeTrajectory(const int trajectory_id) { + absl::MutexLock locker(&mutex_); + data_.trajectory_connectivity_state.Add(trajectory_id); + } +- AddWorkItem([this, trajectory_id]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([this, trajectory_id]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + CHECK(!IsTrajectoryFrozen(trajectory_id)); + // Connect multiple frozen trajectories among each other. +@@ -703,7 +703,7 @@ void PoseGraph3D::AddSubmapFromProto( + kActiveSubmapsMetric->Increment(); + } + +- AddWorkItem([this, submap_id, global_submap_pose]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([this, submap_id, global_submap_pose]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + data_.submap_data.at(submap_id).state = SubmapState::kFinished; + optimization_problem_->InsertSubmap(submap_id, global_submap_pose); +@@ -726,7 +726,7 @@ void PoseGraph3D::AddNodeFromProto(const transform::Rigid3d& global_pose, + TrajectoryNode{constant_data, global_pose}); + } + +- AddWorkItem([this, node_id, global_pose]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([this, node_id, global_pose]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + const auto& constant_data = + data_.trajectory_nodes.at(node_id).constant_data; +@@ -751,7 +751,7 @@ void PoseGraph3D::SetTrajectoryDataFromProto( + } + + const int trajectory_id = data.trajectory_id(); +- AddWorkItem([this, trajectory_id, trajectory_data]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([this, trajectory_id, trajectory_data]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + if (CanAddWorkItemModifying(trajectory_id)) { + optimization_problem_->SetTrajectoryData(trajectory_id, trajectory_data); +@@ -762,7 +762,7 @@ void PoseGraph3D::SetTrajectoryDataFromProto( + + void PoseGraph3D::AddNodeToSubmap(const NodeId& node_id, + const SubmapId& submap_id) { +- AddWorkItem([this, node_id, submap_id]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([this, node_id, submap_id]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + if (CanAddWorkItemModifying(submap_id.trajectory_id)) { + data_.submap_data.at(submap_id).node_ids.insert(node_id); +@@ -773,7 +773,7 @@ void PoseGraph3D::AddNodeToSubmap(const NodeId& node_id, + + void PoseGraph3D::AddSerializedConstraints( + const std::vector& constraints) { +- AddWorkItem([this, constraints]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([this, constraints]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + for (const auto& constraint : constraints) { + CHECK(data_.trajectory_nodes.Contains(constraint.node_id)); +@@ -801,7 +801,7 @@ void PoseGraph3D::AddSerializedConstraints( + void PoseGraph3D::AddTrimmer(std::unique_ptr trimmer) { + // C++11 does not allow us to move a unique_ptr into a lambda. + PoseGraphTrimmer* const trimmer_ptr = trimmer.release(); +- AddWorkItem([this, trimmer_ptr]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([this, trimmer_ptr]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + trimmers_.emplace_back(trimmer_ptr); + return WorkItem::Result::kDoNotRunOptimization; +@@ -810,13 +810,13 @@ void PoseGraph3D::AddTrimmer(std::unique_ptr trimmer) { + + void PoseGraph3D::RunFinalOptimization() { + { +- AddWorkItem([this]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([this]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + optimization_problem_->SetMaxNumIterations( + options_.max_num_final_iterations()); + return WorkItem::Result::kRunOptimization; + }); +- AddWorkItem([this]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([this]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + optimization_problem_->SetMaxNumIterations( + options_.optimization_problem_options() +@@ -982,7 +982,7 @@ std::map PoseGraph3D::GetLandmarkPoses() + void PoseGraph3D::SetLandmarkPose(const std::string& landmark_id, + const transform::Rigid3d& global_pose, + const bool frozen) { +- AddWorkItem([=]() LOCKS_EXCLUDED(mutex_) { ++ AddWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { + absl::MutexLock locker(&mutex_); + data_.landmark_nodes[landmark_id].global_landmark_pose = global_pose; + data_.landmark_nodes[landmark_id].frozen = frozen; +diff --git a/cartographer/mapping/internal/3d/pose_graph_3d.h b/cartographer/mapping/internal/3d/pose_graph_3d.h +index 12a3469..f38f20a 100644 +--- a/cartographer/mapping/internal/3d/pose_graph_3d.h ++++ b/cartographer/mapping/internal/3d/pose_graph_3d.h +@@ -79,28 +79,28 @@ class PoseGraph3D : public PoseGraph { + std::shared_ptr constant_data, + int trajectory_id, + const std::vector>& insertion_submaps) +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + + void AddImuData(int trajectory_id, const sensor::ImuData& imu_data) override +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + void AddOdometryData(int trajectory_id, + const sensor::OdometryData& odometry_data) override +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + void AddFixedFramePoseData( + int trajectory_id, + const sensor::FixedFramePoseData& fixed_frame_pose_data) override +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + void AddLandmarkData(int trajectory_id, + const sensor::LandmarkData& landmark_data) override +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + + void DeleteTrajectory(int trajectory_id) override; + void FinishTrajectory(int trajectory_id) override; + bool IsTrajectoryFinished(int trajectory_id) const override +- EXCLUSIVE_LOCKS_REQUIRED(mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + void FreezeTrajectory(int trajectory_id) override; + bool IsTrajectoryFrozen(int trajectory_id) const override +- EXCLUSIVE_LOCKS_REQUIRED(mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + void AddSubmapFromProto(const transform::Rigid3d& global_submap_pose, + const proto::Submap& submap) override; + void AddNodeFromProto(const transform::Rigid3d& global_pose, +@@ -113,132 +113,132 @@ class PoseGraph3D : public PoseGraph { + void AddTrimmer(std::unique_ptr trimmer) override; + void RunFinalOptimization() override; + std::vector> GetConnectedTrajectories() const override +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + PoseGraph::SubmapData GetSubmapData(const SubmapId& submap_id) const +- LOCKS_EXCLUDED(mutex_) override; ++ ABSL_LOCKS_EXCLUDED(mutex_) override; + MapById GetAllSubmapData() const +- LOCKS_EXCLUDED(mutex_) override; ++ ABSL_LOCKS_EXCLUDED(mutex_) override; + MapById GetAllSubmapPoses() const +- LOCKS_EXCLUDED(mutex_) override; ++ ABSL_LOCKS_EXCLUDED(mutex_) override; + transform::Rigid3d GetLocalToGlobalTransform(int trajectory_id) const +- LOCKS_EXCLUDED(mutex_) override; ++ ABSL_LOCKS_EXCLUDED(mutex_) override; + MapById GetTrajectoryNodes() const override +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + MapById GetTrajectoryNodePoses() const override +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + std::map GetTrajectoryStates() const override +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + std::map GetLandmarkPoses() const override +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + void SetLandmarkPose(const std::string& landmark_id, + const transform::Rigid3d& global_pose, + const bool frozen = false) override +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + sensor::MapByTime GetImuData() const override +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + sensor::MapByTime GetOdometryData() const override +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + sensor::MapByTime GetFixedFramePoseData() +- const override LOCKS_EXCLUDED(mutex_); ++ const override ABSL_LOCKS_EXCLUDED(mutex_); + std::map +- GetLandmarkNodes() const override LOCKS_EXCLUDED(mutex_); ++ GetLandmarkNodes() const override ABSL_LOCKS_EXCLUDED(mutex_); + std::map GetTrajectoryData() const override; + +- std::vector constraints() const override LOCKS_EXCLUDED(mutex_); ++ std::vector constraints() const override ABSL_LOCKS_EXCLUDED(mutex_); + void SetInitialTrajectoryPose(int from_trajectory_id, int to_trajectory_id, + const transform::Rigid3d& pose, + const common::Time time) override +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + void SetGlobalSlamOptimizationCallback( + PoseGraphInterface::GlobalSlamOptimizationCallback callback) override; + transform::Rigid3d GetInterpolatedGlobalTrajectoryPose( + int trajectory_id, const common::Time time) const +- EXCLUSIVE_LOCKS_REQUIRED(mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + + static void RegisterMetrics(metrics::FamilyFactory* family_factory); + + protected: + // Waits until we caught up (i.e. nothing is waiting to be scheduled), and + // all computations have finished. +- void WaitForAllComputations() LOCKS_EXCLUDED(mutex_) +- LOCKS_EXCLUDED(work_queue_mutex_); ++ void WaitForAllComputations() ABSL_LOCKS_EXCLUDED(mutex_) ++ ABSL_LOCKS_EXCLUDED(work_queue_mutex_); + + private: + MapById GetSubmapDataUnderLock() const +- EXCLUSIVE_LOCKS_REQUIRED(mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + + // Handles a new work item. + void AddWorkItem(const std::function& work_item) +- LOCKS_EXCLUDED(mutex_) LOCKS_EXCLUDED(work_queue_mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_) ABSL_LOCKS_EXCLUDED(work_queue_mutex_); + + // Adds connectivity and sampler for a trajectory if it does not exist. + void AddTrajectoryIfNeeded(int trajectory_id) +- EXCLUSIVE_LOCKS_REQUIRED(mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + + // Appends the new node and submap (if needed) to the internal data stuctures. + NodeId AppendNode( + std::shared_ptr constant_data, + int trajectory_id, + const std::vector>& insertion_submaps, +- const transform::Rigid3d& optimized_pose) LOCKS_EXCLUDED(mutex_); ++ const transform::Rigid3d& optimized_pose) ABSL_LOCKS_EXCLUDED(mutex_); + + // Grows the optimization problem to have an entry for every element of + // 'insertion_submaps'. Returns the IDs for the 'insertion_submaps'. + std::vector InitializeGlobalSubmapPoses( + int trajectory_id, const common::Time time, + const std::vector>& insertion_submaps) +- EXCLUSIVE_LOCKS_REQUIRED(mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + + // Adds constraints for a node, and starts scan matching in the background. + WorkItem::Result ComputeConstraintsForNode( + const NodeId& node_id, + std::vector> insertion_submaps, +- bool newly_finished_submap) LOCKS_EXCLUDED(mutex_); ++ bool newly_finished_submap) ABSL_LOCKS_EXCLUDED(mutex_); + + // Computes constraints for a node and submap pair. + void ComputeConstraint(const NodeId& node_id, const SubmapId& submap_id) +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + + // Deletes trajectories waiting for deletion. Must not be called during + // constraint search. +- void DeleteTrajectoriesIfNeeded() EXCLUSIVE_LOCKS_REQUIRED(mutex_); ++ void DeleteTrajectoriesIfNeeded() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + + // Runs the optimization, executes the trimmers and processes the work queue. + void HandleWorkQueue(const constraints::ConstraintBuilder3D::Result& result) +- LOCKS_EXCLUDED(mutex_) LOCKS_EXCLUDED(work_queue_mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_) ABSL_LOCKS_EXCLUDED(work_queue_mutex_); + + // Process pending tasks in the work queue on the calling thread, until the + // queue is either empty or an optimization is required. +- void DrainWorkQueue() LOCKS_EXCLUDED(mutex_) +- LOCKS_EXCLUDED(work_queue_mutex_); ++ void DrainWorkQueue() ABSL_LOCKS_EXCLUDED(mutex_) ++ ABSL_LOCKS_EXCLUDED(work_queue_mutex_); + + // Runs the optimization. Callers have to make sure, that there is only one + // optimization being run at a time. +- void RunOptimization() LOCKS_EXCLUDED(mutex_); ++ void RunOptimization() ABSL_LOCKS_EXCLUDED(mutex_); + + bool CanAddWorkItemModifying(int trajectory_id) +- EXCLUSIVE_LOCKS_REQUIRED(mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + + // Computes the local to global map frame transform based on the given + // 'global_submap_poses'. + transform::Rigid3d ComputeLocalToGlobalTransform( + const MapById& global_submap_poses, +- int trajectory_id) const EXCLUSIVE_LOCKS_REQUIRED(mutex_); ++ int trajectory_id) const ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + + PoseGraph::SubmapData GetSubmapDataUnderLock(const SubmapId& submap_id) const +- EXCLUSIVE_LOCKS_REQUIRED(mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + + common::Time GetLatestNodeTime(const NodeId& node_id, + const SubmapId& submap_id) const +- EXCLUSIVE_LOCKS_REQUIRED(mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + + // Logs histograms for the translational and rotational residual of node + // poses. +- void LogResidualHistograms() const EXCLUSIVE_LOCKS_REQUIRED(mutex_); ++ void LogResidualHistograms() const ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + + // Updates the trajectory connectivity structure with a new constraint. + void UpdateTrajectoryConnectivity(const Constraint& constraint) +- EXCLUSIVE_LOCKS_REQUIRED(mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + + const proto::PoseGraphOptions options_; + GlobalSlamOptimizationCallback global_slam_optimization_callback_; +@@ -247,14 +247,14 @@ class PoseGraph3D : public PoseGraph { + + // If it exists, further work items must be added to this queue, and will be + // considered later. +- std::unique_ptr work_queue_ GUARDED_BY(work_queue_mutex_); ++ std::unique_ptr work_queue_ ABSL_GUARDED_BY(work_queue_mutex_); + + // We globally localize a fraction of the nodes from each trajectory. + absl::flat_hash_map> +- global_localization_samplers_ GUARDED_BY(mutex_); ++ global_localization_samplers_ ABSL_GUARDED_BY(mutex_); + + // Number of nodes added since last loop closure. +- int num_nodes_since_last_loop_closure_ GUARDED_BY(mutex_) = 0; ++ int num_nodes_since_last_loop_closure_ ABSL_GUARDED_BY(mutex_) = 0; + + // Current optimization problem. + std::unique_ptr optimization_problem_; +@@ -264,9 +264,9 @@ class PoseGraph3D : public PoseGraph { + common::ThreadPool* const thread_pool_; + + // List of all trimmers to consult when optimizations finish. +- std::vector> trimmers_ GUARDED_BY(mutex_); ++ std::vector> trimmers_ ABSL_GUARDED_BY(mutex_); + +- PoseGraphData data_ GUARDED_BY(mutex_); ++ PoseGraphData data_ ABSL_GUARDED_BY(mutex_); + + // Allows querying and manipulating the pose graph by the 'trimmers_'. The + // 'mutex_' of the pose graph is held while this class is used. +@@ -278,18 +278,18 @@ class PoseGraph3D : public PoseGraph { + int num_submaps(int trajectory_id) const override; + std::vector GetSubmapIds(int trajectory_id) const override; + MapById GetOptimizedSubmapData() const override +- EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); + const MapById& GetTrajectoryNodes() const override +- EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); + const std::vector& GetConstraints() const override +- EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); + void TrimSubmap(const SubmapId& submap_id) +- EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_) override; ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_) override; + bool IsFinished(int trajectory_id) const override +- EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); + + void SetTrajectoryState(int trajectory_id, TrajectoryState state) override +- EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); + + private: + PoseGraph3D* const parent_; +diff --git a/cartographer/mapping/internal/connected_components.h b/cartographer/mapping/internal/connected_components.h +index 05f327e..bc9cb69 100644 +--- a/cartographer/mapping/internal/connected_components.h ++++ b/cartographer/mapping/internal/connected_components.h +@@ -41,45 +41,45 @@ class ConnectedComponents { + ConnectedComponents& operator=(const ConnectedComponents&) = delete; + + // Add a trajectory which is initially connected to only itself. +- void Add(int trajectory_id) LOCKS_EXCLUDED(lock_); ++ void Add(int trajectory_id) ABSL_LOCKS_EXCLUDED(lock_); + + // Connect two trajectories. If either trajectory is untracked, it will be + // tracked. This function is invariant to the order of its arguments. Repeated + // calls to Connect increment the connectivity count. +- void Connect(int trajectory_id_a, int trajectory_id_b) LOCKS_EXCLUDED(lock_); ++ void Connect(int trajectory_id_a, int trajectory_id_b) ABSL_LOCKS_EXCLUDED(lock_); + + // Determines if two trajectories have been (transitively) connected. If + // either trajectory is not being tracked, returns false, except when it is + // the same trajectory, where it returns true. This function is invariant to + // the order of its arguments. + bool TransitivelyConnected(int trajectory_id_a, int trajectory_id_b) +- LOCKS_EXCLUDED(lock_); ++ ABSL_LOCKS_EXCLUDED(lock_); + + // Return the number of _direct_ connections between 'trajectory_id_a' and + // 'trajectory_id_b'. If either trajectory is not being tracked, returns 0. + // This function is invariant to the order of its arguments. + int ConnectionCount(int trajectory_id_a, int trajectory_id_b) +- LOCKS_EXCLUDED(lock_); ++ ABSL_LOCKS_EXCLUDED(lock_); + + // The trajectory IDs, grouped by connectivity. +- std::vector> Components() LOCKS_EXCLUDED(lock_); ++ std::vector> Components() ABSL_LOCKS_EXCLUDED(lock_); + + // The list of trajectory IDs that belong to the same connected component as + // 'trajectory_id'. +- std::vector GetComponent(int trajectory_id) LOCKS_EXCLUDED(lock_); ++ std::vector GetComponent(int trajectory_id) ABSL_LOCKS_EXCLUDED(lock_); + + private: + // Find the representative and compresses the path to it. +- int FindSet(int trajectory_id) EXCLUSIVE_LOCKS_REQUIRED(lock_); ++ int FindSet(int trajectory_id) ABSL_EXCLUSIVE_LOCKS_REQUIRED(lock_); + void Union(int trajectory_id_a, int trajectory_id_b) +- EXCLUSIVE_LOCKS_REQUIRED(lock_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(lock_); + + absl::Mutex lock_; + // Tracks transitive connectivity using a disjoint set forest, i.e. each + // entry points towards the representative for the given trajectory. +- std::map forest_ GUARDED_BY(lock_); ++ std::map forest_ ABSL_GUARDED_BY(lock_); + // Tracks the number of direct connections between a pair of trajectories. +- std::map, int> connection_map_ GUARDED_BY(lock_); ++ std::map, int> connection_map_ ABSL_GUARDED_BY(lock_); + }; + + // Returns a proto encoding connected components. +diff --git a/cartographer/mapping/internal/constraints/constraint_builder_2d.cc b/cartographer/mapping/internal/constraints/constraint_builder_2d.cc +index ad3dfb7..32c88a4 100644 +--- a/cartographer/mapping/internal/constraints/constraint_builder_2d.cc ++++ b/cartographer/mapping/internal/constraints/constraint_builder_2d.cc +@@ -100,7 +100,7 @@ void ConstraintBuilder2D::MaybeAddConstraint( + const auto* scan_matcher = + DispatchScanMatcherConstruction(submap_id, submap->grid()); + auto constraint_task = absl::make_unique(); +- constraint_task->SetWorkItem([=]() LOCKS_EXCLUDED(mutex_) { ++ constraint_task->SetWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { + ComputeConstraint(submap_id, submap, node_id, false, /* match_full_submap */ + constant_data, initial_relative_pose, *scan_matcher, + constraint); +@@ -125,7 +125,7 @@ void ConstraintBuilder2D::MaybeAddGlobalConstraint( + const auto* scan_matcher = + DispatchScanMatcherConstruction(submap_id, submap->grid()); + auto constraint_task = absl::make_unique(); +- constraint_task->SetWorkItem([=]() LOCKS_EXCLUDED(mutex_) { ++ constraint_task->SetWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { + ComputeConstraint(submap_id, submap, node_id, true, /* match_full_submap */ + constant_data, transform::Rigid2d::Identity(), + *scan_matcher, constraint); +diff --git a/cartographer/mapping/internal/constraints/constraint_builder_2d.h b/cartographer/mapping/internal/constraints/constraint_builder_2d.h +index 6667fdb..b61f64c 100644 +--- a/cartographer/mapping/internal/constraints/constraint_builder_2d.h ++++ b/cartographer/mapping/internal/constraints/constraint_builder_2d.h +@@ -118,7 +118,7 @@ class ConstraintBuilder2D { + // accessed after 'creation_task_handle' has completed. + const SubmapScanMatcher* DispatchScanMatcherConstruction( + const SubmapId& submap_id, const Grid2D* grid) +- EXCLUSIVE_LOCKS_REQUIRED(mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + + // Runs in a background thread and does computations for an additional + // constraint, assuming 'submap' and 'compressed_point_cloud' do not change +@@ -129,9 +129,9 @@ class ConstraintBuilder2D { + const transform::Rigid2d& initial_relative_pose, + const SubmapScanMatcher& submap_scan_matcher, + std::unique_ptr* constraint) +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + +- void RunWhenDoneCallback() LOCKS_EXCLUDED(mutex_); ++ void RunWhenDoneCallback() ABSL_LOCKS_EXCLUDED(mutex_); + + const constraints::proto::ConstraintBuilderOptions options_; + common::ThreadPoolInterface* thread_pool_; +@@ -139,34 +139,34 @@ class ConstraintBuilder2D { + + // 'callback' set by WhenDone(). + std::unique_ptr> when_done_ +- GUARDED_BY(mutex_); ++ ABSL_GUARDED_BY(mutex_); + + // TODO(gaschler): Use atomics instead of mutex to access these counters. + // Number of the node in reaction to which computations are currently + // added. This is always the number of nodes seen so far, even when older + // nodes are matched against a new submap. +- int num_started_nodes_ GUARDED_BY(mutex_) = 0; ++ int num_started_nodes_ ABSL_GUARDED_BY(mutex_) = 0; + +- int num_finished_nodes_ GUARDED_BY(mutex_) = 0; ++ int num_finished_nodes_ ABSL_GUARDED_BY(mutex_) = 0; + +- std::unique_ptr finish_node_task_ GUARDED_BY(mutex_); ++ std::unique_ptr finish_node_task_ ABSL_GUARDED_BY(mutex_); + +- std::unique_ptr when_done_task_ GUARDED_BY(mutex_); ++ std::unique_ptr when_done_task_ ABSL_GUARDED_BY(mutex_); + + // Constraints currently being computed in the background. A deque is used to + // keep pointers valid when adding more entries. Constraint search results + // with below-threshold scores are also 'nullptr'. +- std::deque> constraints_ GUARDED_BY(mutex_); ++ std::deque> constraints_ ABSL_GUARDED_BY(mutex_); + + // Map of dispatched or constructed scan matchers by 'submap_id'. + std::map submap_scan_matchers_ +- GUARDED_BY(mutex_); ++ ABSL_GUARDED_BY(mutex_); + std::map per_submap_sampler_; + + scan_matching::CeresScanMatcher2D ceres_scan_matcher_; + + // Histogram of scan matcher scores. +- common::Histogram score_histogram_ GUARDED_BY(mutex_); ++ common::Histogram score_histogram_ ABSL_GUARDED_BY(mutex_); + }; + + } // namespace constraints +diff --git a/cartographer/mapping/internal/constraints/constraint_builder_3d.cc b/cartographer/mapping/internal/constraints/constraint_builder_3d.cc +index 87b3742..5b46179 100644 +--- a/cartographer/mapping/internal/constraints/constraint_builder_3d.cc ++++ b/cartographer/mapping/internal/constraints/constraint_builder_3d.cc +@@ -102,7 +102,7 @@ void ConstraintBuilder3D::MaybeAddConstraint( + auto* const constraint = &constraints_.back(); + const auto* scan_matcher = DispatchScanMatcherConstruction(submap_id, submap); + auto constraint_task = absl::make_unique(); +- constraint_task->SetWorkItem([=]() LOCKS_EXCLUDED(mutex_) { ++ constraint_task->SetWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { + ComputeConstraint(submap_id, node_id, false, /* match_full_submap */ + constant_data, global_node_pose, global_submap_pose, + *scan_matcher, constraint); +@@ -128,7 +128,7 @@ void ConstraintBuilder3D::MaybeAddGlobalConstraint( + auto* const constraint = &constraints_.back(); + const auto* scan_matcher = DispatchScanMatcherConstruction(submap_id, submap); + auto constraint_task = absl::make_unique(); +- constraint_task->SetWorkItem([=]() LOCKS_EXCLUDED(mutex_) { ++ constraint_task->SetWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { + ComputeConstraint(submap_id, node_id, true, /* match_full_submap */ + constant_data, + transform::Rigid3d::Rotation(global_node_rotation), +diff --git a/cartographer/mapping/internal/constraints/constraint_builder_3d.h b/cartographer/mapping/internal/constraints/constraint_builder_3d.h +index 247a9da..8005ccc 100644 +--- a/cartographer/mapping/internal/constraints/constraint_builder_3d.h ++++ b/cartographer/mapping/internal/constraints/constraint_builder_3d.h +@@ -126,7 +126,7 @@ class ConstraintBuilder3D { + // accessed after 'creation_task_handle' has completed. + const SubmapScanMatcher* DispatchScanMatcherConstruction( + const SubmapId& submap_id, const Submap3D* submap) +- EXCLUSIVE_LOCKS_REQUIRED(mutex_); ++ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + + // Runs in a background thread and does computations for an additional + // constraint. +@@ -138,9 +138,9 @@ class ConstraintBuilder3D { + const transform::Rigid3d& global_submap_pose, + const SubmapScanMatcher& submap_scan_matcher, + std::unique_ptr* constraint) +- LOCKS_EXCLUDED(mutex_); ++ ABSL_LOCKS_EXCLUDED(mutex_); + +- void RunWhenDoneCallback() LOCKS_EXCLUDED(mutex_); ++ void RunWhenDoneCallback() ABSL_LOCKS_EXCLUDED(mutex_); + + const proto::ConstraintBuilderOptions options_; + common::ThreadPoolInterface* thread_pool_; +@@ -148,36 +148,36 @@ class ConstraintBuilder3D { + + // 'callback' set by WhenDone(). + std::unique_ptr> when_done_ +- GUARDED_BY(mutex_); ++ ABSL_GUARDED_BY(mutex_); + + // TODO(gaschler): Use atomics instead of mutex to access these counters. + // Number of the node in reaction to which computations are currently + // added. This is always the number of nodes seen so far, even when older + // nodes are matched against a new submap. +- int num_started_nodes_ GUARDED_BY(mutex_) = 0; ++ int num_started_nodes_ ABSL_GUARDED_BY(mutex_) = 0; + +- int num_finished_nodes_ GUARDED_BY(mutex_) = 0; ++ int num_finished_nodes_ ABSL_GUARDED_BY(mutex_) = 0; + +- std::unique_ptr finish_node_task_ GUARDED_BY(mutex_); ++ std::unique_ptr finish_node_task_ ABSL_GUARDED_BY(mutex_); + +- std::unique_ptr when_done_task_ GUARDED_BY(mutex_); ++ std::unique_ptr when_done_task_ ABSL_GUARDED_BY(mutex_); + + // Constraints currently being computed in the background. A deque is used to + // keep pointers valid when adding more entries. Constraint search results + // with below-threshold scores are also 'nullptr'. +- std::deque> constraints_ GUARDED_BY(mutex_); ++ std::deque> constraints_ ABSL_GUARDED_BY(mutex_); + + // Map of dispatched or constructed scan matchers by 'submap_id'. + std::map submap_scan_matchers_ +- GUARDED_BY(mutex_); ++ ABSL_GUARDED_BY(mutex_); + std::map per_submap_sampler_; + + scan_matching::CeresScanMatcher3D ceres_scan_matcher_; + + // Histograms of scan matcher scores. +- common::Histogram score_histogram_ GUARDED_BY(mutex_); +- common::Histogram rotational_score_histogram_ GUARDED_BY(mutex_); +- common::Histogram low_resolution_score_histogram_ GUARDED_BY(mutex_); ++ common::Histogram score_histogram_ ABSL_GUARDED_BY(mutex_); ++ common::Histogram rotational_score_histogram_ ABSL_GUARDED_BY(mutex_); ++ common::Histogram low_resolution_score_histogram_ ABSL_GUARDED_BY(mutex_); + }; + + } // namespace constraints +diff --git a/cartographer/mapping/pose_graph_interface.h b/cartographer/mapping/pose_graph_interface.h +index 68551f1..9619735 100644 +--- a/cartographer/mapping/pose_graph_interface.h ++++ b/cartographer/mapping/pose_graph_interface.h +@@ -17,6 +17,7 @@ + #ifndef CARTOGRAPHER_MAPPING_POSE_GRAPH_INTERFACE_H_ + #define CARTOGRAPHER_MAPPING_POSE_GRAPH_INTERFACE_H_ + ++#include + #include + #include + +diff --git a/cmake/functions.cmake b/cmake/functions.cmake +index 8cfc05f..9ff4de0 100644 +--- a/cmake/functions.cmake ++++ b/cmake/functions.cmake +@@ -126,12 +126,7 @@ macro(google_initialize_cartographer_project) + set(LIST_FILES_CMD "find ${PROJECT_SOURCE_DIR}/ -not -iwholename '*.git*' | sort | sed 's/^/#/'") + set(FILES_LIST_PATH "${PROJECT_BINARY_DIR}/AllFiles.cmake") + set(DETECT_CHANGES_CMD "bash" "-c" "${LIST_FILES_CMD} | diff -N -q ${FILES_LIST_PATH} - || ${LIST_FILES_CMD} > ${FILES_LIST_PATH}") +- add_custom_target(${PROJECT_NAME}_detect_changes ALL +- COMMAND ${DETECT_CHANGES_CMD} +- VERBATIM +- ) + if(NOT EXISTS ${FILES_LIST_PATH}) +- execute_process(COMMAND ${DETECT_CHANGES_CMD}) + endif() + include(${FILES_LIST_PATH}) + endif() diff --git a/ports/cartographer/fix-find-packages.patch b/ports/cartographer/fix-find-packages.patch deleted file mode 100644 index a1336c8840e621..00000000000000 --- a/ports/cartographer/fix-find-packages.patch +++ /dev/null @@ -1,175 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2e3a686..ed161e4 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -25,27 +25,33 @@ option(BUILD_GRPC "build Cartographer gRPC support" false) - option(BUILD_PROMETHEUS "build Prometheus monitoring support" false) - - include("${PROJECT_SOURCE_DIR}/cmake/functions.cmake") --google_initialize_cartographer_project() --google_enable_testing() -+#google_initialize_cartographer_project() -+#google_enable_testing() - - find_package(Boost REQUIRED COMPONENTS iostreams) - find_package(Ceres REQUIRED COMPONENTS SuiteSparse) - find_package(Eigen3 REQUIRED) --find_package(LuaGoogle REQUIRED) --find_package(Protobuf 3.0.0 REQUIRED) -+find_package(Lua REQUIRED) -+find_package(Protobuf REQUIRED) -+find_package(glog REQUIRED) -+find_package(gflags REQUIRED) - - if (${BUILD_GRPC}) - find_package(async_grpc REQUIRED) - endif() - --include(FindPkgConfig) --PKG_SEARCH_MODULE(CAIRO REQUIRED cairo>=1.12.16) -+#include(FindPkgConfig) -+#PKG_SEARCH_MODULE(CAIRO REQUIRED cairo>=1.12.16) -+#if(CMAKE_BUILD_TYPE STREQUAL Debug) -+# set(CAIRO_LIB_SUFFIX d) -+#endif() -+find_library(CAIRO_LIBRARY cairo${CAIRO_LIB_SUFFIX}) - - # Only build the documentation if we can find Sphinx. --find_package(Sphinx) --if(SPHINX_FOUND) -- add_subdirectory("docs") --endif() -+#find_package(Sphinx) -+#if(SPHINX_FOUND) -+# add_subdirectory("docs") -+#endif() - - # Install catkin package.xml - install(FILES package.xml DESTINATION share/cartographer) -@@ -169,20 +175,20 @@ configure_file( - ${PROJECT_SOURCE_DIR}/cartographer/common/config.h.cmake - ${PROJECT_BINARY_DIR}/cartographer/common/config.h) - --google_binary(cartographer_autogenerate_ground_truth -- SRCS -- cartographer/ground_truth/autogenerate_ground_truth_main.cc --) -- --google_binary(cartographer_compute_relations_metrics -- SRCS -- cartographer/ground_truth/compute_relations_metrics_main.cc --) -- --google_binary(cartographer_migrate_serialization_format -- SRCS -- cartographer/io/migrate_serialization_format_main.cc --) -+#google_binary(cartographer_autogenerate_ground_truth -+# SRCS -+# cartographer/ground_truth/autogenerate_ground_truth_main.cc -+#) -+# -+#google_binary(cartographer_compute_relations_metrics -+# SRCS -+# cartographer/ground_truth/compute_relations_metrics_main.cc -+#) -+# -+#google_binary(cartographer_migrate_serialization_format -+# SRCS -+# cartographer/io/migrate_serialization_format_main.cc -+#) - - if(${BUILD_GRPC}) - google_binary(cartographer_grpc_server -@@ -213,18 +219,16 @@ target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC - target_link_libraries(${PROJECT_NAME} PUBLIC ${Boost_LIBRARIES}) - - # We expect find_package(Ceres) to have located these for us. --target_link_libraries(${PROJECT_NAME} PUBLIC glog) --target_link_libraries(${PROJECT_NAME} PUBLIC gflags) -+#target_link_libraries(${PROJECT_NAME} PUBLIC glog) -+#target_link_libraries(${PROJECT_NAME} PUBLIC gflags) -+#target_link_libraries(${PROJECT_NAME} PUBLIC ${CAIRO_LIBRARY}) - --target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC -- "${CAIRO_INCLUDE_DIRS}") - target_link_libraries(${PROJECT_NAME} PUBLIC ${CAIRO_LIBRARIES}) - --target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC -- ${PROTOBUF_INCLUDE_DIR}) - # TODO(hrapp): This should not explicitly list pthread and use - # PROTOBUF_LIBRARIES, but that failed on first try. --target_link_libraries(${PROJECT_NAME} PUBLIC ${PROTOBUF_LIBRARY} pthread) -+#target_link_libraries(${PROJECT_NAME} PUBLIC ${PROTOBUF_LIBRARY} pthread) -+target_link_libraries(${PROJECT_NAME} PUBLIC protobuf::libprotobuf) - if(${BUILD_GRPC}) - target_link_libraries(${PROJECT_NAME} PUBLIC grpc++) - target_link_libraries(${PROJECT_NAME} PUBLIC async_grpc) -@@ -237,7 +241,7 @@ endif() - set(TARGET_COMPILE_FLAGS "${TARGET_COMPILE_FLAGS} ${GOOG_CXX_FLAGS}") - set_target_properties(${PROJECT_NAME} PROPERTIES - COMPILE_FLAGS ${TARGET_COMPILE_FLAGS}) -- -+if(0) - set(TEST_LIB - cartographer_test_library - ) -@@ -265,7 +269,7 @@ foreach(ABS_FIL ${ALL_TESTS}) - endif() - target_link_libraries("${TEST_TARGET_NAME}" PUBLIC ${TEST_LIB}) - endforeach() -- -+endif() - # Add the binary directory first, so that port.h is included after it has - # been generated. - target_include_directories(${PROJECT_NAME} PUBLIC -diff --git a/cartographer/common/math.h b/cartographer/common/math.h -index c4a77ef..0248f66 100644 ---- a/cartographer/common/math.h -+++ b/cartographer/common/math.h -@@ -17,6 +17,10 @@ - #ifndef CARTOGRAPHER_COMMON_MATH_H_ - #define CARTOGRAPHER_COMMON_MATH_H_ - -+#ifndef M_PI -+#define M_PI 3.14159265358979323846 -+#endif -+ - #include - #include - -diff --git a/cartographer/common/thread_pool.cc b/cartographer/common/thread_pool.cc -index bc3c743..db424d1 100644 ---- a/cartographer/common/thread_pool.cc -+++ b/cartographer/common/thread_pool.cc -@@ -16,7 +16,7 @@ - - #include "cartographer/common/thread_pool.h" - --#include -+//#include - #include - #include - #include -diff --git a/cmake/functions.cmake b/cmake/functions.cmake -index 3bfd343..3d961b0 100644 ---- a/cmake/functions.cmake -+++ b/cmake/functions.cmake -@@ -118,12 +118,12 @@ macro(google_initialize_cartographer_project) - set(LIST_FILES_CMD "find ${PROJECT_SOURCE_DIR}/ -not -iwholename '*.git*' | sort | sed 's/^/#/'") - set(FILES_LIST_PATH "${PROJECT_BINARY_DIR}/AllFiles.cmake") - set(DETECT_CHANGES_CMD "bash" "-c" "${LIST_FILES_CMD} | diff -N -q ${FILES_LIST_PATH} - || ${LIST_FILES_CMD} > ${FILES_LIST_PATH}") -- add_custom_target(${PROJECT_NAME}_detect_changes ALL -- COMMAND ${DETECT_CHANGES_CMD} -- VERBATIM -- ) -+ #add_custom_target(${PROJECT_NAME}_detect_changes ALL -+ # COMMAND ${DETECT_CHANGES_CMD} -+ # VERBATIM -+ #) - if(NOT EXISTS ${FILES_LIST_PATH}) -- execute_process(COMMAND ${DETECT_CHANGES_CMD}) -+ #execute_process(COMMAND ${DETECT_CHANGES_CMD}) - endif() - include(${FILES_LIST_PATH}) - endmacro() diff --git a/ports/cartographer/portfile.cmake b/ports/cartographer/portfile.cmake index 50cab69d0a98da..1d90a25c2bc48e 100644 --- a/ports/cartographer/portfile.cmake +++ b/ports/cartographer/portfile.cmake @@ -4,12 +4,11 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO googlecartographer/cartographer REF ${VERSION} - SHA512 4e3b38ee40d9758cbd51f087578b82efb7d1199b4b7696d31f45938ac06250caaea2b4d85ccb0a848c958ba187a0101ee95c87323ca236c613995b23b215041c + SHA512 78b9950c8336776e945219c12a15272c439683144d7c97356f1cda569d02fba551735572c5ac103e9472c7ef6375908c9381205d93286c8ba3593324268d7099 HEAD_REF master PATCHES - fix-find-packages.patch - fix-build-error.patch - fix-cmake-location.patch + fix-errors.patch + update-cartographer-to-deal-with-newer-ceres-24.patch ) vcpkg_cmake_configure( diff --git a/ports/cartographer/update-cartographer-to-deal-with-newer-ceres-24.patch b/ports/cartographer/update-cartographer-to-deal-with-newer-ceres-24.patch new file mode 100644 index 00000000000000..a1fbd3f93e2965 --- /dev/null +++ b/ports/cartographer/update-cartographer-to-deal-with-newer-ceres-24.patch @@ -0,0 +1,604 @@ +From 07a159192e9ea653a27f5d2dd88da983107eb8c8 Mon Sep 17 00:00:00 2001 +From: Chris Lalancette +Date: Fri, 15 Mar 2024 10:23:38 -0400 +Subject: [PATCH] Update cartographer to deal with newer ceres (#24) + +* Use Manifold instead of LocalParameterization. + +* Changes to deal with old and new ceres. + +* Make sure to fully initialize test articles. + +Otherwise modern gcc complains that these are +possibly used uninitialized. + +Signed-off-by: zjwoody +Signed-off-by: Chris Lalancette +--- + CMakeLists.txt | 2 +- + .../internal/3d/rotation_parameterization.h | 67 +++++++++++++++++++ + .../3d/rotation_parameterization_test.cc | 50 ++++++++++++++ + .../3d/scan_matching/ceres_scan_matcher_3d.cc | 14 ++++ + .../eigen_quaterniond_from_two_vectors.h | 11 +++ + .../internal/imu_based_pose_extrapolator.cc | 34 ++++++++++ + .../internal/optimization/ceres_pose.cc | 14 ++++ + .../internal/optimization/ceres_pose.h | 11 +++ + .../optimization/optimization_problem_2d.cc | 8 +++ + .../optimization/optimization_problem_3d.cc | 61 +++++++++++++++++ + .../internal/range_data_collator_test.cc | 2 +- + cartographer/sensor/internal/test_helpers.h | 2 +- + 12 files changed, 273 insertions(+), 3 deletions(-) + create mode 100644 cartographer/mapping/internal/3d/rotation_parameterization_test.cc + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f93b343..7a80f16 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,7 +12,7 @@ + # See the License for the specific language governing permissions and + # limitations under the License. + +-cmake_minimum_required(VERSION 3.2) ++cmake_minimum_required(VERSION 3.5) + + project(cartographer) + +diff --git a/cartographer/mapping/internal/3d/rotation_parameterization.h b/cartographer/mapping/internal/3d/rotation_parameterization.h +index 4ce0055..10e46c8 100644 +--- a/cartographer/mapping/internal/3d/rotation_parameterization.h ++++ b/cartographer/mapping/internal/3d/rotation_parameterization.h +@@ -24,6 +24,72 @@ + namespace cartographer { + namespace mapping { + ++#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 ++// Provides operations used to create a Ceres Manifold with a 4-D ambient ++// space and a 1-D tangent space that represents a yaw rotation only. ++struct YawOnlyQuaternionOperations { ++ template ++ bool Plus(const T* x, const T* delta, T* x_plus_delta) const { ++ const T clamped_delta = common::Clamp(delta[0], T(-0.5), T(0.5)); ++ T q_delta[4]; ++ q_delta[0] = ceres::sqrt(1. - clamped_delta * clamped_delta); ++ q_delta[1] = T(0.); ++ q_delta[2] = T(0.); ++ q_delta[3] = clamped_delta; ++ ceres::QuaternionProduct(q_delta, x, x_plus_delta); ++ return true; ++ } ++ template ++ bool Minus(const T* y, const T* x, T* y_minus_x) const { ++ T minus_x[4] = {x[0], -x[1], -x[2], -x[3]}; ++ T q_delta[4]; ++ ceres::QuaternionProduct(y, minus_x, q_delta); ++ y_minus_x[0] = q_delta[3]; ++ return true; ++ } ++}; ++ ++// Provides operations used to create a Ceres Manifold with a 4-D ambient ++// space and a 2-D tangent space that represents a rotation only in pitch and ++// roll, but no yaw. ++struct ConstantYawQuaternionOperations { ++ template ++ bool Plus(const T* x, const T* delta, T* x_plus_delta) const { ++ const T delta_norm = ++ ceres::sqrt(common::Pow2(delta[0]) + common::Pow2(delta[1])); ++ const T sin_delta_over_delta = ++ delta_norm < 1e-6 ? T(1.) : ceres::sin(delta_norm) / delta_norm; ++ T q_delta[4]; ++ q_delta[0] = delta_norm < 1e-6 ? T(1.) : ceres::cos(delta_norm); ++ q_delta[1] = sin_delta_over_delta * delta[0]; ++ q_delta[2] = sin_delta_over_delta * delta[1]; ++ q_delta[3] = T(0.); ++ // We apply the 'delta' which is interpreted as an angle-axis rotation ++ // vector in the xy-plane of the submap frame. This way we can align to ++ // gravity because rotations around the z-axis in the submap frame do not ++ // change gravity alignment, while disallowing random rotations of the map ++ // that have nothing to do with gravity alignment (i.e. we disallow steps ++ // just changing "yaw" of the complete map). ++ ceres::QuaternionProduct(x, q_delta, x_plus_delta); ++ return true; ++ } ++ template ++ bool Minus(const T* y, const T* x, T* y_minus_x) const { ++ T minus_x[4] = {x[0], -x[1], -x[2], -x[3]}; ++ T q_delta[4]; ++ ceres::QuaternionProduct(minus_x, y, q_delta); ++ const T& cos_delta_norm = q_delta[0]; ++ const T sin_delta_norm = ++ ceres::sqrt(common::Pow2(q_delta[1]) + common::Pow2(q_delta[2])); ++ const T delta_norm = atan2(sin_delta_norm, cos_delta_norm); ++ const T delta_over_sin_delta = ++ delta_norm < 1e-6 ? T(1.) : delta_norm / sin_delta_norm; ++ y_minus_x[0] = q_delta[1] * delta_over_sin_delta; ++ y_minus_x[1] = q_delta[2] * delta_over_sin_delta; ++ return true; ++ } ++}; ++#else + struct YawOnlyQuaternionPlus { + template + bool operator()(const T* x, const T* delta, T* x_plus_delta) const { +@@ -60,6 +126,7 @@ struct ConstantYawQuaternionPlus { + return true; + } + }; ++#endif + + } // namespace mapping + } // namespace cartographer +diff --git a/cartographer/mapping/internal/3d/rotation_parameterization_test.cc b/cartographer/mapping/internal/3d/rotation_parameterization_test.cc +new file mode 100644 +index 0000000..977d277 +--- /dev/null ++++ b/cartographer/mapping/internal/3d/rotation_parameterization_test.cc +@@ -0,0 +1,50 @@ ++#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 ++#include "cartographer/mapping/internal/3d/rotation_parameterization.h" ++ ++#include "ceres/manifold_test_utils.h" ++#include "gtest/gtest.h" ++ ++namespace cartographer::mapping { ++ ++template ++class RotationParameterizationTests : public ::testing::Test {}; ++ ++using TestTypes = ++ ::testing::Types, ceres::AutoDiffManifold>; ++TYPED_TEST_SUITE(RotationParameterizationTests, TestTypes); ++ ++TYPED_TEST(RotationParameterizationTests, ManifoldInvariantsHold) { ++ const TypeParam manifold; ++ ++ constexpr static int kNumTrials = 10; ++ constexpr static double kTolerance = 1.e-5; ++ const std::vector delta_magnitutes = {0.0, 1.e-9, 1.e-3, 0.5}; ++ for (int trial = 0; trial < kNumTrials; ++trial) { ++ const Eigen::VectorXd x = ++ Eigen::VectorXd::Random(manifold.AmbientSize()).normalized(); ++ ++ for (const double delta_magnitude : delta_magnitutes) { ++ const Eigen::VectorXd delta = ++ Eigen::VectorXd::Random(manifold.TangentSize()) * delta_magnitude; ++ EXPECT_THAT(manifold, ceres::XPlusZeroIsXAt(x, kTolerance)); ++ EXPECT_THAT(manifold, ceres::XMinusXIsZeroAt(x, kTolerance)); ++ EXPECT_THAT(manifold, ceres::MinusPlusIsIdentityAt(x, delta, kTolerance)); ++ const Eigen::VectorXd zero_tangent = ++ Eigen::VectorXd::Zero(manifold.TangentSize()); ++ EXPECT_THAT(manifold, ++ ceres::MinusPlusIsIdentityAt(x, zero_tangent, kTolerance)); ++ ++ Eigen::VectorXd y(manifold.AmbientSize()); ++ ASSERT_TRUE(manifold.Plus(x.data(), delta.data(), y.data())); ++ EXPECT_THAT(manifold, ceres::PlusMinusIsIdentityAt(x, x, kTolerance)); ++ EXPECT_THAT(manifold, ceres::PlusMinusIsIdentityAt(x, y, kTolerance)); ++ EXPECT_THAT(manifold, ceres::HasCorrectPlusJacobianAt(x, kTolerance)); ++ EXPECT_THAT(manifold, ceres::HasCorrectMinusJacobianAt(x, kTolerance)); ++ EXPECT_THAT(manifold, ++ ceres::MinusPlusJacobianIsIdentityAt(x, kTolerance)); ++ } ++ } ++} ++ ++} // namespace cartographer::mapping ++#endif +diff --git a/cartographer/mapping/internal/3d/scan_matching/ceres_scan_matcher_3d.cc b/cartographer/mapping/internal/3d/scan_matching/ceres_scan_matcher_3d.cc +index 5aab1fd..0c287b6 100644 +--- a/cartographer/mapping/internal/3d/scan_matching/ceres_scan_matcher_3d.cc ++++ b/cartographer/mapping/internal/3d/scan_matching/ceres_scan_matcher_3d.cc +@@ -31,6 +31,9 @@ + #include "cartographer/transform/rigid_transform.h" + #include "cartographer/transform/transform.h" + #include "ceres/ceres.h" ++#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 ++#include "ceres/manifold.h" ++#endif + #include "glog/logging.h" + + namespace cartographer { +@@ -95,6 +98,16 @@ void CeresScanMatcher3D::Match( + transform::Rigid3d* const pose_estimate, + ceres::Solver::Summary* const summary) const { + ceres::Problem problem; ++#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 ++ optimization::CeresPose ceres_pose( ++ initial_pose_estimate, nullptr /* translation_parameterization */, ++ options_.only_optimize_yaw() ++ ? std::unique_ptr( ++ absl::make_unique>()) ++ : std::unique_ptr( ++ absl::make_unique()), ++ &problem); ++#else + optimization::CeresPose ceres_pose( + initial_pose_estimate, nullptr /* translation_parameterization */, + options_.only_optimize_yaw() +@@ -104,6 +117,7 @@ void CeresScanMatcher3D::Match( + : std::unique_ptr( + absl::make_unique()), + &problem); ++#endif + + CHECK_EQ(options_.occupied_space_weight_size(), + point_clouds_and_hybrid_grids.size()); +diff --git a/cartographer/mapping/internal/eigen_quaterniond_from_two_vectors.h b/cartographer/mapping/internal/eigen_quaterniond_from_two_vectors.h +index e8d04b3..294f45e 100644 +--- a/cartographer/mapping/internal/eigen_quaterniond_from_two_vectors.h ++++ b/cartographer/mapping/internal/eigen_quaterniond_from_two_vectors.h +@@ -17,7 +17,18 @@ + #ifndef CARTOGRAPHER_MAPPING_EIGEN_QUATERNIOND_FROM_TWO_VECTORS_H_ + #define CARTOGRAPHER_MAPPING_EIGEN_QUATERNIOND_FROM_TWO_VECTORS_H_ + ++// When using Eigen 3.4.0 on Ubuntu 24.04 on an x86_64 machine and ++// compiling with -O3 -NDEBUG, we get a warning that an SSE function ++// deep within Eigen might be used uninitialized. This seems like ++// a spurious warning, so just ignore it for now. ++#ifdef __linux__ ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" ++#endif + #include "Eigen/Geometry" ++#ifdef __linux__ ++#pragma GCC diagnostic pop ++#endif + + namespace cartographer { + namespace mapping { +diff --git a/cartographer/mapping/internal/imu_based_pose_extrapolator.cc b/cartographer/mapping/internal/imu_based_pose_extrapolator.cc +index ddb88ea..4e0a950 100644 +--- a/cartographer/mapping/internal/imu_based_pose_extrapolator.cc ++++ b/cartographer/mapping/internal/imu_based_pose_extrapolator.cc +@@ -28,6 +28,9 @@ + #include "cartographer/mapping/internal/optimization/cost_functions/spa_cost_function_3d.h" + #include "cartographer/mapping/pose_graph_interface.h" + #include "cartographer/transform/transform.h" ++#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 ++#include "ceres/manifold.h" ++#endif + #include "glog/logging.h" + + namespace cartographer { +@@ -135,9 +138,16 @@ ImuBasedPoseExtrapolator::ExtrapolatePosesWithGravity( + + // Track gravity alignment over time and use this as a frame here so that + // we can estimate the gravity alignment of the current pose. ++#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 ++ optimization::CeresPose gravity_from_local( ++ gravity_from_local_, nullptr, ++ absl::make_unique(), &problem); ++#else + optimization::CeresPose gravity_from_local( + gravity_from_local_, nullptr, + absl::make_unique(), &problem); ++#endif ++ + // Use deque so addresses stay constant during problem formulation. + std::deque nodes; + std::vector node_times; +@@ -160,6 +170,18 @@ ImuBasedPoseExtrapolator::ExtrapolatePosesWithGravity( + gravity_from_node = gravity_from_local_ * timed_pose.transform; + } + ++#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 ++ if (is_last) { ++ nodes.emplace_back(gravity_from_node, nullptr, ++ absl::make_unique>(), ++ &problem); ++ problem.SetParameterBlockConstant(nodes.back().translation()); ++ } else { ++ nodes.emplace_back(gravity_from_node, nullptr, ++ absl::make_unique(), ++ &problem); ++ } ++#else + if (is_last) { + nodes.emplace_back(gravity_from_node, nullptr, + absl::make_unique(), + &problem); + } ++#endif + } + + double gravity_constant = 9.8; +@@ -199,9 +222,15 @@ ImuBasedPoseExtrapolator::ExtrapolatePosesWithGravity( + gravity_constant * Eigen::Vector3d::UnitZ(), time, imu_data_, + &imu_it_prev_prev) + .pose; ++#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 ++ nodes.emplace_back(initial_estimate, nullptr, ++ absl::make_unique(), ++ &problem); ++#else + nodes.emplace_back(initial_estimate, nullptr, + absl::make_unique(), + &problem); ++#endif + node_times.push_back(time); + + // Add cost functions for node constraints. +@@ -222,8 +251,13 @@ ImuBasedPoseExtrapolator::ExtrapolatePosesWithGravity( + + std::array imu_calibration{{1., 0., 0., 0.}}; + ++#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 ++ problem.AddParameterBlock(imu_calibration.data(), 4, ++ new ceres::QuaternionManifold()); ++#else + problem.AddParameterBlock(imu_calibration.data(), 4, + new ceres::QuaternionParameterization()); ++#endif + problem.SetParameterBlockConstant(imu_calibration.data()); + + auto imu_it = imu_data_.begin(); +diff --git a/cartographer/mapping/internal/optimization/ceres_pose.cc b/cartographer/mapping/internal/optimization/ceres_pose.cc +index 807a67d..f15b427 100644 +--- a/cartographer/mapping/internal/optimization/ceres_pose.cc ++++ b/cartographer/mapping/internal/optimization/ceres_pose.cc +@@ -27,6 +27,19 @@ CeresPose::Data FromPose(const transform::Rigid3d& pose) { + pose.rotation().y(), pose.rotation().z()}}}; + } + ++#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 ++CeresPose::CeresPose( ++ const transform::Rigid3d& pose, ++ std::unique_ptr translation_manifold, ++ std::unique_ptr rotation_manifold, ++ ceres::Problem* problem) ++ : data_(std::make_shared(FromPose(pose))) { ++ problem->AddParameterBlock(data_->translation.data(), 3, ++ translation_manifold.release()); ++ problem->AddParameterBlock(data_->rotation.data(), 4, ++ rotation_manifold.release()); ++} ++#else + CeresPose::CeresPose( + const transform::Rigid3d& pose, + std::unique_ptr translation_parametrization, +@@ -38,6 +51,7 @@ CeresPose::CeresPose( + problem->AddParameterBlock(data_->rotation.data(), 4, + rotation_parametrization.release()); + } ++#endif + + const transform::Rigid3d CeresPose::ToRigid() const { + return transform::Rigid3d::FromArrays(data_->rotation, data_->translation); +diff --git a/cartographer/mapping/internal/optimization/ceres_pose.h b/cartographer/mapping/internal/optimization/ceres_pose.h +index d852d80..e4c7b05 100644 +--- a/cartographer/mapping/internal/optimization/ceres_pose.h ++++ b/cartographer/mapping/internal/optimization/ceres_pose.h +@@ -23,6 +23,9 @@ + #include "Eigen/Core" + #include "cartographer/transform/rigid_transform.h" + #include "ceres/ceres.h" ++#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 ++#include "ceres/manifold.h" ++#endif + + namespace cartographer { + namespace mapping { +@@ -30,11 +33,19 @@ namespace optimization { + + class CeresPose { + public: ++#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 ++ CeresPose( ++ const transform::Rigid3d& pose, ++ std::unique_ptr translation_manifold, ++ std::unique_ptr rotation_manifold, ++ ceres::Problem* problem); ++#else + CeresPose( + const transform::Rigid3d& rigid, + std::unique_ptr translation_parametrization, + std::unique_ptr rotation_parametrization, + ceres::Problem* problem); ++#endif + + const transform::Rigid3d ToRigid() const; + +diff --git a/cartographer/mapping/internal/optimization/optimization_problem_2d.cc b/cartographer/mapping/internal/optimization/optimization_problem_2d.cc +index 3faf255..64b3c2c 100644 +--- a/cartographer/mapping/internal/optimization/optimization_problem_2d.cc ++++ b/cartographer/mapping/internal/optimization/optimization_problem_2d.cc +@@ -142,11 +142,19 @@ void AddLandmarkCostFunctions( + ? landmark_node.second.global_landmark_pose.value() + : GetInitialLandmarkPose(observation, prev->data, next->data, + *prev_node_pose, *next_node_pose); ++#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 ++ C_landmarks->emplace( ++ landmark_id, ++ CeresPose(starting_point, nullptr /* translation_manifold */, ++ absl::make_unique(), ++ problem)); ++#else + C_landmarks->emplace( + landmark_id, + CeresPose(starting_point, nullptr /* translation_parametrization */, + absl::make_unique(), + problem)); ++#endif + // Set landmark constant if it is frozen. + if (landmark_node.second.frozen) { + problem->SetParameterBlockConstant( +diff --git a/cartographer/mapping/internal/optimization/optimization_problem_3d.cc b/cartographer/mapping/internal/optimization/optimization_problem_3d.cc +index fca36d1..e1d6bd3 100644 +--- a/cartographer/mapping/internal/optimization/optimization_problem_3d.cc ++++ b/cartographer/mapping/internal/optimization/optimization_problem_3d.cc +@@ -158,11 +158,19 @@ void AddLandmarkCostFunctions( + ? landmark_node.second.global_landmark_pose.value() + : GetInitialLandmarkPose(observation, prev->data, next->data, + *prev_node_pose, *next_node_pose); ++#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 ++ C_landmarks->emplace( ++ landmark_id, ++ CeresPose(starting_point, nullptr /* translation_manifold */, ++ absl::make_unique(), ++ problem)); ++#else + C_landmarks->emplace( + landmark_id, + CeresPose(starting_point, nullptr /* translation_parametrization */, + absl::make_unique(), + problem)); ++#endif + // Set landmark constant if it is frozen. + if (landmark_node.second.frozen) { + problem->SetParameterBlockConstant( +@@ -274,6 +282,14 @@ void OptimizationProblem3D::Solve( + ceres::Problem::Options problem_options; + ceres::Problem problem(problem_options); + ++#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 ++ const auto translation_manifold = ++ [this]() -> std::unique_ptr { ++ return options_.fix_z_in_3d() ? absl::make_unique( ++ 3, std::vector{2}) ++ : nullptr; ++ }; ++#else + const auto translation_parameterization = + [this]() -> std::unique_ptr { + return options_.fix_z_in_3d() +@@ -281,6 +297,7 @@ void OptimizationProblem3D::Solve( + 3, std::vector{2}) + : nullptr; + }; ++#endif + + // Set the starting point. + CHECK(!submap_data_.empty()); +@@ -295,6 +312,14 @@ void OptimizationProblem3D::Solve( + first_submap = false; + // Fix the first submap of the first trajectory except for allowing + // gravity alignment. ++#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 ++ C_submaps.Insert( ++ submap_id_data.id, ++ CeresPose(submap_id_data.data.global_pose, ++ translation_manifold(), ++ absl::make_unique>(), ++ &problem)); ++#else + C_submaps.Insert( + submap_id_data.id, + CeresPose(submap_id_data.data.global_pose, +@@ -302,15 +327,25 @@ void OptimizationProblem3D::Solve( + absl::make_unique>(), + &problem)); ++#endif + problem.SetParameterBlockConstant( + C_submaps.at(submap_id_data.id).translation()); + } else { ++#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 ++ C_submaps.Insert( ++ submap_id_data.id, ++ CeresPose(submap_id_data.data.global_pose, ++ translation_manifold(), ++ absl::make_unique(), ++ &problem)); ++#else + C_submaps.Insert( + submap_id_data.id, + CeresPose(submap_id_data.data.global_pose, + translation_parameterization(), + absl::make_unique(), + &problem)); ++#endif + } + if (frozen) { + problem.SetParameterBlockConstant( +@@ -322,11 +357,19 @@ void OptimizationProblem3D::Solve( + for (const auto& node_id_data : node_data_) { + const bool frozen = + frozen_trajectories.count(node_id_data.id.trajectory_id) != 0; ++#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 ++ C_nodes.Insert( ++ node_id_data.id, ++ CeresPose(node_id_data.data.global_pose, translation_manifold(), ++ absl::make_unique(), ++ &problem)); ++#else + C_nodes.Insert( + node_id_data.id, + CeresPose(node_id_data.data.global_pose, translation_parameterization(), + absl::make_unique(), + &problem)); ++#endif + if (frozen) { + problem.SetParameterBlockConstant(C_nodes.at(node_id_data.id).rotation()); + problem.SetParameterBlockConstant( +@@ -362,8 +405,13 @@ void OptimizationProblem3D::Solve( + } + TrajectoryData& trajectory_data = trajectory_data_.at(trajectory_id); + ++#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 ++ problem.AddParameterBlock(trajectory_data.imu_calibration.data(), 4, ++ new ceres::QuaternionManifold()); ++#else + problem.AddParameterBlock(trajectory_data.imu_calibration.data(), 4, + new ceres::QuaternionParameterization()); ++#endif + if (!options_.use_online_imu_extrinsics_in_3d()) { + problem.SetParameterBlockConstant( + trajectory_data.imu_calibration.data()); +@@ -536,6 +584,18 @@ void OptimizationProblem3D::Solve( + fixed_frame_pose_in_map = + node_data.global_pose * constraint_pose.zbar_ij.inverse(); + } ++#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 ++ C_fixed_frames.emplace( ++ std::piecewise_construct, std::forward_as_tuple(trajectory_id), ++ std::forward_as_tuple( ++ transform::Rigid3d( ++ fixed_frame_pose_in_map.translation(), ++ Eigen::AngleAxisd( ++ transform::GetYaw(fixed_frame_pose_in_map.rotation()), ++ Eigen::Vector3d::UnitZ())), ++ nullptr, absl::make_unique>(), ++ &problem)); ++#else + C_fixed_frames.emplace( + std::piecewise_construct, std::forward_as_tuple(trajectory_id), + std::forward_as_tuple( +@@ -548,6 +608,7 @@ void OptimizationProblem3D::Solve( + absl::make_unique>(), + &problem)); ++#endif + fixed_frame_pose_initialized = true; + } + +diff --git a/cartographer/mapping/internal/range_data_collator_test.cc b/cartographer/mapping/internal/range_data_collator_test.cc +index 43ceb00..dce7717 100644 +--- a/cartographer/mapping/internal/range_data_collator_test.cc ++++ b/cartographer/mapping/internal/range_data_collator_test.cc +@@ -92,7 +92,7 @@ TEST(RangeDataCollatorTest, SingleSensorEmptyData) { + const std::string sensor_id = "single_sensor"; + RangeDataCollator collator({sensor_id}); + sensor::TimedPointCloudData empty_data{ +- common::FromUniversal(300), {}, {}, {}}; ++ common::FromUniversal(300), Eigen::Vector3f::Zero(), {}, {}}; + auto output_0 = collator.AddRangeData(sensor_id, empty_data); + EXPECT_EQ(output_0.time, empty_data.time); + EXPECT_EQ(output_0.ranges.size(), empty_data.ranges.size()); +diff --git a/cartographer/sensor/internal/test_helpers.h b/cartographer/sensor/internal/test_helpers.h +index 0b32d89..431758f 100644 +--- a/cartographer/sensor/internal/test_helpers.h ++++ b/cartographer/sensor/internal/test_helpers.h +@@ -47,7 +47,7 @@ struct CollatorInput { + const std::string& sensor_id, int time) { + return CollatorInput{ + trajectory_id, +- MakeDispatchable(sensor_id, ImuData{common::FromUniversal(time)}), ++ MakeDispatchable(sensor_id, ImuData{common::FromUniversal(time), Eigen::Vector3d::Zero(), Eigen::Vector3d::Zero()}), + CollatorOutput{trajectory_id, sensor_id, common::FromUniversal(time)}}; + } + static CollatorInput CreateTimedPointCloudData(int trajectory_id, +-- +2.47.1 + diff --git a/ports/cartographer/vcpkg.json b/ports/cartographer/vcpkg.json index bfd1ce508cc22f..e4ddaad61cc98b 100644 --- a/ports/cartographer/vcpkg.json +++ b/ports/cartographer/vcpkg.json @@ -1,7 +1,7 @@ { "name": "cartographer", - "version": "1.0.0", - "port-version": 6, + "version": "2.0.0", + "port-version": 0, "description": "Google 2D & 3D SLAM package", "homepage": "https://github.com/googlecartographer/cartographer", "dependencies": [ diff --git a/ports/ceres/0001_cmakelists_fixes.patch b/ports/ceres/0001_cmakelists_fixes.patch index b3d81e38d69564..6efb5f85348264 100644 --- a/ports/ceres/0001_cmakelists_fixes.patch +++ b/ports/ceres/0001_cmakelists_fixes.patch @@ -1,31 +1,49 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8e49c19e..707dfb9c 100644 +index 8e49c19e..c880e788 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -292,7 +292,7 @@ if (SUITESPARSE) +@@ -80,7 +80,7 @@ set(CMAKE_VISIBILITY_INLINES_HIDDEN ON) + # Make CMake aware of the cmake folder for local FindXXX scripts, + # append rather than set in case the user has passed their own + # additional paths via -D. +-list(APPEND CMAKE_MODULE_PATH "${Ceres_SOURCE_DIR}/cmake") ++list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") + include(AddCompileFlagsIfSupported) + include(CheckCXXCompilerFlag) + include(CheckLibraryExists) +@@ -292,20 +292,21 @@ if (SUITESPARSE) # built with SuiteSparse support. # Check for SuiteSparse and dependencies. - find_package(SuiteSparse 4.5.6 COMPONENTS CHOLMOD SPQR -+ find_package(SuiteSparse 4.5.6 CONFIG COMPONENTS CHOLMOD SPQR - OPTIONAL_COMPONENTS Partition) - if (SuiteSparse_FOUND) - set(SuiteSparse_DEPENDENCY "find_dependency(SuiteSparse ${SuiteSparse_VERSION})") -@@ -301,11 +301,11 @@ if (SUITESPARSE) +- OPTIONAL_COMPONENTS Partition) +- if (SuiteSparse_FOUND) +- set(SuiteSparse_DEPENDENCY "find_dependency(SuiteSparse ${SuiteSparse_VERSION})") ++ find_package(SuiteSparse REQUIRED CONFIG) ++ if (SUITESPARSE_FOUND) ++ set(SuiteSparse_DEPENDENCY "find_dependency(SuiteSparse ${SuiteSparse_VERSION} CONFIG)") + # By default, if all of SuiteSparse's dependencies are found, Ceres is + # built with SuiteSparse support. message("-- Found SuiteSparse ${SuiteSparse_VERSION}, " "building with SuiteSparse.") - +- - if (SuiteSparse_NO_CMAKE OR NOT SuiteSparse_DIR) -+ if (SuiteSparse_NO_CMAKE OR NOT SuiteSparse_DIR) - install(FILES ${Ceres_SOURCE_DIR}/cmake/FindSuiteSparse.cmake - ${Ceres_SOURCE_DIR}/cmake/FindMETIS.cmake - DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) +- install(FILES ${Ceres_SOURCE_DIR}/cmake/FindSuiteSparse.cmake +- ${Ceres_SOURCE_DIR}/cmake/FindMETIS.cmake +- DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) - endif (SuiteSparse_NO_CMAKE OR NOT SuiteSparse_DIR) -+ endif (0) ++ add_library(SuiteSparse::ONFIG ALIAS SuiteSparse::suitesparseconfig) ++ add_library(SuiteSparse::AMD ALIAS SuiteSparse::amd) ++ add_library(SuiteSparse::CAMD ALIAS SuiteSparse::camd) ++ add_library(SuiteSparse::CCOLAMD ALIAS SuiteSparse::ccolamd) ++ add_library(SuiteSparse::COLAMD ALIAS SuiteSparse::colamd) ++ add_library(SuiteSparse::CHOLMOD ALIAS SuiteSparse::cholmod) ++ add_library(SuiteSparse::SPQR ALIAS SuiteSparse::spqr) ++ add_library(METIS::METIS ALIAS metis) else (SuiteSparse_FOUND) # Disable use of SuiteSparse if it cannot be found and continue. message("-- Did not find all SuiteSparse dependencies, disabling " -@@ -395,9 +395,10 @@ endif() +@@ -395,9 +396,10 @@ endif() # GFlags. if (GFLAGS) # Don't search with REQUIRED as we can continue without gflags. @@ -38,7 +56,7 @@ index 8e49c19e..707dfb9c 100644 message("-- Found Google Flags (gflags) version ${gflags_VERSION}: ${gflags_DIR}") else() message("-- Detected version of gflags: ${gflags_VERSION} does not define " -@@ -430,28 +431,7 @@ if (MINIGLOG) +@@ -430,28 +432,7 @@ if (MINIGLOG) mark_as_advanced(FORCE GLOG_INCLUDE_DIR GLOG_LIBRARY) else (MINIGLOG) @@ -68,7 +86,7 @@ index 8e49c19e..707dfb9c 100644 endif (MINIGLOG) if (NOT SCHUR_SPECIALIZATIONS) -@@ -466,7 +446,7 @@ endif (NOT CUSTOM_BLAS) +@@ -466,7 +447,7 @@ endif (NOT CUSTOM_BLAS) if (BUILD_BENCHMARKS) # Version 1.3 was first to provide import targets @@ -77,7 +95,7 @@ index 8e49c19e..707dfb9c 100644 if (benchmark_FOUND) message("-- Found Google benchmark library. Building Ceres benchmarks.") else() -@@ -722,12 +702,6 @@ install(FILES "${Ceres_BINARY_DIR}/CeresConfig-install.cmake" +@@ -722,12 +703,6 @@ install(FILES "${Ceres_BINARY_DIR}/CeresConfig-install.cmake" DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) install(FILES "${Ceres_BINARY_DIR}/CeresConfigVersion.cmake" DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) From 73085c9cb6f922b529b106c8f29021b452be2647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 4 Dec 2024 08:49:48 +0100 Subject: [PATCH 10/67] d --- ports/cartographer/vcpkg.json | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/cartographer/vcpkg.json b/ports/cartographer/vcpkg.json index e4ddaad61cc98b..bc4697a019a896 100644 --- a/ports/cartographer/vcpkg.json +++ b/ports/cartographer/vcpkg.json @@ -1,7 +1,6 @@ { "name": "cartographer", "version": "2.0.0", - "port-version": 0, "description": "Google 2D & 3D SLAM package", "homepage": "https://github.com/googlecartographer/cartographer", "dependencies": [ From 732c8563ae77ec77c093516f0b3feffdabd94561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 4 Dec 2024 08:49:58 +0100 Subject: [PATCH 11/67] d --- versions/baseline.json | 4 ++-- versions/c-/cartographer.json | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/versions/baseline.json b/versions/baseline.json index 2f619798b3c231..56c02c9550a6a7 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1517,8 +1517,8 @@ "port-version": 0 }, "cartographer": { - "baseline": "1.0.0", - "port-version": 6 + "baseline": "2.0.0", + "port-version": 0 }, "casadi": { "baseline": "3.6.7", diff --git a/versions/c-/cartographer.json b/versions/c-/cartographer.json index 4f60b8c9abf8a6..a3c0d995c5cfd7 100644 --- a/versions/c-/cartographer.json +++ b/versions/c-/cartographer.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "0eff15df99dc1514a143bc0eb6e7a10752c47679", + "version": "2.0.0", + "port-version": 0 + }, { "git-tree": "917d4ac19da5414db7ad690f8f315821b94a40ba", "version": "1.0.0", From 31b6e6043a9f24bfe1313388db853ad1840e4711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 4 Dec 2024 08:53:04 +0100 Subject: [PATCH 12/67] d --- ports/colmap/0001_cmakelists_fixes.patch | 94 ------------------------ 1 file changed, 94 deletions(-) delete mode 100644 ports/colmap/0001_cmakelists_fixes.patch diff --git a/ports/colmap/0001_cmakelists_fixes.patch b/ports/colmap/0001_cmakelists_fixes.patch deleted file mode 100644 index de2d4c1652a306..00000000000000 --- a/ports/colmap/0001_cmakelists_fixes.patch +++ /dev/null @@ -1,94 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8e49c19e..28059c7d 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -292,20 +292,20 @@ if (SUITESPARSE) - # built with SuiteSparse support. - - # Check for SuiteSparse and dependencies. -- find_package(SuiteSparse 4.5.6 COMPONENTS CHOLMOD SPQR -+ find_package(SuiteSparse 4.5.6 CONFIG COMPONENTS CHOLMOD SPQR - OPTIONAL_COMPONENTS Partition) - if (SuiteSparse_FOUND) -- set(SuiteSparse_DEPENDENCY "find_dependency(SuiteSparse ${SuiteSparse_VERSION})") -+ set(SuiteSparse_DEPENDENCY "find_dependency(SuiteSparse ${SuiteSparse_VERSION} CONFIG)") - # By default, if all of SuiteSparse's dependencies are found, Ceres is - # built with SuiteSparse support. - message("-- Found SuiteSparse ${SuiteSparse_VERSION}, " - "building with SuiteSparse.") - -- if (SuiteSparse_NO_CMAKE OR NOT SuiteSparse_DIR) -+ if (SuiteSparse_NO_CMAKE OR NOT SuiteSparse_DIR) - install(FILES ${Ceres_SOURCE_DIR}/cmake/FindSuiteSparse.cmake - ${Ceres_SOURCE_DIR}/cmake/FindMETIS.cmake - DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) -- endif (SuiteSparse_NO_CMAKE OR NOT SuiteSparse_DIR) -+ endif (0) - else (SuiteSparse_FOUND) - # Disable use of SuiteSparse if it cannot be found and continue. - message("-- Did not find all SuiteSparse dependencies, disabling " -@@ -395,9 +395,10 @@ endif() - # GFlags. - if (GFLAGS) - # Don't search with REQUIRED as we can continue without gflags. -- find_package(gflags 2.2.0) -+ find_package(gflags CONFIG REQUIRED) - if (gflags_FOUND) -- if (TARGET gflags) -+ if (TARGET gflags::gflags) -+ add_library(gflags ALIAS gflags::gflags) - message("-- Found Google Flags (gflags) version ${gflags_VERSION}: ${gflags_DIR}") - else() - message("-- Detected version of gflags: ${gflags_VERSION} does not define " -@@ -430,28 +431,7 @@ if (MINIGLOG) - mark_as_advanced(FORCE GLOG_INCLUDE_DIR - GLOG_LIBRARY) - else (MINIGLOG) -- unset(MINIGLOG_MAX_LOG_LEVEL CACHE) -- # Don't search with REQUIRED so that configuration continues if not found and -- # we can output an error messages explaining MINIGLOG option. -- find_package(Glog) -- if (NOT GLOG_FOUND) -- message(FATAL_ERROR "Can't find Google Log (glog). Please set either: " -- "glog_DIR (newer CMake built versions of glog) or GLOG_INCLUDE_DIR & " -- "GLOG_LIBRARY or enable MINIGLOG option to use minimal glog " -- "implementation.") -- endif(NOT GLOG_FOUND) -- # By default, assume gflags was found, updating the message if it was not. -- set(GLOG_GFLAGS_DEPENDENCY_MESSAGE -- " Assuming glog was built with gflags support as gflags was found. " -- "This will make gflags a public dependency of Ceres.") -- if (NOT gflags_FOUND) -- set(GLOG_GFLAGS_DEPENDENCY_MESSAGE -- " Assuming glog was NOT built with gflags support as gflags was " -- "not found. If glog was built with gflags, please set the " -- "gflags search locations such that it can be found by Ceres. " -- "Otherwise, Ceres may fail to link due to missing gflags symbols.") -- endif(NOT gflags_FOUND) -- message("-- Found Google Log (glog)." ${GLOG_GFLAGS_DEPENDENCY_MESSAGE}) -+ find_package(Glog REQUIRED) - endif (MINIGLOG) - - if (NOT SCHUR_SPECIALIZATIONS) -@@ -466,7 +446,7 @@ endif (NOT CUSTOM_BLAS) - - if (BUILD_BENCHMARKS) - # Version 1.3 was first to provide import targets -- find_package(benchmark 1.3 QUIET) -+ find_package(benchmark CONFIG REQUIRED) - if (benchmark_FOUND) - message("-- Found Google benchmark library. Building Ceres benchmarks.") - else() -@@ -722,12 +702,6 @@ install(FILES "${Ceres_BINARY_DIR}/CeresConfig-install.cmake" - DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) - install(FILES "${Ceres_BINARY_DIR}/CeresConfigVersion.cmake" - DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) --if (GLOG_FOUND AND NOT FOUND_INSTALLED_GLOG_CMAKE_CONFIGURATION) -- # Version of glog detected was not built with CMake, install our glog module -- # file to enable detection in CeresConfig. -- install(FILES "${Ceres_SOURCE_DIR}/cmake/FindGlog.cmake" -- DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) --endif() - - if (PROVIDE_UNINSTALL_TARGET) - # Create an uninstall target to remove all installed files. From 766d336b205c94cf8cb0c99dfc1e3ebd61d6e4aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 4 Dec 2024 08:55:20 +0100 Subject: [PATCH 13/67] d --- ports/ceres/0001_cmakelists_fixes.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/ceres/0001_cmakelists_fixes.patch b/ports/ceres/0001_cmakelists_fixes.patch index 6efb5f85348264..e160b67cc501a1 100644 --- a/ports/ceres/0001_cmakelists_fixes.patch +++ b/ports/ceres/0001_cmakelists_fixes.patch @@ -32,7 +32,7 @@ index 8e49c19e..c880e788 100644 - ${Ceres_SOURCE_DIR}/cmake/FindMETIS.cmake - DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) - endif (SuiteSparse_NO_CMAKE OR NOT SuiteSparse_DIR) -+ add_library(SuiteSparse::ONFIG ALIAS SuiteSparse::suitesparseconfig) ++ add_library(SuiteSparse::CONFIG ALIAS SuiteSparse::suitesparseconfig) + add_library(SuiteSparse::AMD ALIAS SuiteSparse::amd) + add_library(SuiteSparse::CAMD ALIAS SuiteSparse::camd) + add_library(SuiteSparse::CCOLAMD ALIAS SuiteSparse::ccolamd) From 7d3b7d538b40d66316e4613c9e4ef099f60d0a1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 4 Dec 2024 08:55:32 +0100 Subject: [PATCH 14/67] d --- versions/c-/ceres.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/c-/ceres.json b/versions/c-/ceres.json index 0eacc29d448b07..e3675f68d76dc5 100644 --- a/versions/c-/ceres.json +++ b/versions/c-/ceres.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "c8fa614778984105f589546429c66baae3c2cb4f", + "git-tree": "003c6572a4818b8234bfaf91ab0b39e19a91ad57", "version": "2.2.0", "port-version": 0 }, From c9242c41f655b517204f3d9a2c61159160df12ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 4 Dec 2024 11:55:44 +0100 Subject: [PATCH 15/67] d --- ports/colmap/0001_cmakelists_fixes.patch | 94 ++++ ports/openmvg/0002-eigen-3.4.patch | 13 - ports/openmvg/build_fixes.patch | 527 +++++------------------ ports/openmvg/cmakelists.patch | 299 +++++++++++++ ports/openmvg/fix-coinutils.patch | 47 -- ports/openmvg/portfile.cmake | 29 +- ports/openmvg/vcpkg.json | 3 +- 7 files changed, 527 insertions(+), 485 deletions(-) create mode 100644 ports/colmap/0001_cmakelists_fixes.patch delete mode 100644 ports/openmvg/0002-eigen-3.4.patch create mode 100644 ports/openmvg/cmakelists.patch delete mode 100644 ports/openmvg/fix-coinutils.patch diff --git a/ports/colmap/0001_cmakelists_fixes.patch b/ports/colmap/0001_cmakelists_fixes.patch new file mode 100644 index 00000000000000..de2d4c1652a306 --- /dev/null +++ b/ports/colmap/0001_cmakelists_fixes.patch @@ -0,0 +1,94 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8e49c19e..28059c7d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -292,20 +292,20 @@ if (SUITESPARSE) + # built with SuiteSparse support. + + # Check for SuiteSparse and dependencies. +- find_package(SuiteSparse 4.5.6 COMPONENTS CHOLMOD SPQR ++ find_package(SuiteSparse 4.5.6 CONFIG COMPONENTS CHOLMOD SPQR + OPTIONAL_COMPONENTS Partition) + if (SuiteSparse_FOUND) +- set(SuiteSparse_DEPENDENCY "find_dependency(SuiteSparse ${SuiteSparse_VERSION})") ++ set(SuiteSparse_DEPENDENCY "find_dependency(SuiteSparse ${SuiteSparse_VERSION} CONFIG)") + # By default, if all of SuiteSparse's dependencies are found, Ceres is + # built with SuiteSparse support. + message("-- Found SuiteSparse ${SuiteSparse_VERSION}, " + "building with SuiteSparse.") + +- if (SuiteSparse_NO_CMAKE OR NOT SuiteSparse_DIR) ++ if (SuiteSparse_NO_CMAKE OR NOT SuiteSparse_DIR) + install(FILES ${Ceres_SOURCE_DIR}/cmake/FindSuiteSparse.cmake + ${Ceres_SOURCE_DIR}/cmake/FindMETIS.cmake + DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) +- endif (SuiteSparse_NO_CMAKE OR NOT SuiteSparse_DIR) ++ endif (0) + else (SuiteSparse_FOUND) + # Disable use of SuiteSparse if it cannot be found and continue. + message("-- Did not find all SuiteSparse dependencies, disabling " +@@ -395,9 +395,10 @@ endif() + # GFlags. + if (GFLAGS) + # Don't search with REQUIRED as we can continue without gflags. +- find_package(gflags 2.2.0) ++ find_package(gflags CONFIG REQUIRED) + if (gflags_FOUND) +- if (TARGET gflags) ++ if (TARGET gflags::gflags) ++ add_library(gflags ALIAS gflags::gflags) + message("-- Found Google Flags (gflags) version ${gflags_VERSION}: ${gflags_DIR}") + else() + message("-- Detected version of gflags: ${gflags_VERSION} does not define " +@@ -430,28 +431,7 @@ if (MINIGLOG) + mark_as_advanced(FORCE GLOG_INCLUDE_DIR + GLOG_LIBRARY) + else (MINIGLOG) +- unset(MINIGLOG_MAX_LOG_LEVEL CACHE) +- # Don't search with REQUIRED so that configuration continues if not found and +- # we can output an error messages explaining MINIGLOG option. +- find_package(Glog) +- if (NOT GLOG_FOUND) +- message(FATAL_ERROR "Can't find Google Log (glog). Please set either: " +- "glog_DIR (newer CMake built versions of glog) or GLOG_INCLUDE_DIR & " +- "GLOG_LIBRARY or enable MINIGLOG option to use minimal glog " +- "implementation.") +- endif(NOT GLOG_FOUND) +- # By default, assume gflags was found, updating the message if it was not. +- set(GLOG_GFLAGS_DEPENDENCY_MESSAGE +- " Assuming glog was built with gflags support as gflags was found. " +- "This will make gflags a public dependency of Ceres.") +- if (NOT gflags_FOUND) +- set(GLOG_GFLAGS_DEPENDENCY_MESSAGE +- " Assuming glog was NOT built with gflags support as gflags was " +- "not found. If glog was built with gflags, please set the " +- "gflags search locations such that it can be found by Ceres. " +- "Otherwise, Ceres may fail to link due to missing gflags symbols.") +- endif(NOT gflags_FOUND) +- message("-- Found Google Log (glog)." ${GLOG_GFLAGS_DEPENDENCY_MESSAGE}) ++ find_package(Glog REQUIRED) + endif (MINIGLOG) + + if (NOT SCHUR_SPECIALIZATIONS) +@@ -466,7 +446,7 @@ endif (NOT CUSTOM_BLAS) + + if (BUILD_BENCHMARKS) + # Version 1.3 was first to provide import targets +- find_package(benchmark 1.3 QUIET) ++ find_package(benchmark CONFIG REQUIRED) + if (benchmark_FOUND) + message("-- Found Google benchmark library. Building Ceres benchmarks.") + else() +@@ -722,12 +702,6 @@ install(FILES "${Ceres_BINARY_DIR}/CeresConfig-install.cmake" + DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) + install(FILES "${Ceres_BINARY_DIR}/CeresConfigVersion.cmake" + DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) +-if (GLOG_FOUND AND NOT FOUND_INSTALLED_GLOG_CMAKE_CONFIGURATION) +- # Version of glog detected was not built with CMake, install our glog module +- # file to enable detection in CeresConfig. +- install(FILES "${Ceres_SOURCE_DIR}/cmake/FindGlog.cmake" +- DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) +-endif() + + if (PROVIDE_UNINSTALL_TARGET) + # Create an uninstall target to remove all installed files. diff --git a/ports/openmvg/0002-eigen-3.4.patch b/ports/openmvg/0002-eigen-3.4.patch deleted file mode 100644 index 19098d2ae246fc..00000000000000 --- a/ports/openmvg/0002-eigen-3.4.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/src/openMVG/multiview/CMakeLists.txt -+++ b/src/openMVG/multiview/CMakeLists.txt -@@ -38,6 +38,9 @@ target_include_directories(openMVG_multiview - $ - ) - set_target_properties(openMVG_multiview PROPERTIES SOVERSION ${OPENMVG_VERSION_MAJOR} VERSION "${OPENMVG_VERSION_MAJOR}.${OPENMVG_VERSION_MINOR}") -+if (MSVC) -+ set_target_properties(openMVG_multiview PROPERTIES COMPILE_FLAGS "/bigobj") -+endif (MSVC) - - add_library(openMVG_multiview_test_data ${MULTIVIEWTESTDATA}) - target_link_libraries(openMVG_multiview_test_data PRIVATE openMVG_numeric openMVG_multiview) - \ No newline at end of file diff --git a/ports/openmvg/build_fixes.patch b/ports/openmvg/build_fixes.patch index 66cc004f3e7769..6e66603efffc0d 100644 --- a/ports/openmvg/build_fixes.patch +++ b/ports/openmvg/build_fixes.patch @@ -1,32 +1,32 @@ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 5d909ec..ab7eb6f 100644 +index 6879c4c6..d00bce4f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt -@@ -20,6 +20,7 @@ if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) - message(FATAL_ERROR "In-source builds not allowed.") - endif() +@@ -24,6 +24,7 @@ endif() + + set(CMAKE_FIND_FRAMEWORK LAST) +if(0) # ============================================================================== # OpenMVG build options # ============================================================================== -@@ -37,6 +38,7 @@ option(OpenMVG_USE_OPENMP "Enable OpenMP parallelization" ON) - # and openMVG simultaneously +@@ -59,6 +60,7 @@ option(OpenMVG_USE_OCVSIFT "Add or not OpenCV SIFT in available features" OFF) + # Enable this to be able to use LiGT in main_SfM. # ============================================================================== - option(OpenMVG_USE_OPENCV "Build or not opencv+openMVG samples programs" OFF) + option(OpenMVG_USE_LIGT "Add or not LiGT in available" ON) +endif() # ============================================================================== - # Since OpenCV 3, SIFT is no longer in the default modules. See -@@ -95,6 +97,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - register_definitions(-DOPENMVG_STD_UNORDERED_MAP) + # OpenMVG version +@@ -104,6 +106,7 @@ else (OpenMVG_BUILD_SHARED) + set(BUILD_SHARED_LIBS OFF) endif() +if(0) # ============================================================================== # Check that submodule have been initialized and updated # ============================================================================== -@@ -103,6 +106,7 @@ if (NOT EXISTS ${PROJECT_SOURCE_DIR}/dependencies/cereal/include) +@@ -112,6 +115,7 @@ if (NOT EXISTS ${PROJECT_SOURCE_DIR}/dependencies/cereal/include) "\n submodule(s) are missing, please update your repository:\n" " > git submodule update -i\n") endif() @@ -34,27 +34,7 @@ index 5d909ec..ab7eb6f 100644 # ============================================================================== # Additional cmake find modules -@@ -138,7 +142,6 @@ if (OpenMVG_USE_OPENMP) - find_package(OpenMP) - if (OPENMP_FOUND) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") -- option(OpenMVG_USE_OPENMP "Use OpenMP for parallelization" ON) - register_definitions(-DOPENMVG_USE_OPENMP) - if (NOT MSVC) - if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") -@@ -149,11 +152,6 @@ if (OpenMVG_USE_OPENMP) - endif() - endif (NOT MSVC) - endif (OPENMP_FOUND) --else (OpenMVG_USE_OPENMP) -- option(OpenMVG_USE_OPENMP "Use OpenMP for parallelization" OFF) -- include(UpdateCacheVariable) -- UPDATE_CACHE_VARIABLE(OpenMVG_USE_OPENMP OFF) -- remove_definitions(-DOPENMVG_USE_OPENMP) - endif (OpenMVG_USE_OPENMP) - - # ============================================================================== -@@ -170,9 +168,10 @@ endif() +@@ -191,9 +195,10 @@ endif() # ============================================================================== # IMAGE IO detection # ============================================================================== @@ -68,43 +48,7 @@ index 5d909ec..ab7eb6f 100644 # Folders set_property(GLOBAL PROPERTY USE_FOLDERS ON) -@@ -192,6 +191,7 @@ if (OpenMVG_BUILD_OPENGL_EXAMPLES) - set_property(TARGET glfw PROPERTY FOLDER OpenMVG/3rdParty/glfw) - endif (OpenMVG_BUILD_OPENGL_EXAMPLES) - -+if(0) - # Dependencies install rules - install( - DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/dependencies/ -@@ -199,6 +199,7 @@ install( - COMPONENT headers - FILES_MATCHING PATTERN "*.hpp" PATTERN "*.h" - ) -+endif() - - # ============================================================================== - # --END-- SUBMODULE CONFIGURATION -@@ -235,6 +236,7 @@ ENDMACRO(UNIT_TEST) - # - external by default - # - internal if cereal not found - # ============================================================================== -+if(0) - find_package(cereal QUIET CONFIG) - if (NOT TARGET cereal) - add_library(cereal INTERFACE) -@@ -247,7 +249,11 @@ if (NOT TARGET cereal) - - set(OpenMVG_USE_INTERNAL_CEREAL ON) - endif() -+endif() - -+find_package(cereal REQUIRED CONFIG) -+get_target_property(CEREAL_INCLUDE_DIRS cereal::cereal INTERFACE_INCLUDE_DIRECTORIES) -+ - # ============================================================================== - # Eigen - # ============================================================================== -@@ -255,6 +261,7 @@ endif() +@@ -281,6 +286,7 @@ endif() # - external if EIGEN_INCLUDE_DIR_HINTS is defined # - internal if Eigen not found # ============================================================================== @@ -112,18 +56,19 @@ index 5d909ec..ab7eb6f 100644 find_package(Eigen3 QUIET) if (NOT Eigen3_FOUND) set(EIGEN_INCLUDE_DIR_HINTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/eigen) -@@ -263,6 +270,10 @@ if (NOT Eigen3_FOUND) +@@ -289,7 +295,11 @@ if (NOT Eigen3_FOUND) else() set(EIGEN_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR}) endif() +endif() -+ ++ + add_definitions(-DEIGEN_MPL2_ONLY) +find_package(Eigen3 REQUIRED) +set(EIGEN_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR}) # ============================================================================== # Ceres -@@ -270,6 +281,7 @@ endif() +@@ -297,6 +307,7 @@ add_definitions(-DEIGEN_MPL2_ONLY) # - external by default if CERES_DIR_HINTS or find_package found a valid Ceres # - internal if ceres not found (ceres-solver+cxsparse+miniglog) # ============================================================================== @@ -131,17 +76,17 @@ index 5d909ec..ab7eb6f 100644 find_package(Ceres QUIET HINTS ${CERES_DIR_HINTS}) if (NOT Ceres_FOUND) set(OpenMVG_USE_INTERNAL_CERES ON) -@@ -281,6 +293,9 @@ if (NOT Ceres_FOUND) +@@ -308,6 +319,9 @@ if (NOT Ceres_FOUND) STRING(REGEX REPLACE "version ([0-9.]+).*" "\\1" CERES_VERSION ${CERES_CONFIG}) set(CERES_LIBRARIES openMVG_ceres) endif() +endif() -+ ++ +find_package(Ceres REQUIRED) # ============================================================================== # Flann -@@ -288,6 +303,7 @@ endif() +@@ -315,6 +329,7 @@ endif() # - internal by default (flann), # - external if FLANN_INCLUDE_DIR_HINTS and a valid Flann setup is found # ============================================================================== @@ -149,17 +94,33 @@ index 5d909ec..ab7eb6f 100644 if (NOT DEFINED FLANN_INCLUDE_DIR_HINTS) set(FLANN_INCLUDE_DIR_HINTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/flann/src/cpp) set(OpenMVG_USE_INTERNAL_FLANN ON) -@@ -296,6 +312,9 @@ find_package(Flann QUIET) +@@ -330,6 +345,9 @@ endif() if (NOT FLANN_FOUND OR OpenMVG_USE_INTERNAL_FLANN) set(FLANN_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/flann/src/cpp) endif() +endif() -+ ++ +find_package(flann REQUIRED) - + # ============================================================================== # CoinUtils -@@ -364,6 +395,7 @@ endif() +@@ -356,13 +374,13 @@ endif() + if (NOT DEFINED CLP_INCLUDE_DIR_HINTS) + set(CLP_INCLUDE_DIR_HINTS ${CMAKE_CURRENT_SOURCE_DIR}/dependencies/osi_clp/Clp/src/) + set(OpenMVG_USE_INTERNAL_CLP ON) +- find_package(Clp QUIET) ++ find_package(Clp REQUIRED) + set(CLP_INCLUDE_DIRS + ${CMAKE_CURRENT_SOURCE_DIR}/dependencies/osi_clp/Clp/src/ + ${CMAKE_CURRENT_SOURCE_DIR}/dependencies/osi_clp/Clp/src/OsiClp/) + set(CLP_LIBRARIES lib_clp lib_OsiClpSolver) + else() +- find_package(Clp QUIET) ++ find_package(Clp REQUIRED) + endif() + + # ============================================================================== +@@ -398,6 +416,7 @@ endif() # - internal by default (Lemon), # - external if LEMON_INCLUDE_DIR_HINTS and a valid Lemon setup is found # ============================================================================== @@ -167,7 +128,7 @@ index 5d909ec..ab7eb6f 100644 if (NOT DEFINED LEMON_INCLUDE_DIR_HINTS) set(LEMON_INCLUDE_DIR_HINTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/lemon) set(OpenMVG_USE_INTERNAL_LEMON ON) -@@ -374,6 +406,9 @@ if (NOT LEMON_FOUND OR OpenMVG_USE_INTERNAL_LEMON) +@@ -408,13 +427,16 @@ if (NOT LEMON_FOUND OR OpenMVG_USE_INTERNAL_LEMON) ${CMAKE_CURRENT_SOURCE_DIR}/third_party/lemon ${PROJECT_BINARY_DIR}/third_party/lemon) endif() @@ -177,21 +138,24 @@ index 5d909ec..ab7eb6f 100644 # ============================================================================== # OpenCV -@@ -381,12 +416,7 @@ endif() + # ============================================================================== # - only external and enabled only if OpenMVG_USE_OPENCV is set to ON # ============================================================================== - if (OpenMVG_USE_OPENCV) -- find_package( OpenCV QUIET ) -- if (NOT OpenCV_FOUND OR OpenCV_VERSION VERSION_LESS "3.0.0") -- message(STATUS "OpenCV was not found (note that OpenCV version >= 3.0.0 is required). -> Disabling OpenCV support.") -- UPDATE_CACHE_VARIABLE(OpenMVG_USE_OPENCV OFF) -- UPDATE_CACHE_VARIABLE(OpenMVG_USE_OCVSIFT OFF) -- endif() -+ find_package( OpenCV REQUIRED ) +-if (OpenMVG_USE_OPENCV) ++if (0) + find_package( OpenCV QUIET ) + if (NOT OpenCV_FOUND OR OpenCV_VERSION VERSION_LESS "3.0.0") + message(STATUS "OpenCV was not found (note that OpenCV version >= 3.0.0 is required). -> Disabling OpenCV support.") +@@ -429,7 +451,7 @@ endif() + # ============================================================================== + # - enabled only if OpenMVG_USE_LIGT is set to ON + # ============================================================================== +-if (OpenMVG_USE_LIGT) ++if (0) + add_definitions(-DUSE_PATENTED_LIGT) endif() - -@@ -394,7 +424,6 @@ endif() +@@ -438,7 +460,6 @@ endif() # Third-party libraries: # ============================================================================== add_subdirectory(third_party) @@ -199,7 +163,35 @@ index 5d909ec..ab7eb6f 100644 # ============================================================================== # openMVG modules -@@ -481,67 +510,67 @@ message("** Use OpenCV SIFT features: " ${OpenMVG_USE_OCVSIFT}) +@@ -447,14 +468,14 @@ add_subdirectory(testing) + add_subdirectory(openMVG) + + # openMVG tutorial examples +-if (OpenMVG_BUILD_EXAMPLES) ++if (0) + add_subdirectory(openMVG_Samples) +-endif (OpenMVG_BUILD_EXAMPLES) ++endif () + + # Complete software(s) build on openMVG libraries +-if (OpenMVG_BUILD_SOFTWARES) ++if (0) + add_subdirectory(software) +-endif (OpenMVG_BUILD_SOFTWARES) ++endif () + + # Included for research purpose only + add_subdirectory(nonFree) +@@ -464,7 +485,7 @@ add_subdirectory(nonFree) + # -------------------------- + # Sphinx detection + # ============================================================================== +-if (OpenMVG_BUILD_DOC) ++if (0) + find_package(Sphinx) + if (EXISTS ${SPHINX_EXECUTABLE}) + set(SPHINX_HTML_DIR "${CMAKE_CURRENT_BINARY_DIR}/htmlDoc") +@@ -526,67 +547,67 @@ message("** Use LiGT for global translation estimation: " ${OpenMVG_USE_LIGT}) message("\n") @@ -278,23 +270,27 @@ index 5d909ec..ab7eb6f 100644 message(STATUS "LEMON: " ${LEMON_VERSION} " (internal)") else() message(STATUS "LEMON: " ${LEMON_VERSION} " (external)") +diff --git a/src/cmakeFindModules/FindClp.cmake b/src/cmakeFindModules/FindClp.cmake +index 8a69c234..1ed9a21f 100644 +--- a/src/cmakeFindModules/FindClp.cmake ++++ b/src/cmakeFindModules/FindClp.cmake +@@ -51,7 +51,7 @@ IF(EXISTS "${CLP_DIR}" AND NOT "${CLP_DIR}" STREQUAL "") + SET(CLP_INCLUDE_DIR ${CLP_DIR}) + + FIND_LIBRARY(CLP_LIBRARY NAMES Clp) +- FIND_LIBRARY(CLPSOLVER_LIBRARY NAMES ClpSolver) ++ FIND_LIBRARY(CLPSOLVER_LIBRARY NAMES ClpSolver Clp) + FIND_LIBRARY(OSICLP_LIBRARY NAMES OsiClp) + + # locate Clp libraries diff --git a/src/cmakeFindModules/OpenMVGConfig.cmake.in b/src/cmakeFindModules/OpenMVGConfig.cmake.in -index e7dfbfd..65224c4 100644 +index 5a788b56..02431ce2 100644 --- a/src/cmakeFindModules/OpenMVGConfig.cmake.in +++ b/src/cmakeFindModules/OpenMVGConfig.cmake.in -@@ -19,7 +19,7 @@ - # OPENMVG_VERSION: Version of OpenMVG found. - # - --# Called if we failed to find OpenMVG or any of it's required dependencies, -+# Called if we failed to find OpenMVG or any of its required dependencies, - # unsets all public (designed to be used externally) variables and reports - # error message at priority depending upon [REQUIRED/QUIET/] argument. - macro(OPENMVG_REPORT_NOT_FOUND REASON_MSG) -@@ -58,10 +58,17 @@ set(CALLERS_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}) - # Reset CMake module path to the installation directory of this - # script. - set(CMAKE_MODULE_PATH ${CURRENT_CONFIG_INSTALL_DIR}) +@@ -51,6 +51,14 @@ set(OPENMVG_VERSION @OPENMVG_VERSION@) + get_filename_component(CURRENT_CONFIG_INSTALL_DIR + "${CMAKE_CURRENT_LIST_FILE}" PATH) + +include(CMakeFindDependencyMacro) + +find_dependency(flann) @@ -302,6 +298,11 @@ index e7dfbfd..65224c4 100644 +find_dependency(cereal) +find_dependency(Ceres) +find_dependency(vlfeat) ++ + # Record the state of the CMake module path when this script was + # called so that we can ensure that we leave it in the same state on + # exit as it was on entry, but modify it locally. +@@ -61,7 +69,7 @@ set(CMAKE_MODULE_PATH ${CURRENT_CONFIG_INSTALL_DIR}) # Build the absolute root install directory as a relative path get_filename_component(CURRENT_ROOT_INSTALL_DIR @@ -310,103 +311,8 @@ index e7dfbfd..65224c4 100644 if (NOT EXISTS ${CURRENT_ROOT_INSTALL_DIR}) OPENMVG_REPORT_NOT_FOUND( "OpenMVG install root: ${CURRENT_ROOT_INSTALL_DIR}, " -diff --git a/src/nonFree/sift/CMakeLists.txt b/src/nonFree/sift/CMakeLists.txt -index 402a2d8..60ddc11 100644 ---- a/src/nonFree/sift/CMakeLists.txt -+++ b/src/nonFree/sift/CMakeLists.txt -@@ -1,36 +1,36 @@ - --# libs should be static --set(BUILD_SHARED_LIBS OFF) -- --# use PIC code for link into shared lib --if(UNIX) -- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") --endif(UNIX) -- --if(NOT USE_SSE2) -- add_definitions(-DVL_DISABLE_SSE2) --endif() -- --add_definitions(-DVL_DISABLE_THREADS) -- --include_directories(./vl) --set(FEATS -- vl/generic.c -- vl/imopv_sse2.c -- vl/sift.c -- vl/imopv.c -- vl/mathop_sse2.c -- vl/sift.c -- vl/host.c -- vl/mathop.c -- vl/random.c) --set_source_files_properties(${FEATS} PROPERTIES LANGUAGE C) --add_library(vlsift ${FEATS}) --install(TARGETS vlsift DESTINATION lib EXPORT openMVG-targets) --set_property(TARGET vlsift PROPERTY FOLDER OpenMVG/nonFree) -+## libs should be static -+#set(BUILD_SHARED_LIBS OFF) -+# -+## use PIC code for link into shared lib -+#if(UNIX) -+# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") -+#endif(UNIX) -+# -+#if(NOT USE_SSE2) -+# add_definitions(-DVL_DISABLE_SSE2) -+#endif() -+# -+#add_definitions(-DVL_DISABLE_THREADS) -+# -+#include_directories(./vl) -+#set(FEATS -+# vl/generic.c -+# vl/imopv_sse2.c -+# vl/sift.c -+# vl/imopv.c -+# vl/mathop_sse2.c -+# vl/sift.c -+# vl/host.c -+# vl/mathop.c -+# vl/random.c) -+#set_source_files_properties(${FEATS} PROPERTIES LANGUAGE C) -+#add_library(vlsift ${FEATS}) -+#install(TARGETS vlsift DESTINATION lib EXPORT openMVG-targets) -+#set_property(TARGET vlsift PROPERTY FOLDER OpenMVG/nonFree) - install( - DIRECTORY . - DESTINATION include/openMVG_dependencies/nonFree/sift - COMPONENT headers -- FILES_MATCHING PATTERN "*.hpp" PATTERN "*.h" -+ FILES_MATCHING PATTERN "*.hpp" - ) -diff --git a/src/nonFree/sift/SIFT_describer.hpp b/src/nonFree/sift/SIFT_describer.hpp -index cd800b0..20e9c8e 100644 ---- a/src/nonFree/sift/SIFT_describer.hpp -+++ b/src/nonFree/sift/SIFT_describer.hpp -@@ -17,9 +17,7 @@ - #include - #include - --extern "C" { --#include "nonFree/sift/vl/sift.h" --} -+#include - - namespace openMVG { - namespace features { -@@ -174,7 +172,7 @@ public: - const int nkeys = vl_sift_get_nkeypoints(filt); - - // Update gradient before launching parallel extraction -- vl_sift_update_gradient(filt); -+ update_gradient(filt); - - #ifdef OPENMVG_USE_OPENMP - #pragma omp parallel for private(descr, descriptor) diff --git a/src/openMVG/matching/CMakeLists.txt b/src/openMVG/matching/CMakeLists.txt -index 2e0eafd7..d54d1e88 100644 +index b92a49b7..60394c12 100644 --- a/src/openMVG/matching/CMakeLists.txt +++ b/src/openMVG/matching/CMakeLists.txt @@ -16,6 +16,7 @@ list(REMOVE_ITEM matching_files_cpp ${REMOVEFILESUNITTEST}) @@ -417,125 +323,8 @@ index 2e0eafd7..d54d1e88 100644 set_source_files_properties(${matching_files_cpp} PROPERTIES LANGUAGE CXX) add_library(openMVG_matching -@@ -35,12 +36,12 @@ target_link_libraries(openMVG_matching - PUBLIC - openMVG_features - Threads::Threads -- cereal -+ cereal::cereal - ) --if (NOT DEFINED OpenMVG_USE_INTERNAL_FLANN) -+if (NOT OpenMVG_USE_INTERNAL_FLANN) - target_link_libraries(openMVG_matching - PUBLIC -- ${FLANN_LIBRARIES} -+ $,flann::flann_s,flann::flann> - ) - endif() - set_target_properties(openMVG_matching PROPERTIES SOVERSION ${OPENMVG_VERSION_MAJOR} VERSION "${OPENMVG_VERSION_MAJOR}.${OPENMVG_VERSION_MINOR}") -diff --git a/src/openMVG/numeric/CMakeLists.txt b/src/openMVG/numeric/CMakeLists.txt -index 1f3fc30..4097320 100644 ---- a/src/openMVG/numeric/CMakeLists.txt -+++ b/src/openMVG/numeric/CMakeLists.txt -@@ -26,7 +26,7 @@ target_include_directories(openMVG_numeric - $ - $ - ) --if (DEFINED OpenMVG_USE_INTERNAL_EIGEN) -+if (OpenMVG_USE_INTERNAL_EIGEN) - target_include_directories(openMVG_numeric PUBLIC - $) - else() -diff --git a/src/openMVG_Samples/describe_and_match_GUI/CMakeLists.txt b/src/openMVG_Samples/describe_and_match_GUI/CMakeLists.txt -index 862ffc7..62508af 100644 ---- a/src/openMVG_Samples/describe_and_match_GUI/CMakeLists.txt -+++ b/src/openMVG_Samples/describe_and_match_GUI/CMakeLists.txt -@@ -18,8 +18,7 @@ if (OpenMVG_BUILD_GUI_SOFTWARES) - add_executable( openMVG_sample_describe_and_match_GUI WIN32 ${FEATURES_PAIR_DEMO_SRCS} ${FEATURES_PAIR_DEMO_HDRS} ) - endif( APPLE ) - -- target_link_libraries( openMVG_sample_describe_and_match_GUI Qt5::Widgets openMVG_features openMVG_image openMVG_matching vlsift ) -- -+ target_link_libraries( openMVG_sample_describe_and_match_GUI Qt5::Widgets openMVG_features openMVG_image openMVG_matching unofficial::vlfeat::vl ) - set_target_properties( openMVG_sample_describe_and_match_GUI PROPERTIES CXX_STANDARD 11) - - set_property(TARGET openMVG_sample_describe_and_match_GUI PROPERTY FOLDER OpenMVG/Samples) -diff --git a/src/openMVG_Samples/features_image_matching/CMakeLists.txt b/src/openMVG_Samples/features_image_matching/CMakeLists.txt -index 18fb385..d44ffce 100644 ---- a/src/openMVG_Samples/features_image_matching/CMakeLists.txt -+++ b/src/openMVG_Samples/features_image_matching/CMakeLists.txt -@@ -5,7 +5,7 @@ target_link_libraries(openMVG_sample_image_matching - openMVG_features - openMVG_matching - ${STLPLUS_LIBRARY} -- vlsift) -+ unofficial::vlfeat::vl) - target_compile_definitions(openMVG_sample_image_matching - PRIVATE -DTHIS_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}") - -diff --git a/src/openMVG_Samples/features_repeatability/CMakeLists.txt b/src/openMVG_Samples/features_repeatability/CMakeLists.txt -index fd2b7c6..91f2766 100644 ---- a/src/openMVG_Samples/features_repeatability/CMakeLists.txt -+++ b/src/openMVG_Samples/features_repeatability/CMakeLists.txt -@@ -6,7 +6,7 @@ target_link_libraries(openMVG_sample_main_features_repeatability_dataset - openMVG_matching - openMVG_system - openMVG_multiview -- vlsift -+ unofficial::vlfeat::vl - ${STLPLUS_LIBRARY}) - - set_property(TARGET openMVG_sample_main_features_repeatability_dataset PROPERTY FOLDER OpenMVG/Samples) -diff --git a/src/software/Localization/CMakeLists.txt b/src/software/Localization/CMakeLists.txt -index 2f60393..0d57d0a 100644 ---- a/src/software/Localization/CMakeLists.txt -+++ b/src/software/Localization/CMakeLists.txt -@@ -11,7 +11,7 @@ target_link_libraries(openMVG_main_SfM_Localization - openMVG_sfm - openMVG_exif - ${STLPLUS_LIBRARY} -- vlsift -+ unofficial::vlfeat::vl - ) - - # Installation rules -diff --git a/src/software/SfM/CMakeLists.txt b/src/software/SfM/CMakeLists.txt -index 6db7e83..51e06f5 100644 ---- a/src/software/SfM/CMakeLists.txt -+++ b/src/software/SfM/CMakeLists.txt -@@ -44,7 +44,7 @@ target_link_libraries(openMVG_main_ComputeFeatures - openMVG_multiview - openMVG_sfm - ${STLPLUS_LIBRARY} -- vlsift -+ unofficial::vlfeat::vl - ) - if (MSVC) - set_target_properties(openMVG_main_ComputeFeatures PROPERTIES COMPILE_FLAGS "/bigobj") -@@ -275,7 +275,7 @@ if(OpenMVG_USE_OPENCV) - openMVG_multiview - openMVG_sfm - ${STLPLUS_LIBRARY} -- vlsift -+ unofficial::vlfeat::vl - ${OpenCV_LIBS}) - target_include_directories(openMVG_main_ComputeFeatures_OpenCV PRIVATE ${OpenCV_INCLUDE_DIRS}) - -diff --git a/src/software/VO/Tracker_opencv_klt.hpp b/src/software/VO/Tracker_opencv_klt.hpp -index aa7dffe..2c4d237 100644 ---- a/src/software/VO/Tracker_opencv_klt.hpp -+++ b/src/software/VO/Tracker_opencv_klt.hpp -@@ -80,7 +80,7 @@ struct Tracker_opencv_KLT : public Abstract_Tracker - std::vector m_nextKeypoints; - - cv::Ptr m_detector = cv::GFTTDetector::create(count); -- if (m_detector == NULL) -+ if (m_detector == nullptr) - return false; - - m_detector->detect(current_img, m_nextKeypoints); diff --git a/src/third_party/CMakeLists.txt b/src/third_party/CMakeLists.txt -index 0d61c9f..05c8b29 100644 +index 1e025dc6..4a06dfcc 100644 --- a/src/third_party/CMakeLists.txt +++ b/src/third_party/CMakeLists.txt @@ -18,7 +18,7 @@ add_subdirectory(stlplus3) @@ -543,114 +332,32 @@ index 0d61c9f..05c8b29 100644 # Add graph library -if(DEFINED OpenMVG_USE_INTERNAL_LEMON) -+if(OpenMVG_USE_INTERNAL_LEMON) ++if(0) add_subdirectory(lemon) set(LEMON_LIBRARY openMVG_lemon PARENT_SCOPE) endif() -@@ -67,7 +67,7 @@ endif (NOT TIFF_FOUND) - add_subdirectory(vectorGraphics) +@@ -64,13 +64,13 @@ endif (NOT TIFF_FOUND) + ## # Add ceres-solver (A Nonlinear Least Squares Minimizer) -if (DEFINED OpenMVG_USE_INTERNAL_CERES) -+if (OpenMVG_USE_INTERNAL_CERES) - add_subdirectory(cxsparse) ++if (0) add_subdirectory(ceres-solver) - set_property(TARGET openMVG_cxsparse PROPERTY FOLDER OpenMVG/3rdParty/ceres) -@@ -75,7 +75,7 @@ if (DEFINED OpenMVG_USE_INTERNAL_CERES) + set_property(TARGET openMVG_ceres PROPERTY FOLDER OpenMVG/3rdParty/ceres) endif() # Add an Approximate Nearest Neighbor library -if (DEFINED OpenMVG_USE_INTERNAL_FLANN) -+if (OpenMVG_USE_INTERNAL_FLANN) ++if (0) set(FLANN_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/openMVG/third_party/flann/src/cpp) add_subdirectory(flann) endif() -@@ -89,7 +89,7 @@ add_subdirectory(fast) +@@ -84,7 +84,7 @@ add_subdirectory(fast) ## # Install Header only libraries if necessary ## -if (DEFINED OpenMVG_USE_INTERNAL_EIGEN) -+if (OpenMVG_USE_INTERNAL_EIGEN) ++if (0) #Configure Eigen install set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/openMVG/third_party/eigen) add_subdirectory(eigen) -diff --git a/src/openMVG/cameras/CMakeLists.txt b/src/openMVG/cameras/CMakeLists.txt -index 333ab729..50c8f572 100644 ---- a/src/openMVG/cameras/CMakeLists.txt -+++ b/src/openMVG/cameras/CMakeLists.txt -@@ -4,7 +4,7 @@ set_property(TARGET openMVG_camera APPEND PROPERTY - INTERFACE_INCLUDE_DIRECTORIES "$") - - target_compile_features(openMVG_camera INTERFACE ${CXX11_FEATURES}) --target_link_libraries(openMVG_camera INTERFACE openMVG_numeric cereal ${OPENMVG_LIBRARY_DEPENDENCIES}) -+target_link_libraries(openMVG_camera INTERFACE openMVG_numeric cereal::cereal ${OPENMVG_LIBRARY_DEPENDENCIES}) - install(TARGETS openMVG_camera DESTINATION lib EXPORT openMVG-targets) - - UNIT_TEST(openMVG Camera_Pinhole openMVG_camera) -diff --git a/src/openMVG/features/CMakeLists.txt b/src/openMVG/features/CMakeLists.txt -index 2e49701d..0b5e1c3d 100644 ---- a/src/openMVG/features/CMakeLists.txt -+++ b/src/openMVG/features/CMakeLists.txt -@@ -31,7 +31,7 @@ target_include_directories(openMVG_features - ) - target_link_libraries(openMVG_features - PRIVATE openMVG_fast ${STLPLUS_LIBRARY} -- PUBLIC ${OPENMVG_LIBRARY_DEPENDENCIES} cereal) -+ PUBLIC ${OPENMVG_LIBRARY_DEPENDENCIES} cereal::cereal) - if (MSVC) - set_target_properties(openMVG_features PROPERTIES COMPILE_FLAGS "/bigobj") - target_compile_options(openMVG_features PUBLIC "-D_USE_MATH_DEFINES") -diff --git a/src/openMVG/geometry/CMakeLists.txt b/src/openMVG/geometry/CMakeLists.txt -index 0a6a016a..e509a4d5 100644 ---- a/src/openMVG/geometry/CMakeLists.txt -+++ b/src/openMVG/geometry/CMakeLists.txt -@@ -21,7 +21,7 @@ set_property(TARGET openMVG_geometry PROPERTY FOLDER OpenMVG/OpenMVG) - target_link_libraries(openMVG_geometry - PUBLIC - openMVG_numeric -- cereal -+ cereal::cereal - PRIVATE - openMVG_linearProgramming - ) -diff --git a/src/openMVG/sfm/CMakeLists.txt b/src/openMVG/sfm/CMakeLists.txt -index b8928083..1d10f939 100644 ---- a/src/openMVG/sfm/CMakeLists.txt -+++ b/src/openMVG/sfm/CMakeLists.txt -@@ -25,7 +25,7 @@ target_link_libraries(openMVG_sfm - openMVG_graph - openMVG_matching - openMVG_multiview -- cereal -+ cereal::cereal - ${OPENMVG_LIBRARY_DEPENDENCIES} - ) - -diff --git a/src/cmakeFindModules/FindClp.cmake b/src/cmakeFindModules/FindClp.cmake -index 8a69c2344..1ed9a21fe 100644 ---- a/src/cmakeFindModules/FindClp.cmake -+++ b/src/cmakeFindModules/FindClp.cmake -@@ -51,7 +51,7 @@ IF(EXISTS "${CLP_DIR}" AND NOT "${CLP_DIR}" STREQUAL "") - SET(CLP_INCLUDE_DIR ${CLP_DIR}) - - FIND_LIBRARY(CLP_LIBRARY NAMES Clp) -- FIND_LIBRARY(CLPSOLVER_LIBRARY NAMES ClpSolver) -+ FIND_LIBRARY(CLPSOLVER_LIBRARY NAMES ClpSolver Clp) - FIND_LIBRARY(OSICLP_LIBRARY NAMES OsiClp) - - # locate Clp libraries - -diff --git a/src/openMVG/matching/metric_simd.hpp b/src/openMVG/matching/metric_simd.hpp -index 7e09f6ed..916c84e0 100644 ---- a/src/openMVG/matching/metric_simd.hpp -+++ b/src/openMVG/matching/metric_simd.hpp -@@ -17,7 +17,9 @@ - #include - - #include -+#if defined(__amd64__) || defined(__i386__) - #include -+#endif - - namespace openMVG { - namespace matching { diff --git a/ports/openmvg/cmakelists.patch b/ports/openmvg/cmakelists.patch new file mode 100644 index 00000000000000..728d30e9d94fcb --- /dev/null +++ b/ports/openmvg/cmakelists.patch @@ -0,0 +1,299 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 6879c4c6..fed74a70 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -24,6 +24,7 @@ endif() + + set(CMAKE_FIND_FRAMEWORK LAST) + ++if(0) + # ============================================================================== + # OpenMVG build options + # ============================================================================== +@@ -59,6 +60,7 @@ option(OpenMVG_USE_OCVSIFT "Add or not OpenCV SIFT in available features" OFF) + # Enable this to be able to use LiGT in main_SfM. + # ============================================================================== + option(OpenMVG_USE_LIGT "Add or not LiGT in available" ON) ++endif() + + # ============================================================================== + # OpenMVG version +@@ -104,6 +106,7 @@ else (OpenMVG_BUILD_SHARED) + set(BUILD_SHARED_LIBS OFF) + endif() + ++if(0) + # ============================================================================== + # Check that submodule have been initialized and updated + # ============================================================================== +@@ -112,6 +115,7 @@ if (NOT EXISTS ${PROJECT_SOURCE_DIR}/dependencies/cereal/include) + "\n submodule(s) are missing, please update your repository:\n" + " > git submodule update -i\n") + endif() ++endif() + + # ============================================================================== + # Additional cmake find modules +@@ -191,9 +195,10 @@ endif() + # ============================================================================== + # IMAGE IO detection + # ============================================================================== +-find_package(JPEG QUIET) +-find_package(PNG QUIET) +-find_package(TIFF QUIET) ++find_package(JPEG REQUIRED) ++find_package(PNG REQUIRED) ++find_package(TIFF REQUIRED) ++find_package(vlfeat REQUIRED) + + # Folders + set_property(GLOBAL PROPERTY USE_FOLDERS ON) +@@ -257,6 +262,7 @@ ENDMACRO(UNIT_TEST) + # - internal if cereal not found + # - as of cereal:1.3.1 target requires component + # ============================================================================== ++if(0) + find_package(cereal QUIET CONFIG) + if (NOT cereal_FOUND) + add_library(cereal INTERFACE) +@@ -273,6 +279,10 @@ if (TARGET cereal::cereal) + else() + set(cereal_TARGET "cereal") + endif() ++endif() ++ ++find_package(cereal REQUIRED CONFIG) ++get_target_property(CEREAL_INCLUDE_DIRS cereal::cereal INTERFACE_INCLUDE_DIRECTORIES) + + # ============================================================================== + # Eigen +@@ -281,6 +291,7 @@ endif() + # - external if EIGEN_INCLUDE_DIR_HINTS is defined + # - internal if Eigen not found + # ============================================================================== ++if(0) + find_package(Eigen3 QUIET) + if (NOT Eigen3_FOUND) + set(EIGEN_INCLUDE_DIR_HINTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/eigen) +@@ -289,7 +300,11 @@ if (NOT Eigen3_FOUND) + else() + set(EIGEN_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR}) + endif() ++endif() ++ + add_definitions(-DEIGEN_MPL2_ONLY) ++find_package(Eigen3 REQUIRED) ++set(EIGEN_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR}) + + # ============================================================================== + # Ceres +@@ -297,6 +312,7 @@ add_definitions(-DEIGEN_MPL2_ONLY) + # - external by default if CERES_DIR_HINTS or find_package found a valid Ceres + # - internal if ceres not found (ceres-solver+cxsparse+miniglog) + # ============================================================================== ++if(0) + find_package(Ceres QUIET HINTS ${CERES_DIR_HINTS}) + if (NOT Ceres_FOUND) + set(OpenMVG_USE_INTERNAL_CERES ON) +@@ -308,6 +324,9 @@ if (NOT Ceres_FOUND) + STRING(REGEX REPLACE "version ([0-9.]+).*" "\\1" CERES_VERSION ${CERES_CONFIG}) + set(CERES_LIBRARIES openMVG_ceres) + endif() ++endif() ++ ++find_package(Ceres REQUIRED) + + # ============================================================================== + # Flann +@@ -315,6 +334,7 @@ endif() + # - internal by default (flann), + # - external if FLANN_INCLUDE_DIR_HINTS and a valid Flann setup is found + # ============================================================================== ++if(0) + if (NOT DEFINED FLANN_INCLUDE_DIR_HINTS) + set(FLANN_INCLUDE_DIR_HINTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/flann/src/cpp) + set(OpenMVG_USE_INTERNAL_FLANN ON) +@@ -330,6 +350,9 @@ endif() + if (NOT FLANN_FOUND OR OpenMVG_USE_INTERNAL_FLANN) + set(FLANN_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/flann/src/cpp) + endif() ++endif() ++ ++find_package(flann REQUIRED) + + # ============================================================================== + # CoinUtils +@@ -398,6 +421,7 @@ endif() + # - internal by default (Lemon), + # - external if LEMON_INCLUDE_DIR_HINTS and a valid Lemon setup is found + # ============================================================================== ++if(0) + if (NOT DEFINED LEMON_INCLUDE_DIR_HINTS) + set(LEMON_INCLUDE_DIR_HINTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/lemon) + set(OpenMVG_USE_INTERNAL_LEMON ON) +@@ -408,13 +432,16 @@ if (NOT LEMON_FOUND OR OpenMVG_USE_INTERNAL_LEMON) + ${CMAKE_CURRENT_SOURCE_DIR}/third_party/lemon + ${PROJECT_BINARY_DIR}/third_party/lemon) + endif() ++endif() ++ ++find_package(LEMON REQUIRED) + + # ============================================================================== + # OpenCV + # ============================================================================== + # - only external and enabled only if OpenMVG_USE_OPENCV is set to ON + # ============================================================================== +-if (OpenMVG_USE_OPENCV) ++if (0) + find_package( OpenCV QUIET ) + if (NOT OpenCV_FOUND OR OpenCV_VERSION VERSION_LESS "3.0.0") + message(STATUS "OpenCV was not found (note that OpenCV version >= 3.0.0 is required). -> Disabling OpenCV support.") +@@ -429,7 +456,7 @@ endif() + # ============================================================================== + # - enabled only if OpenMVG_USE_LIGT is set to ON + # ============================================================================== +-if (OpenMVG_USE_LIGT) ++if (0) + add_definitions(-DUSE_PATENTED_LIGT) + endif() + +@@ -438,7 +465,6 @@ endif() + # Third-party libraries: + # ============================================================================== + add_subdirectory(third_party) +-add_subdirectory(testing) + + # ============================================================================== + # openMVG modules +@@ -447,12 +473,12 @@ add_subdirectory(testing) + add_subdirectory(openMVG) + + # openMVG tutorial examples +-if (OpenMVG_BUILD_EXAMPLES) ++if (0) + add_subdirectory(openMVG_Samples) + endif (OpenMVG_BUILD_EXAMPLES) + + # Complete software(s) build on openMVG libraries +-if (OpenMVG_BUILD_SOFTWARES) ++if (0) + add_subdirectory(software) + endif (OpenMVG_BUILD_SOFTWARES) + +@@ -464,7 +490,7 @@ add_subdirectory(nonFree) + # -------------------------- + # Sphinx detection + # ============================================================================== +-if (OpenMVG_BUILD_DOC) ++if (0) + find_package(Sphinx) + if (EXISTS ${SPHINX_EXECUTABLE}) + set(SPHINX_HTML_DIR "${CMAKE_CURRENT_BINARY_DIR}/htmlDoc") +@@ -526,67 +552,67 @@ message("** Use LiGT for global translation estimation: " ${OpenMVG_USE_LIGT}) + + message("\n") + +-if (DEFINED OpenMVG_USE_INTERNAL_CEREAL) ++if (OpenMVG_USE_INTERNAL_CEREAL) + message(STATUS "CEREAL: (internal)") + else() + message(STATUS "CEREAL: (external)") + endif() + +-if (DEFINED OpenMVG_USE_INTERNAL_EIGEN) ++if (OpenMVG_USE_INTERNAL_EIGEN) + message(STATUS "EIGEN: " ${EIGEN_VERSION} " (internal)") + else() + message(STATUS "EIGEN: " ${EIGEN_VERSION} " (external)") + endif() + +-if (DEFINED OpenMVG_USE_INTERNAL_CERES) ++if (OpenMVG_USE_INTERNAL_CERES) + message(STATUS "CERES: " ${CERES_VERSION} " (internal)") + else() + message(STATUS "CERES: " ${CERES_VERSION} " (external)") + endif() + +-if (DEFINED OpenMVG_USE_INTERNAL_FLANN) ++if (OpenMVG_USE_INTERNAL_FLANN) + message(STATUS "FLANN: " ${FLANN_VERSION} " (internal)") + else() + message(STATUS "FLANN: " ${FLANN_VERSION} " (external)") + endif() + +-if (DEFINED OpenMVG_USE_INTERNAL_TIFF) ++if (OpenMVG_USE_INTERNAL_TIFF) + message(STATUS "LIBTIFF: " ${TIFF_VERSION_STRING} " (internal)") + else() + message(STATUS "LIBTIFF: " ${TIFF_VERSION_STRING} " (external)") + endif() + +-if (DEFINED OpenMVG_USE_INTERNAL_PNG) ++if (OpenMVG_USE_INTERNAL_PNG) + message(STATUS "LIBPNG: " ${PNG_VERSION_STRING} " (internal)") + else() + message(STATUS "LIBPNG: " ${PNG_VERSION_STRING} " (external)") + endif() + +-if (DEFINED OpenMVG_USE_INTERNAL_JPEG) ++if (OpenMVG_USE_INTERNAL_JPEG) + message(STATUS "LIBJPEG (internal)") + else() + message(STATUS "LIBJPEG (external)") + endif() + +-if (DEFINED OpenMVG_USE_INTERNAL_CLP) ++if (OpenMVG_USE_INTERNAL_CLP) + message(STATUS "CLP: " ${CLP_VERSION} " (internal)") + else() + message(STATUS "CLP: " ${CLP_VERSION} " (external)") + endif() + +-if (DEFINED OpenMVG_USE_INTERNAL_COINUTILS) ++if (OpenMVG_USE_INTERNAL_COINUTILS) + message(STATUS "COINUTILS: " ${COINUTILS_VERSION} " (internal)") + else() + message(STATUS "COINUTILS: " ${COINUTILS_VERSION} " (external)") + endif() + +-if (DEFINED OpenMVG_USE_INTERNAL_OSI) ++if (OpenMVG_USE_INTERNAL_OSI) + message(STATUS "OSI: " ${OSI_VERSION} " (internal)") + else() + message(STATUS "OSI: " ${OSI_VERSION} " (external)") + endif() + +-if (DEFINED OpenMVG_USE_INTERNAL_LEMON) ++if (OpenMVG_USE_INTERNAL_LEMON) + message(STATUS "LEMON: " ${LEMON_VERSION} " (internal)") + else() + message(STATUS "LEMON: " ${LEMON_VERSION} " (external)") +diff --git a/src/cmakeFindModules/OpenMVGConfig.cmake.in b/src/cmakeFindModules/OpenMVGConfig.cmake.in +index 5a788b56..02431ce2 100644 +--- a/src/cmakeFindModules/OpenMVGConfig.cmake.in ++++ b/src/cmakeFindModules/OpenMVGConfig.cmake.in +@@ -51,6 +51,14 @@ set(OPENMVG_VERSION @OPENMVG_VERSION@) + get_filename_component(CURRENT_CONFIG_INSTALL_DIR + "${CMAKE_CURRENT_LIST_FILE}" PATH) + ++include(CMakeFindDependencyMacro) ++ ++find_dependency(flann) ++find_dependency(Threads) ++find_dependency(cereal) ++find_dependency(Ceres) ++find_dependency(vlfeat) ++ + # Record the state of the CMake module path when this script was + # called so that we can ensure that we leave it in the same state on + # exit as it was on entry, but modify it locally. +@@ -61,7 +69,7 @@ set(CMAKE_MODULE_PATH ${CURRENT_CONFIG_INSTALL_DIR}) + + # Build the absolute root install directory as a relative path + get_filename_component(CURRENT_ROOT_INSTALL_DIR +- ${CMAKE_MODULE_PATH}/../../../ ABSOLUTE) ++ ${CMAKE_MODULE_PATH}/../../ ABSOLUTE) + if (NOT EXISTS ${CURRENT_ROOT_INSTALL_DIR}) + OPENMVG_REPORT_NOT_FOUND( + "OpenMVG install root: ${CURRENT_ROOT_INSTALL_DIR}, " diff --git a/ports/openmvg/fix-coinutils.patch b/ports/openmvg/fix-coinutils.patch deleted file mode 100644 index 903c84a00616b0..00000000000000 --- a/ports/openmvg/fix-coinutils.patch +++ /dev/null @@ -1,47 +0,0 @@ -diff --git a/src/openMVG/linearProgramming/CMakeLists.txt b/src/openMVG/linearProgramming/CMakeLists.txt -index cc5212fda..0fb59c44c 100644 ---- a/src/openMVG/linearProgramming/CMakeLists.txt -+++ b/src/openMVG/linearProgramming/CMakeLists.txt -@@ -16,8 +16,8 @@ target_link_libraries(openMVG_linearProgramming - openMVG_numeric - PRIVATE - ${CLP_LIBRARIES} # clp + solver wrapper -- ${COINUTILS_LIBRARY} # container tools -- ${OSI_LIBRARY} # generic LP -+ ${COINUTILS_LIBRARIES} # container tools -+ ${OSI_LIBRARIES} # generic LP - ) - - target_include_directories(openMVG_linearProgramming -diff --git a/src/cmakeFindModules/FindCoinUtils.cmake b/src/cmakeFindModules/FindCoinUtils.cmake -index 5b64ce14c..595fb7dc8 100644 ---- a/src/cmakeFindModules/FindCoinUtils.cmake -+++ b/src/cmakeFindModules/FindCoinUtils.cmake -@@ -57,6 +57,12 @@ IF(EXISTS "${COINUTILS_DIR}" AND NOT "${COINUTILS_DIR}" STREQUAL "") - SET(COINUTILS_LIBRARIES ${COINUTILS_LIBRARY}) - ENDIF() - -+ if(NOT WIN32) -+ find_package(PkgConfig) -+ pkg_check_modules(CoinUtils coinutils IMPORTED_TARGET) -+ list(APPEND COINUTILS_LIBRARIES PkgConfig::CoinUtils) -+ endif() -+ - MESSAGE(STATUS "CoinUtils ${COINUTILS_VERSION} found (include: ${COINUTILS_INCLUDE_DIRS})") - ELSE() - MESSAGE(STATUS "You are attempting to build without CoinUtils. " -diff --git a/src/cmakeFindModules/OpenMVGConfig.cmake.in b/src/cmakeFindModules/OpenMVGConfig.cmake.in -index d4ae73d1a..87f71cd7d 100644 ---- a/src/cmakeFindModules/OpenMVGConfig.cmake.in -+++ b/src/cmakeFindModules/OpenMVGConfig.cmake.in -@@ -65,6 +65,10 @@ find_dependency(Threads) - find_dependency(cereal) - find_dependency(Ceres) - find_dependency(vlfeat) -+if(NOT WIN32) -+ find_dependency(PkgConfig) -+ pkg_check_modules(CoinUtils coinutils IMPORTED_TARGET) -+endif() - - # Build the absolute root install directory as a relative path - get_filename_component(CURRENT_ROOT_INSTALL_DIR diff --git a/ports/openmvg/portfile.cmake b/ports/openmvg/portfile.cmake index 369e9472786d5d..6021e8587ae1a6 100644 --- a/ports/openmvg/portfile.cmake +++ b/ports/openmvg/portfile.cmake @@ -10,14 +10,12 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO openMVG/openMVG - REF d0fe73dd426ae4001631a51272cff71047522df9 # v2.0 - SHA512 1d5c68971ad63ced46d8b9070bdacc1065b4ba950fe919e11f952a004def87d4d83a474d48aee714c21b12106d7d81187d3670d8a2e6daf2d3c5fceb008a5de3 + REF 01193a245ee3c36458e650b1cf4402caad8983ef # v2.1 + SHA512 ee98ca26426e7129917c920cd59817cb5d4faf1f5aa12f4085f9ac431875e9ec23ffee7792d65286bad4b922c474c56d5c2f2008b38fddf1ede096644f13ad47 PATCHES build_fixes.patch 0001-eigen_3.4.0.patch - 0002-eigen-3.4.patch no-absolute-paths.patch - fix-coinutils.patch ) set(OpenMVG_USE_OPENMP OFF) @@ -77,17 +75,22 @@ vcpkg_cmake_configure( ) vcpkg_cmake_install() -vcpkg_cmake_config_fixup(CONFIG_PATH share/openMVG/cmake) -if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share") - file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/openMVG-targets.cmake" "${CURRENT_PACKAGES_DIR}/debug/lib/openMVG-targets-debug.cmake") -endif() -file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/openMVG-targets.cmake" "${CURRENT_PACKAGES_DIR}/lib/openMVG-targets-release.cmake") +make_directory("${CURRENT_PACKAGES_DIR}/share/openMVG/") +file(RENAME "${CURRENT_PACKAGES_DIR}/lib/openMVG/cmake" "${CURRENT_PACKAGES_DIR}/share/openMVG/cmake") +make_directory("${CURRENT_PACKAGES_DIR}/debug/share/openMVG/") +file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/openMVG/cmake" "${CURRENT_PACKAGES_DIR}/debug/share/openMVG/cmake") + +vcpkg_cmake_config_fixup() -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/openMVG/image/image_test" - "${CURRENT_PACKAGES_DIR}/include/openMVG/exif/image_data" - "${CURRENT_PACKAGES_DIR}/include/openMVG_dependencies/nonFree/sift/vl") +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/include/openMVG_dependencies/cereal" + "${CURRENT_PACKAGES_DIR}/include/openMVG_dependencies/glfw" + "${CURRENT_PACKAGES_DIR}/include/openMVG_dependencies/osi_clp" + "${CURRENT_PACKAGES_DIR}/include/openMVG/image/image_test" + "${CURRENT_PACKAGES_DIR}/include/openMVG/exif/image_data" + "${CURRENT_PACKAGES_DIR}/include/openMVG_dependencies/nonFree/sift/vl") if(OpenMVG_BUILD_SHARED) if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") diff --git a/ports/openmvg/vcpkg.json b/ports/openmvg/vcpkg.json index 704d0537bb1f31..ce69a4cd4be53b 100644 --- a/ports/openmvg/vcpkg.json +++ b/ports/openmvg/vcpkg.json @@ -1,7 +1,6 @@ { "name": "openmvg", - "version": "2.0", - "port-version": 12, + "version": "2.1", "description": "open Multiple View Geometry library. Basis for 3D computer vision and Structure from Motion.", "license": "MPL-2.0-no-copyleft-exception", "supports": "(x86 | x64 | arm64) & !xbox", From 4dd9d754264156a65840f9f785bd20172c9fa6d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 4 Dec 2024 11:56:02 +0100 Subject: [PATCH 16/67] d --- versions/baseline.json | 4 ++-- versions/o-/openmvg.json | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/versions/baseline.json b/versions/baseline.json index 56c02c9550a6a7..10dd282ed97132 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6729,8 +6729,8 @@ "port-version": 1 }, "openmvg": { - "baseline": "2.0", - "port-version": 12 + "baseline": "2.1", + "port-version": 0 }, "openmvs": { "baseline": "2.1.0", diff --git a/versions/o-/openmvg.json b/versions/o-/openmvg.json index 2442a1cbcec263..ddccd5bb2db53b 100644 --- a/versions/o-/openmvg.json +++ b/versions/o-/openmvg.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "f9f794c1093c1b49f5cbd1e5a2d77c216cc94f52", + "version": "2.1", + "port-version": 0 + }, { "git-tree": "4d295167110da197b9fa74056de4c0863d1953c9", "version": "2.0", From 0256b963c802d39db4d5e005573b8708fb4b3087 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 4 Dec 2024 14:39:13 +0100 Subject: [PATCH 17/67] openturns --- ports/openturns/fix-dep.patch | 7 +++---- ports/openturns/link-gmp.patch | 10 ++++----- ports/openturns/portfile.cmake | 6 ++---- ports/openturns/reorder-mpc.patch | 34 ------------------------------- ports/openturns/vcpkg.json | 3 +-- 5 files changed, 11 insertions(+), 49 deletions(-) delete mode 100644 ports/openturns/reorder-mpc.patch diff --git a/ports/openturns/fix-dep.patch b/ports/openturns/fix-dep.patch index 125d3e127ced5f..0e0b6750662aea 100644 --- a/ports/openturns/fix-dep.patch +++ b/ports/openturns/fix-dep.patch @@ -1,9 +1,9 @@ diff --git a/lib/OpenTURNSConfig.cmake.in b/lib/OpenTURNSConfig.cmake.in -index 1247591893..c12e423892 100644 +index 74f17eafd..f57607b68 100644 --- a/lib/OpenTURNSConfig.cmake.in +++ b/lib/OpenTURNSConfig.cmake.in -@@ -74,6 +74,17 @@ if ("1" STREQUAL "@HMAT_FOUND@") - find_package (HMAT REQUIRED NO_MODULE PATHS ${HMAT_DIR} NO_DEFAULT_PATH) +@@ -107,6 +107,17 @@ if (NOT @BUILD_SHARED_LIBS@) + endif () endif () +include(CMakeFindDependencyMacro) @@ -20,4 +20,3 @@ index 1247591893..c12e423892 100644 # Our library dependencies (contains definitions for IMPORTED targets) include("${CMAKE_CURRENT_LIST_DIR}/OpenTURNS-Targets.cmake") - diff --git a/ports/openturns/link-gmp.patch b/ports/openturns/link-gmp.patch index c8a6954f13efd2..6ac1ce2cb83587 100644 --- a/ports/openturns/link-gmp.patch +++ b/ports/openturns/link-gmp.patch @@ -1,15 +1,15 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index e13414978..77ecf3e9e 100644 +index 81f0f30d1..6146ab517 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -303,6 +303,10 @@ if (USE_BOOST) - list (APPEND OPENTURNS_PRIVATE_LIBRARIES ${MPC_LIBRARIES}) +@@ -290,6 +290,10 @@ if (USE_BOOST) + list (APPEND OPENTURNS_ENABLED_FEATURES "mpc") endif () endif () + if((USE_MPC OR USE_MPFR) AND NOT BUILD_SHARED_LIBS) + find_library(GMP_LIBRARY NAMES gmp) + list (APPEND OPENTURNS_PRIVATE_LIBRARIES ${GMP_LIBRARY}) + endif() - list (APPEND OPENTURNS_PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS}) + list (APPEND OPENTURNS_PRIVATE_LIBRARIES Boost::boost) + list (APPEND OPENTURNS_ENABLED_FEATURES "boost") endif () - endif () diff --git a/ports/openturns/portfile.cmake b/ports/openturns/portfile.cmake index 9f87094cfb7c0f..04b717940b6257 100644 --- a/ports/openturns/portfile.cmake +++ b/ports/openturns/portfile.cmake @@ -1,12 +1,11 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO openturns/openturns - REF ad8482ece23d98802edc6258683e8353f9ff8b08 - SHA512 b0bc88bcf54945b5e786b480e640ee182926c75f1d871f70690d9609c98745b1907b3d9184c07586591fa45238c837da5a893a00d9c576a9e10232bcc9adc593 + REF b62fb487266949ffdad036712cec604cf70d6e34 + SHA512 de14a872bb2c3cd871d7f98e6a0d62f9f3c23386200f0c63d11fec0877d69639e45f004f3f18217bad68fc52d02d285ac3f5d70dcc89a8c23edaea9fe365b527 HEAD_REF master PATCHES link-gmp.patch - reorder-mpc.patch fix-dep.patch ) @@ -32,7 +31,6 @@ vcpkg_cmake_configure( -DCMAKE_REQUIRE_FIND_PACKAGE_FLEX:BOOL=ON -DCMAKE_REQUIRE_FIND_PACKAGE_TBB:BOOL=ON -DCMAKE_REQUIRE_FIND_PACKAGE_muParser:BOOL=ON - -DCMAKE_DISABLE_FIND_PACKAGE_HMAT:BOOL=ON -DCMAKE_REQUIRE_FIND_PACKAGE_LibXml2:BOOL=ON -DCMAKE_REQUIRE_FIND_PACKAGE_HDF5:BOOL=ON -DCMAKE_REQUIRE_FIND_PACKAGE_MPFR:BOOL=ON diff --git a/ports/openturns/reorder-mpc.patch b/ports/openturns/reorder-mpc.patch deleted file mode 100644 index 1d1d4672ed4cbc..00000000000000 --- a/ports/openturns/reorder-mpc.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 77ecf3e9e..b78ebcbec 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -287,14 +287,6 @@ if (USE_BOOST) - set (Boost_VERSION "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") - endif () - set (OPENTURNS_HAVE_BOOST TRUE) -- if (USE_MPFR) -- find_package (MPFR) -- if (MPFR_FOUND) -- set (OPENTURNS_HAVE_MPFR TRUE) -- list (APPEND OPENTURNS_PRIVATE_INCLUDE_DIRS ${MPFR_INCLUDE_DIRS}) -- list (APPEND OPENTURNS_PRIVATE_LIBRARIES ${MPFR_LIBRARIES}) -- endif () -- endif () - if (USE_MPC AND NOT Boost_VERSION VERSION_LESS 1.68) - find_package (MPC) - if (MPC_FOUND) -@@ -303,6 +295,14 @@ if (USE_BOOST) - list (APPEND OPENTURNS_PRIVATE_LIBRARIES ${MPC_LIBRARIES}) - endif () - endif () -+ if (USE_MPFR) -+ find_package (MPFR) -+ if (MPFR_FOUND) -+ set (OPENTURNS_HAVE_MPFR TRUE) -+ list (APPEND OPENTURNS_PRIVATE_INCLUDE_DIRS ${MPFR_INCLUDE_DIRS}) -+ list (APPEND OPENTURNS_PRIVATE_LIBRARIES ${MPFR_LIBRARIES}) -+ endif () -+ endif () - if((USE_MPC OR USE_MPFR) AND NOT BUILD_SHARED_LIBS) - find_library(GMP_LIBRARY NAMES gmp) - list (APPEND OPENTURNS_PRIVATE_LIBRARIES ${GMP_LIBRARY}) diff --git a/ports/openturns/vcpkg.json b/ports/openturns/vcpkg.json index 73c5de2ebf08d9..d16600fead727a 100644 --- a/ports/openturns/vcpkg.json +++ b/ports/openturns/vcpkg.json @@ -1,7 +1,6 @@ { "name": "openturns", - "version": "1.20", - "port-version": 2, + "version": "1.24", "description": "OpenTURNS is a scientific C++ and Python library featuring an internal data model and algorithms dedicated to the treatment of uncertainties.", "homepage": "http://www.openturns.org", "license": null, From 823ed58fec16fed764d0a89830139a9e984ab8ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 4 Dec 2024 14:39:36 +0100 Subject: [PATCH 18/67] d --- versions/baseline.json | 4 ++-- versions/o-/openturns.json | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/versions/baseline.json b/versions/baseline.json index 9d21c2bb77f356..466ade04bbf646 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6769,8 +6769,8 @@ "port-version": 4 }, "openturns": { - "baseline": "1.20", - "port-version": 2 + "baseline": "1.24", + "port-version": 0 }, "openvdb": { "baseline": "12.0.0", diff --git a/versions/o-/openturns.json b/versions/o-/openturns.json index 8c67d882eec864..a253da302646bf 100644 --- a/versions/o-/openturns.json +++ b/versions/o-/openturns.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "bbd39ea2bff391ea82272e7da62c0b82e407c83f", + "version": "1.24", + "port-version": 0 + }, { "git-tree": "55e0a233063acabd3fe365687fda3f99d6e79f4c", "version": "1.20", From 41dc98877e41e0c739e32cb5443e3508522f8af1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 4 Dec 2024 14:41:44 +0100 Subject: [PATCH 19/67] d --- ports/colmap/0001_cmakelists_fixes.patch | 94 ------------------------ 1 file changed, 94 deletions(-) delete mode 100644 ports/colmap/0001_cmakelists_fixes.patch diff --git a/ports/colmap/0001_cmakelists_fixes.patch b/ports/colmap/0001_cmakelists_fixes.patch deleted file mode 100644 index de2d4c1652a306..00000000000000 --- a/ports/colmap/0001_cmakelists_fixes.patch +++ /dev/null @@ -1,94 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8e49c19e..28059c7d 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -292,20 +292,20 @@ if (SUITESPARSE) - # built with SuiteSparse support. - - # Check for SuiteSparse and dependencies. -- find_package(SuiteSparse 4.5.6 COMPONENTS CHOLMOD SPQR -+ find_package(SuiteSparse 4.5.6 CONFIG COMPONENTS CHOLMOD SPQR - OPTIONAL_COMPONENTS Partition) - if (SuiteSparse_FOUND) -- set(SuiteSparse_DEPENDENCY "find_dependency(SuiteSparse ${SuiteSparse_VERSION})") -+ set(SuiteSparse_DEPENDENCY "find_dependency(SuiteSparse ${SuiteSparse_VERSION} CONFIG)") - # By default, if all of SuiteSparse's dependencies are found, Ceres is - # built with SuiteSparse support. - message("-- Found SuiteSparse ${SuiteSparse_VERSION}, " - "building with SuiteSparse.") - -- if (SuiteSparse_NO_CMAKE OR NOT SuiteSparse_DIR) -+ if (SuiteSparse_NO_CMAKE OR NOT SuiteSparse_DIR) - install(FILES ${Ceres_SOURCE_DIR}/cmake/FindSuiteSparse.cmake - ${Ceres_SOURCE_DIR}/cmake/FindMETIS.cmake - DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) -- endif (SuiteSparse_NO_CMAKE OR NOT SuiteSparse_DIR) -+ endif (0) - else (SuiteSparse_FOUND) - # Disable use of SuiteSparse if it cannot be found and continue. - message("-- Did not find all SuiteSparse dependencies, disabling " -@@ -395,9 +395,10 @@ endif() - # GFlags. - if (GFLAGS) - # Don't search with REQUIRED as we can continue without gflags. -- find_package(gflags 2.2.0) -+ find_package(gflags CONFIG REQUIRED) - if (gflags_FOUND) -- if (TARGET gflags) -+ if (TARGET gflags::gflags) -+ add_library(gflags ALIAS gflags::gflags) - message("-- Found Google Flags (gflags) version ${gflags_VERSION}: ${gflags_DIR}") - else() - message("-- Detected version of gflags: ${gflags_VERSION} does not define " -@@ -430,28 +431,7 @@ if (MINIGLOG) - mark_as_advanced(FORCE GLOG_INCLUDE_DIR - GLOG_LIBRARY) - else (MINIGLOG) -- unset(MINIGLOG_MAX_LOG_LEVEL CACHE) -- # Don't search with REQUIRED so that configuration continues if not found and -- # we can output an error messages explaining MINIGLOG option. -- find_package(Glog) -- if (NOT GLOG_FOUND) -- message(FATAL_ERROR "Can't find Google Log (glog). Please set either: " -- "glog_DIR (newer CMake built versions of glog) or GLOG_INCLUDE_DIR & " -- "GLOG_LIBRARY or enable MINIGLOG option to use minimal glog " -- "implementation.") -- endif(NOT GLOG_FOUND) -- # By default, assume gflags was found, updating the message if it was not. -- set(GLOG_GFLAGS_DEPENDENCY_MESSAGE -- " Assuming glog was built with gflags support as gflags was found. " -- "This will make gflags a public dependency of Ceres.") -- if (NOT gflags_FOUND) -- set(GLOG_GFLAGS_DEPENDENCY_MESSAGE -- " Assuming glog was NOT built with gflags support as gflags was " -- "not found. If glog was built with gflags, please set the " -- "gflags search locations such that it can be found by Ceres. " -- "Otherwise, Ceres may fail to link due to missing gflags symbols.") -- endif(NOT gflags_FOUND) -- message("-- Found Google Log (glog)." ${GLOG_GFLAGS_DEPENDENCY_MESSAGE}) -+ find_package(Glog REQUIRED) - endif (MINIGLOG) - - if (NOT SCHUR_SPECIALIZATIONS) -@@ -466,7 +446,7 @@ endif (NOT CUSTOM_BLAS) - - if (BUILD_BENCHMARKS) - # Version 1.3 was first to provide import targets -- find_package(benchmark 1.3 QUIET) -+ find_package(benchmark CONFIG REQUIRED) - if (benchmark_FOUND) - message("-- Found Google benchmark library. Building Ceres benchmarks.") - else() -@@ -722,12 +702,6 @@ install(FILES "${Ceres_BINARY_DIR}/CeresConfig-install.cmake" - DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) - install(FILES "${Ceres_BINARY_DIR}/CeresConfigVersion.cmake" - DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) --if (GLOG_FOUND AND NOT FOUND_INSTALLED_GLOG_CMAKE_CONFIGURATION) -- # Version of glog detected was not built with CMake, install our glog module -- # file to enable detection in CeresConfig. -- install(FILES "${Ceres_SOURCE_DIR}/cmake/FindGlog.cmake" -- DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) --endif() - - if (PROVIDE_UNINSTALL_TARGET) - # Create an uninstall target to remove all installed files. From 476dacfc34359da7b84a122b7548710e0fbf7c49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 4 Dec 2024 18:03:25 +0100 Subject: [PATCH 20/67] d --- ports/openmvg/build_fixes.patch | 70 ++++++-- ports/openmvg/cmakelists.patch | 299 -------------------------------- 2 files changed, 56 insertions(+), 313 deletions(-) delete mode 100644 ports/openmvg/cmakelists.patch diff --git a/ports/openmvg/build_fixes.patch b/ports/openmvg/build_fixes.patch index 6e66603efffc0d..ae06b0aa200a3a 100644 --- a/ports/openmvg/build_fixes.patch +++ b/ports/openmvg/build_fixes.patch @@ -1,5 +1,5 @@ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 6879c4c6..d00bce4f 100644 +index 6879c4c6..edf4e5b2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -24,6 +24,7 @@ endif() @@ -163,7 +163,7 @@ index 6879c4c6..d00bce4f 100644 # ============================================================================== # openMVG modules -@@ -447,14 +468,14 @@ add_subdirectory(testing) +@@ -447,9 +468,9 @@ add_subdirectory(testing) add_subdirectory(openMVG) # openMVG tutorial examples @@ -174,14 +174,7 @@ index 6879c4c6..d00bce4f 100644 +endif () # Complete software(s) build on openMVG libraries --if (OpenMVG_BUILD_SOFTWARES) -+if (0) - add_subdirectory(software) --endif (OpenMVG_BUILD_SOFTWARES) -+endif () - - # Included for research purpose only - add_subdirectory(nonFree) + if (OpenMVG_BUILD_SOFTWARES) @@ -464,7 +485,7 @@ add_subdirectory(nonFree) # -------------------------- # Sphinx detection @@ -283,11 +276,28 @@ index 8a69c234..1ed9a21f 100644 FIND_LIBRARY(OSICLP_LIBRARY NAMES OsiClp) # locate Clp libraries +diff --git a/src/cmakeFindModules/FindCoinUtils.cmake b/src/cmakeFindModules/FindCoinUtils.cmake +index 5b64ce14..595fb7dc 100644 +--- a/src/cmakeFindModules/FindCoinUtils.cmake ++++ b/src/cmakeFindModules/FindCoinUtils.cmake +@@ -57,6 +57,12 @@ IF(EXISTS "${COINUTILS_DIR}" AND NOT "${COINUTILS_DIR}" STREQUAL "") + SET(COINUTILS_LIBRARIES ${COINUTILS_LIBRARY}) + ENDIF() + ++ if(NOT WIN32) ++ find_package(PkgConfig) ++ pkg_check_modules(CoinUtils coinutils IMPORTED_TARGET) ++ list(APPEND COINUTILS_LIBRARIES PkgConfig::CoinUtils) ++ endif() ++ + MESSAGE(STATUS "CoinUtils ${COINUTILS_VERSION} found (include: ${COINUTILS_INCLUDE_DIRS})") + ELSE() + MESSAGE(STATUS "You are attempting to build without CoinUtils. " diff --git a/src/cmakeFindModules/OpenMVGConfig.cmake.in b/src/cmakeFindModules/OpenMVGConfig.cmake.in -index 5a788b56..02431ce2 100644 +index 5a788b56..ba3b4b3c 100644 --- a/src/cmakeFindModules/OpenMVGConfig.cmake.in +++ b/src/cmakeFindModules/OpenMVGConfig.cmake.in -@@ -51,6 +51,14 @@ set(OPENMVG_VERSION @OPENMVG_VERSION@) +@@ -51,6 +51,18 @@ set(OPENMVG_VERSION @OPENMVG_VERSION@) get_filename_component(CURRENT_CONFIG_INSTALL_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) @@ -298,11 +308,15 @@ index 5a788b56..02431ce2 100644 +find_dependency(cereal) +find_dependency(Ceres) +find_dependency(vlfeat) ++if(NOT WIN32) ++ find_dependency(PkgConfig) ++ pkg_check_modules(CoinUtils coinutils IMPORTED_TARGET) ++endif() + # Record the state of the CMake module path when this script was # called so that we can ensure that we leave it in the same state on # exit as it was on entry, but modify it locally. -@@ -61,7 +69,7 @@ set(CMAKE_MODULE_PATH ${CURRENT_CONFIG_INSTALL_DIR}) +@@ -61,7 +73,7 @@ set(CMAKE_MODULE_PATH ${CURRENT_CONFIG_INSTALL_DIR}) # Build the absolute root install directory as a relative path get_filename_component(CURRENT_ROOT_INSTALL_DIR @@ -311,8 +325,23 @@ index 5a788b56..02431ce2 100644 if (NOT EXISTS ${CURRENT_ROOT_INSTALL_DIR}) OPENMVG_REPORT_NOT_FOUND( "OpenMVG install root: ${CURRENT_ROOT_INSTALL_DIR}, " +diff --git a/src/openMVG/linearProgramming/CMakeLists.txt b/src/openMVG/linearProgramming/CMakeLists.txt +index 4532161d..e3ddedc6 100644 +--- a/src/openMVG/linearProgramming/CMakeLists.txt ++++ b/src/openMVG/linearProgramming/CMakeLists.txt +@@ -16,8 +16,8 @@ target_link_libraries(openMVG_linearProgramming + openMVG_numeric + PRIVATE + ${CLP_LIBRARIES} # clp + solver wrapper +- ${COINUTILS_LIBRARY} # container tools +- ${OSI_LIBRARY} # generic LP ++ ${COINUTILS_LIBRARIES} # container tools ++ ${OSI_LIBRARIES} # generic LP + ) + + target_include_directories(openMVG_linearProgramming diff --git a/src/openMVG/matching/CMakeLists.txt b/src/openMVG/matching/CMakeLists.txt -index b92a49b7..60394c12 100644 +index b92a49b7..6fa26493 100644 --- a/src/openMVG/matching/CMakeLists.txt +++ b/src/openMVG/matching/CMakeLists.txt @@ -16,6 +16,7 @@ list(REMOVE_ITEM matching_files_cpp ${REMOVEFILESUNITTEST}) @@ -323,6 +352,19 @@ index b92a49b7..60394c12 100644 set_source_files_properties(${matching_files_cpp} PROPERTIES LANGUAGE CXX) add_library(openMVG_matching +@@ -37,10 +38,10 @@ target_link_libraries(openMVG_matching + Threads::Threads + ${cereal_TARGET} + ) +-if (NOT DEFINED OpenMVG_USE_INTERNAL_FLANN) ++if (NOT OpenMVG_USE_INTERNAL_FLANN) + target_link_libraries(openMVG_matching + PUBLIC +- ${FLANN_LIBRARIES} ++ $,flann::flann_s,flann::flann> + ) + endif() + set_target_properties(openMVG_matching PROPERTIES SOVERSION ${OPENMVG_VERSION_MAJOR} VERSION "${OPENMVG_VERSION_MAJOR}.${OPENMVG_VERSION_MINOR}") diff --git a/src/third_party/CMakeLists.txt b/src/third_party/CMakeLists.txt index 1e025dc6..4a06dfcc 100644 --- a/src/third_party/CMakeLists.txt diff --git a/ports/openmvg/cmakelists.patch b/ports/openmvg/cmakelists.patch deleted file mode 100644 index 728d30e9d94fcb..00000000000000 --- a/ports/openmvg/cmakelists.patch +++ /dev/null @@ -1,299 +0,0 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 6879c4c6..fed74a70 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -24,6 +24,7 @@ endif() - - set(CMAKE_FIND_FRAMEWORK LAST) - -+if(0) - # ============================================================================== - # OpenMVG build options - # ============================================================================== -@@ -59,6 +60,7 @@ option(OpenMVG_USE_OCVSIFT "Add or not OpenCV SIFT in available features" OFF) - # Enable this to be able to use LiGT in main_SfM. - # ============================================================================== - option(OpenMVG_USE_LIGT "Add or not LiGT in available" ON) -+endif() - - # ============================================================================== - # OpenMVG version -@@ -104,6 +106,7 @@ else (OpenMVG_BUILD_SHARED) - set(BUILD_SHARED_LIBS OFF) - endif() - -+if(0) - # ============================================================================== - # Check that submodule have been initialized and updated - # ============================================================================== -@@ -112,6 +115,7 @@ if (NOT EXISTS ${PROJECT_SOURCE_DIR}/dependencies/cereal/include) - "\n submodule(s) are missing, please update your repository:\n" - " > git submodule update -i\n") - endif() -+endif() - - # ============================================================================== - # Additional cmake find modules -@@ -191,9 +195,10 @@ endif() - # ============================================================================== - # IMAGE IO detection - # ============================================================================== --find_package(JPEG QUIET) --find_package(PNG QUIET) --find_package(TIFF QUIET) -+find_package(JPEG REQUIRED) -+find_package(PNG REQUIRED) -+find_package(TIFF REQUIRED) -+find_package(vlfeat REQUIRED) - - # Folders - set_property(GLOBAL PROPERTY USE_FOLDERS ON) -@@ -257,6 +262,7 @@ ENDMACRO(UNIT_TEST) - # - internal if cereal not found - # - as of cereal:1.3.1 target requires component - # ============================================================================== -+if(0) - find_package(cereal QUIET CONFIG) - if (NOT cereal_FOUND) - add_library(cereal INTERFACE) -@@ -273,6 +279,10 @@ if (TARGET cereal::cereal) - else() - set(cereal_TARGET "cereal") - endif() -+endif() -+ -+find_package(cereal REQUIRED CONFIG) -+get_target_property(CEREAL_INCLUDE_DIRS cereal::cereal INTERFACE_INCLUDE_DIRECTORIES) - - # ============================================================================== - # Eigen -@@ -281,6 +291,7 @@ endif() - # - external if EIGEN_INCLUDE_DIR_HINTS is defined - # - internal if Eigen not found - # ============================================================================== -+if(0) - find_package(Eigen3 QUIET) - if (NOT Eigen3_FOUND) - set(EIGEN_INCLUDE_DIR_HINTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/eigen) -@@ -289,7 +300,11 @@ if (NOT Eigen3_FOUND) - else() - set(EIGEN_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR}) - endif() -+endif() -+ - add_definitions(-DEIGEN_MPL2_ONLY) -+find_package(Eigen3 REQUIRED) -+set(EIGEN_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR}) - - # ============================================================================== - # Ceres -@@ -297,6 +312,7 @@ add_definitions(-DEIGEN_MPL2_ONLY) - # - external by default if CERES_DIR_HINTS or find_package found a valid Ceres - # - internal if ceres not found (ceres-solver+cxsparse+miniglog) - # ============================================================================== -+if(0) - find_package(Ceres QUIET HINTS ${CERES_DIR_HINTS}) - if (NOT Ceres_FOUND) - set(OpenMVG_USE_INTERNAL_CERES ON) -@@ -308,6 +324,9 @@ if (NOT Ceres_FOUND) - STRING(REGEX REPLACE "version ([0-9.]+).*" "\\1" CERES_VERSION ${CERES_CONFIG}) - set(CERES_LIBRARIES openMVG_ceres) - endif() -+endif() -+ -+find_package(Ceres REQUIRED) - - # ============================================================================== - # Flann -@@ -315,6 +334,7 @@ endif() - # - internal by default (flann), - # - external if FLANN_INCLUDE_DIR_HINTS and a valid Flann setup is found - # ============================================================================== -+if(0) - if (NOT DEFINED FLANN_INCLUDE_DIR_HINTS) - set(FLANN_INCLUDE_DIR_HINTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/flann/src/cpp) - set(OpenMVG_USE_INTERNAL_FLANN ON) -@@ -330,6 +350,9 @@ endif() - if (NOT FLANN_FOUND OR OpenMVG_USE_INTERNAL_FLANN) - set(FLANN_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/flann/src/cpp) - endif() -+endif() -+ -+find_package(flann REQUIRED) - - # ============================================================================== - # CoinUtils -@@ -398,6 +421,7 @@ endif() - # - internal by default (Lemon), - # - external if LEMON_INCLUDE_DIR_HINTS and a valid Lemon setup is found - # ============================================================================== -+if(0) - if (NOT DEFINED LEMON_INCLUDE_DIR_HINTS) - set(LEMON_INCLUDE_DIR_HINTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/lemon) - set(OpenMVG_USE_INTERNAL_LEMON ON) -@@ -408,13 +432,16 @@ if (NOT LEMON_FOUND OR OpenMVG_USE_INTERNAL_LEMON) - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/lemon - ${PROJECT_BINARY_DIR}/third_party/lemon) - endif() -+endif() -+ -+find_package(LEMON REQUIRED) - - # ============================================================================== - # OpenCV - # ============================================================================== - # - only external and enabled only if OpenMVG_USE_OPENCV is set to ON - # ============================================================================== --if (OpenMVG_USE_OPENCV) -+if (0) - find_package( OpenCV QUIET ) - if (NOT OpenCV_FOUND OR OpenCV_VERSION VERSION_LESS "3.0.0") - message(STATUS "OpenCV was not found (note that OpenCV version >= 3.0.0 is required). -> Disabling OpenCV support.") -@@ -429,7 +456,7 @@ endif() - # ============================================================================== - # - enabled only if OpenMVG_USE_LIGT is set to ON - # ============================================================================== --if (OpenMVG_USE_LIGT) -+if (0) - add_definitions(-DUSE_PATENTED_LIGT) - endif() - -@@ -438,7 +465,6 @@ endif() - # Third-party libraries: - # ============================================================================== - add_subdirectory(third_party) --add_subdirectory(testing) - - # ============================================================================== - # openMVG modules -@@ -447,12 +473,12 @@ add_subdirectory(testing) - add_subdirectory(openMVG) - - # openMVG tutorial examples --if (OpenMVG_BUILD_EXAMPLES) -+if (0) - add_subdirectory(openMVG_Samples) - endif (OpenMVG_BUILD_EXAMPLES) - - # Complete software(s) build on openMVG libraries --if (OpenMVG_BUILD_SOFTWARES) -+if (0) - add_subdirectory(software) - endif (OpenMVG_BUILD_SOFTWARES) - -@@ -464,7 +490,7 @@ add_subdirectory(nonFree) - # -------------------------- - # Sphinx detection - # ============================================================================== --if (OpenMVG_BUILD_DOC) -+if (0) - find_package(Sphinx) - if (EXISTS ${SPHINX_EXECUTABLE}) - set(SPHINX_HTML_DIR "${CMAKE_CURRENT_BINARY_DIR}/htmlDoc") -@@ -526,67 +552,67 @@ message("** Use LiGT for global translation estimation: " ${OpenMVG_USE_LIGT}) - - message("\n") - --if (DEFINED OpenMVG_USE_INTERNAL_CEREAL) -+if (OpenMVG_USE_INTERNAL_CEREAL) - message(STATUS "CEREAL: (internal)") - else() - message(STATUS "CEREAL: (external)") - endif() - --if (DEFINED OpenMVG_USE_INTERNAL_EIGEN) -+if (OpenMVG_USE_INTERNAL_EIGEN) - message(STATUS "EIGEN: " ${EIGEN_VERSION} " (internal)") - else() - message(STATUS "EIGEN: " ${EIGEN_VERSION} " (external)") - endif() - --if (DEFINED OpenMVG_USE_INTERNAL_CERES) -+if (OpenMVG_USE_INTERNAL_CERES) - message(STATUS "CERES: " ${CERES_VERSION} " (internal)") - else() - message(STATUS "CERES: " ${CERES_VERSION} " (external)") - endif() - --if (DEFINED OpenMVG_USE_INTERNAL_FLANN) -+if (OpenMVG_USE_INTERNAL_FLANN) - message(STATUS "FLANN: " ${FLANN_VERSION} " (internal)") - else() - message(STATUS "FLANN: " ${FLANN_VERSION} " (external)") - endif() - --if (DEFINED OpenMVG_USE_INTERNAL_TIFF) -+if (OpenMVG_USE_INTERNAL_TIFF) - message(STATUS "LIBTIFF: " ${TIFF_VERSION_STRING} " (internal)") - else() - message(STATUS "LIBTIFF: " ${TIFF_VERSION_STRING} " (external)") - endif() - --if (DEFINED OpenMVG_USE_INTERNAL_PNG) -+if (OpenMVG_USE_INTERNAL_PNG) - message(STATUS "LIBPNG: " ${PNG_VERSION_STRING} " (internal)") - else() - message(STATUS "LIBPNG: " ${PNG_VERSION_STRING} " (external)") - endif() - --if (DEFINED OpenMVG_USE_INTERNAL_JPEG) -+if (OpenMVG_USE_INTERNAL_JPEG) - message(STATUS "LIBJPEG (internal)") - else() - message(STATUS "LIBJPEG (external)") - endif() - --if (DEFINED OpenMVG_USE_INTERNAL_CLP) -+if (OpenMVG_USE_INTERNAL_CLP) - message(STATUS "CLP: " ${CLP_VERSION} " (internal)") - else() - message(STATUS "CLP: " ${CLP_VERSION} " (external)") - endif() - --if (DEFINED OpenMVG_USE_INTERNAL_COINUTILS) -+if (OpenMVG_USE_INTERNAL_COINUTILS) - message(STATUS "COINUTILS: " ${COINUTILS_VERSION} " (internal)") - else() - message(STATUS "COINUTILS: " ${COINUTILS_VERSION} " (external)") - endif() - --if (DEFINED OpenMVG_USE_INTERNAL_OSI) -+if (OpenMVG_USE_INTERNAL_OSI) - message(STATUS "OSI: " ${OSI_VERSION} " (internal)") - else() - message(STATUS "OSI: " ${OSI_VERSION} " (external)") - endif() - --if (DEFINED OpenMVG_USE_INTERNAL_LEMON) -+if (OpenMVG_USE_INTERNAL_LEMON) - message(STATUS "LEMON: " ${LEMON_VERSION} " (internal)") - else() - message(STATUS "LEMON: " ${LEMON_VERSION} " (external)") -diff --git a/src/cmakeFindModules/OpenMVGConfig.cmake.in b/src/cmakeFindModules/OpenMVGConfig.cmake.in -index 5a788b56..02431ce2 100644 ---- a/src/cmakeFindModules/OpenMVGConfig.cmake.in -+++ b/src/cmakeFindModules/OpenMVGConfig.cmake.in -@@ -51,6 +51,14 @@ set(OPENMVG_VERSION @OPENMVG_VERSION@) - get_filename_component(CURRENT_CONFIG_INSTALL_DIR - "${CMAKE_CURRENT_LIST_FILE}" PATH) - -+include(CMakeFindDependencyMacro) -+ -+find_dependency(flann) -+find_dependency(Threads) -+find_dependency(cereal) -+find_dependency(Ceres) -+find_dependency(vlfeat) -+ - # Record the state of the CMake module path when this script was - # called so that we can ensure that we leave it in the same state on - # exit as it was on entry, but modify it locally. -@@ -61,7 +69,7 @@ set(CMAKE_MODULE_PATH ${CURRENT_CONFIG_INSTALL_DIR}) - - # Build the absolute root install directory as a relative path - get_filename_component(CURRENT_ROOT_INSTALL_DIR -- ${CMAKE_MODULE_PATH}/../../../ ABSOLUTE) -+ ${CMAKE_MODULE_PATH}/../../ ABSOLUTE) - if (NOT EXISTS ${CURRENT_ROOT_INSTALL_DIR}) - OPENMVG_REPORT_NOT_FOUND( - "OpenMVG install root: ${CURRENT_ROOT_INSTALL_DIR}, " From e7a400753095a5d2b99a3f1e615713ccbf408907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 4 Dec 2024 18:03:54 +0100 Subject: [PATCH 21/67] d --- versions/o-/openmvg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/o-/openmvg.json b/versions/o-/openmvg.json index ddccd5bb2db53b..a3e53ecc76df9d 100644 --- a/versions/o-/openmvg.json +++ b/versions/o-/openmvg.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "f9f794c1093c1b49f5cbd1e5a2d77c216cc94f52", + "git-tree": "dc0ba1a2534852a26baf5359eed978854d7f5f48", "version": "2.1", "port-version": 0 }, From 343d558a9e04084e06fd98f6e7371cbe99e24cae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 4 Dec 2024 19:55:56 +0100 Subject: [PATCH 22/67] d --- ports/ceres/0001_cmakelists_fixes.patch | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/ports/ceres/0001_cmakelists_fixes.patch b/ports/ceres/0001_cmakelists_fixes.patch index e160b67cc501a1..4591bc511c20e4 100644 --- a/ports/ceres/0001_cmakelists_fixes.patch +++ b/ports/ceres/0001_cmakelists_fixes.patch @@ -1,17 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8e49c19e..c880e788 100644 +index 8e49c19e..330bb8cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -80,7 +80,7 @@ set(CMAKE_VISIBILITY_INLINES_HIDDEN ON) - # Make CMake aware of the cmake folder for local FindXXX scripts, - # append rather than set in case the user has passed their own - # additional paths via -D. --list(APPEND CMAKE_MODULE_PATH "${Ceres_SOURCE_DIR}/cmake") -+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") - include(AddCompileFlagsIfSupported) - include(CheckCXXCompilerFlag) - include(CheckLibraryExists) -@@ -292,20 +292,21 @@ if (SUITESPARSE) +@@ -292,27 +292,28 @@ if (SUITESPARSE) # built with SuiteSparse support. # Check for SuiteSparse and dependencies. @@ -32,6 +23,7 @@ index 8e49c19e..c880e788 100644 - ${Ceres_SOURCE_DIR}/cmake/FindMETIS.cmake - DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) - endif (SuiteSparse_NO_CMAKE OR NOT SuiteSparse_DIR) +- else (SuiteSparse_FOUND) + add_library(SuiteSparse::CONFIG ALIAS SuiteSparse::suitesparseconfig) + add_library(SuiteSparse::AMD ALIAS SuiteSparse::amd) + add_library(SuiteSparse::CAMD ALIAS SuiteSparse::camd) @@ -40,9 +32,17 @@ index 8e49c19e..c880e788 100644 + add_library(SuiteSparse::CHOLMOD ALIAS SuiteSparse::cholmod) + add_library(SuiteSparse::SPQR ALIAS SuiteSparse::spqr) + add_library(METIS::METIS ALIAS metis) - else (SuiteSparse_FOUND) ++ else (SUITESPARSE_FOUND) # Disable use of SuiteSparse if it cannot be found and continue. message("-- Did not find all SuiteSparse dependencies, disabling " + "SuiteSparse support.") + update_cache_variable(SUITESPARSE OFF) + list(APPEND CERES_COMPILE_OPTIONS CERES_NO_SUITESPARSE) +- endif (SuiteSparse_FOUND) ++ endif (SUITESPARSE_FOUND) + else (SUITESPARSE) + message("-- Building without SuiteSparse.") + list(APPEND CERES_COMPILE_OPTIONS CERES_NO_SUITESPARSE) @@ -395,9 +396,10 @@ endif() # GFlags. if (GFLAGS) From 87cc0e327799d996d1d1290570e2d81a316e4428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 4 Dec 2024 20:14:29 +0100 Subject: [PATCH 23/67] d --- .../0004_remove_broken_fake_ba_jac.patch | 67 +++++++++++++++++++ ports/ceres/portfile.cmake | 2 +- 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 ports/ceres/0004_remove_broken_fake_ba_jac.patch diff --git a/ports/ceres/0004_remove_broken_fake_ba_jac.patch b/ports/ceres/0004_remove_broken_fake_ba_jac.patch new file mode 100644 index 00000000000000..3862869d7aa004 --- /dev/null +++ b/ports/ceres/0004_remove_broken_fake_ba_jac.patch @@ -0,0 +1,67 @@ +diff --git a/internal/ceres/fake_bundle_adjustment_jacobian.cc b/internal/ceres/fake_bundle_adjustment_jacobian.cc +index efe4d8d7..22f34059 100644 +--- a/internal/ceres/fake_bundle_adjustment_jacobian.cc ++++ b/internal/ceres/fake_bundle_adjustment_jacobian.cc +@@ -96,25 +96,4 @@ std::unique_ptr CreateFakeBundleAdjustmentJacobian( + return jacobian; + } + +-std::pair< +- std::unique_ptr>, +- std::unique_ptr> +-CreateFakeBundleAdjustmentPartitionedJacobian(int num_cameras, +- int num_points, +- int camera_size, +- int landmark_size, +- double visibility, +- std::mt19937& rng) { +- using PartitionedView = +- PartitionedMatrixView<2, Eigen::Dynamic, Eigen::Dynamic>; +- auto block_sparse_matrix = CreateFakeBundleAdjustmentJacobian( +- num_cameras, num_points, camera_size, landmark_size, visibility, rng); +- LinearSolver::Options options; +- options.elimination_groups.push_back(num_points); +- auto partitioned_view = +- std::make_unique(options, *block_sparse_matrix); +- return std::make_pair(std::move(partitioned_view), +- std::move(block_sparse_matrix)); +-} +- + } // namespace ceres::internal +diff --git a/internal/ceres/fake_bundle_adjustment_jacobian.h b/internal/ceres/fake_bundle_adjustment_jacobian.h +index ced1b161..0448dbf3 100644 +--- a/internal/ceres/fake_bundle_adjustment_jacobian.h ++++ b/internal/ceres/fake_bundle_adjustment_jacobian.h +@@ -47,32 +47,6 @@ std::unique_ptr CreateFakeBundleAdjustmentJacobian( + double visibility, + std::mt19937& prng); + +-template +-std::pair>, +- std::unique_ptr> +-CreateFakeBundleAdjustmentPartitionedJacobian(int num_cameras, +- int num_points, +- double visibility, +- std::mt19937& rng) { +- using PartitionedView = PartitionedMatrixView<2, kEBlockSize, kFBlockSize>; +- auto block_sparse_matrix = CreateFakeBundleAdjustmentJacobian( +- num_cameras, num_points, kFBlockSize, kEBlockSize, visibility, rng); +- auto partitioned_view = +- std::make_unique(*block_sparse_matrix, num_points); +- return std::make_pair(std::move(partitioned_view), +- std::move(block_sparse_matrix)); +-} +- +-std::pair< +- std::unique_ptr>, +- std::unique_ptr> +-CreateFakeBundleAdjustmentPartitionedJacobian(int num_cameras, +- int num_points, +- int camera_size, +- int landmark_size, +- double visibility, +- std::mt19937& rng); +- + } // namespace ceres::internal + + #endif // CERES_INTERNAL_FAKE_BUNDLE_ADJUSTMENT_JACOBIAN diff --git a/ports/ceres/portfile.cmake b/ports/ceres/portfile.cmake index eab80218be6bfc..e39a58119ec0d5 100644 --- a/ports/ceres/portfile.cmake +++ b/ports/ceres/portfile.cmake @@ -16,6 +16,7 @@ vcpkg_from_github( 0001_cmakelists_fixes.patch 0002_use_glog_target.patch 0003_fix_exported_ceres_config.patch + 0004_remove_broken_fake_ba_jac.patch ) file(REMOVE "${SOURCE_PATH}/cmake/FindGflags.cmake") @@ -66,7 +67,6 @@ vcpkg_cmake_configure( -DUSE_CUDA=${USE_CUDA} -DPROVIDE_UNINSTALL_TARGET=OFF -DMSVC_USE_STATIC_CRT=${MSVC_USE_STATIC_CRT_VALUE} - -DLIB_SUFFIX=${LIB_SUFFIX} ) vcpkg_cmake_install() From 0d8fbbe42c707a67757b09a64fac349b7d2456ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 4 Dec 2024 20:14:57 +0100 Subject: [PATCH 24/67] d --- versions/c-/ceres.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/c-/ceres.json b/versions/c-/ceres.json index e3675f68d76dc5..4be5ae3c8bb657 100644 --- a/versions/c-/ceres.json +++ b/versions/c-/ceres.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "003c6572a4818b8234bfaf91ab0b39e19a91ad57", + "git-tree": "8fcad7138812e4f098e080f9714466318f80abdf", "version": "2.2.0", "port-version": 0 }, From 874459b776fbc25a60a8d229b6e4309a1aaa0b74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 4 Dec 2024 20:39:02 +0100 Subject: [PATCH 25/67] d --- ports/cartographer/fix-errors.patch | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/ports/cartographer/fix-errors.patch b/ports/cartographer/fix-errors.patch index bf71646b91492b..25e8b6075aaf8e 100644 --- a/ports/cartographer/fix-errors.patch +++ b/ports/cartographer/fix-errors.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index ef2fcb3..fdbe96e 100644 +index ef2fcb3..eff0c68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ cmake_minimum_required(VERSION 3.2) @@ -11,7 +11,7 @@ index ef2fcb3..fdbe96e 100644 set(CARTOGRAPHER_MINOR_VERSION 0) set(CARTOGRAPHER_PATCH_VERSION 0) set(CARTOGRAPHER_VERSION ${CARTOGRAPHER_MAJOR_VERSION}.${CARTOGRAPHER_MINOR_VERSION}.${CARTOGRAPHER_PATCH_VERSION}) -@@ -26,8 +26,6 @@ set(CARTOGRAPHER_HAS_GRPC ${BUILD_GRPC}) +@@ -26,26 +26,19 @@ set(CARTOGRAPHER_HAS_GRPC ${BUILD_GRPC}) option(BUILD_PROMETHEUS "build Prometheus monitoring support" false) include("${PROJECT_SOURCE_DIR}/cmake/functions.cmake") @@ -20,7 +20,10 @@ index ef2fcb3..fdbe96e 100644 find_package(absl REQUIRED) set(BOOST_COMPONENTS iostreams) -@@ -38,14 +36,10 @@ endif() + if(WIN32) +- list(APPEND BOOST_COMPONENTS zlib) + set(Boost_USE_STATIC_LIBS FALSE) + endif() find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS}) find_package(Ceres REQUIRED COMPONENTS SuiteSparse) find_package(Eigen3 REQUIRED) @@ -39,7 +42,7 @@ index ef2fcb3..fdbe96e 100644 if (${BUILD_GRPC}) find_package(async_grpc REQUIRED) -@@ -55,18 +49,7 @@ if(${BUILD_PROMETHEUS}) +@@ -55,18 +48,7 @@ if(${BUILD_PROMETHEUS}) find_package( ZLIB REQUIRED ) endif() @@ -59,7 +62,7 @@ index ef2fcb3..fdbe96e 100644 # Install catkin package.xml install(FILES package.xml DESTINATION share/cartographer) -@@ -190,26 +173,6 @@ configure_file( +@@ -190,26 +172,6 @@ configure_file( ${PROJECT_SOURCE_DIR}/cartographer/common/config.h.cmake ${PROJECT_BINARY_DIR}/cartographer/common/config.h) @@ -86,7 +89,7 @@ index ef2fcb3..fdbe96e 100644 if(${BUILD_GRPC}) google_binary(cartographer_grpc_server SRCS -@@ -247,8 +210,6 @@ else() +@@ -247,8 +209,6 @@ else() set(GLOG_LIBRARY glog) endif() @@ -95,7 +98,7 @@ index ef2fcb3..fdbe96e 100644 if(WIN32) # Needed to fix conflict with MSVC's error macro. target_compile_definitions(${PROJECT_NAME} PUBLIC -DGLOG_NO_ABBREVIATED_SEVERITIES) -@@ -258,17 +219,11 @@ if(MSVC) +@@ -258,17 +218,11 @@ if(MSVC) target_compile_definitions(${PROJECT_NAME} PUBLIC -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_USE_MATH_DEFINES) endif() @@ -114,7 +117,7 @@ index ef2fcb3..fdbe96e 100644 absl::algorithm absl::base absl::debugging -@@ -300,6 +255,7 @@ set(TARGET_COMPILE_FLAGS "${TARGET_COMPILE_FLAGS} ${GOOG_CXX_FLAGS}") +@@ -300,6 +254,7 @@ set(TARGET_COMPILE_FLAGS "${TARGET_COMPILE_FLAGS} ${GOOG_CXX_FLAGS}") set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS ${TARGET_COMPILE_FLAGS}) @@ -122,7 +125,7 @@ index ef2fcb3..fdbe96e 100644 set(TEST_LIB cartographer_test_library ) -@@ -333,6 +289,7 @@ foreach(ABS_FIL ${ALL_TESTS}) +@@ -333,6 +288,7 @@ foreach(ABS_FIL ${ALL_TESTS}) endif() target_link_libraries("${TEST_TARGET_NAME}" PUBLIC ${TEST_LIB}) endforeach() @@ -130,7 +133,7 @@ index ef2fcb3..fdbe96e 100644 # Add the binary directory first, so that port.h is included after it has # been generated. -@@ -368,7 +325,7 @@ foreach(HDR ${INSTALL_GENERATED_HDRS}) +@@ -368,7 +324,7 @@ foreach(HDR ${INSTALL_GENERATED_HDRS}) ) endforeach() @@ -139,7 +142,7 @@ index ef2fcb3..fdbe96e 100644 include(CMakePackageConfigHelpers) configure_package_config_file( cartographer-config.cmake.in -@@ -379,7 +336,7 @@ configure_package_config_file( +@@ -379,7 +335,7 @@ configure_package_config_file( install( EXPORT CartographerExport From 3e90198e7e4ab3cf1a382704293c96bc54f67200 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 4 Dec 2024 20:39:17 +0100 Subject: [PATCH 26/67] d --- versions/c-/cartographer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/c-/cartographer.json b/versions/c-/cartographer.json index a3c0d995c5cfd7..8ca628245daf34 100644 --- a/versions/c-/cartographer.json +++ b/versions/c-/cartographer.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "0eff15df99dc1514a143bc0eb6e7a10752c47679", + "git-tree": "54b308ddceadae0c4f0be267b086f846144e7d49", "version": "2.0.0", "port-version": 0 }, From 61edee397f2052f5b2e3497e0221d964a43a49fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 4 Dec 2024 20:43:14 +0100 Subject: [PATCH 27/67] d --- ports/openturns/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/openturns/portfile.cmake b/ports/openturns/portfile.cmake index 04b717940b6257..8bfe363281329d 100644 --- a/ports/openturns/portfile.cmake +++ b/ports/openturns/portfile.cmake @@ -47,8 +47,8 @@ vcpkg_cmake_configure( vcpkg_cmake_install() vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/${PORT}") -vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/OpenTURNSConfig.cmake" "/lib/cmake/" "/share/") -vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/OpenTURNSConfig.cmake" "/lib" "$<$:/debug>/lib") +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/OpenTURNSConfig.cmake" "/lib/cmake/" "/share/" IGNORE_UNCHANGED) +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/OpenTURNSConfig.cmake" "/lib" "$<$:/debug>/lib" IGNORE_UNCHANGED) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/openturns/OTdebug.h" "#ifndef OT_STATIC" "#if 0") From 3a01806600f26029de6f7df84aa16474f70e9fe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 4 Dec 2024 20:43:21 +0100 Subject: [PATCH 28/67] d --- versions/o-/openturns.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/o-/openturns.json b/versions/o-/openturns.json index a253da302646bf..0a974e9e994704 100644 --- a/versions/o-/openturns.json +++ b/versions/o-/openturns.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "bbd39ea2bff391ea82272e7da62c0b82e407c83f", + "git-tree": "1417982484eec4ba34a4fc7466b481624738c816", "version": "1.24", "port-version": 0 }, From a1b6112dd1ee2cb5efb6bd0a09922049e957a377 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 4 Dec 2024 20:47:30 +0100 Subject: [PATCH 29/67] d --- ports/openturns/portfile.cmake | 1 + ports/openturns/vcpkg.json | 1 + 2 files changed, 2 insertions(+) diff --git a/ports/openturns/portfile.cmake b/ports/openturns/portfile.cmake index 8bfe363281329d..3a319eecef7fde 100644 --- a/ports/openturns/portfile.cmake +++ b/ports/openturns/portfile.cmake @@ -24,6 +24,7 @@ vcpkg_cmake_configure( -DUSE_BOOST:BOOL=ON # Required to make the distributions cross platform -DUSE_DOXYGEN:BOOL=OFF -DUSE_OPENMP:BOOL=OFF + -DUSE_CUBA:BOOL=OFF -DCMAKE_REQUIRE_FIND_PACKAGE_Spectra:BOOL=ON -DCMAKE_REQUIRE_FIND_PACKAGE_Eigen3:BOOL=ON -DCMAKE_DISABLE_FIND_PACKAGE_primesieve:BOOL=ON diff --git a/ports/openturns/vcpkg.json b/ports/openturns/vcpkg.json index d16600fead727a..3bc3f98c892d7b 100644 --- a/ports/openturns/vcpkg.json +++ b/ports/openturns/vcpkg.json @@ -24,6 +24,7 @@ "mpc", "mpfr", "muparser", + "nanoflann", "nlopt", "pagmo2", "pthread", From 7663800bac7f9e1057008b136b6836aaaf091f8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 4 Dec 2024 20:47:38 +0100 Subject: [PATCH 30/67] d --- versions/o-/openturns.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/o-/openturns.json b/versions/o-/openturns.json index 0a974e9e994704..e3ba0991fde5d2 100644 --- a/versions/o-/openturns.json +++ b/versions/o-/openturns.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "1417982484eec4ba34a4fc7466b481624738c816", + "git-tree": "98d7dd2aca85b113a50f9240fac56b158052f855", "version": "1.24", "port-version": 0 }, From 7a949a7057dfddfbab4bb16733d0c5c065827bf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 4 Dec 2024 21:04:05 +0100 Subject: [PATCH 31/67] d --- ports/openturns/fix-dep.patch | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ports/openturns/fix-dep.patch b/ports/openturns/fix-dep.patch index 0e0b6750662aea..633987d3839190 100644 --- a/ports/openturns/fix-dep.patch +++ b/ports/openturns/fix-dep.patch @@ -1,8 +1,8 @@ diff --git a/lib/OpenTURNSConfig.cmake.in b/lib/OpenTURNSConfig.cmake.in -index 74f17eafd..f57607b68 100644 +index 74f17eafd..e08d121dc 100644 --- a/lib/OpenTURNSConfig.cmake.in +++ b/lib/OpenTURNSConfig.cmake.in -@@ -107,6 +107,17 @@ if (NOT @BUILD_SHARED_LIBS@) +@@ -107,6 +107,18 @@ if (NOT @BUILD_SHARED_LIBS@) endif () endif () @@ -16,6 +16,7 @@ index 74f17eafd..f57607b68 100644 +find_dependency(Ceres CONFIG) +find_dependency(Pagmo CONFIG) +find_dependency(CMinpack CONFIG) ++find_dependency(nanoflann CONFIG) + # Our library dependencies (contains definitions for IMPORTED targets) include("${CMAKE_CURRENT_LIST_DIR}/OpenTURNS-Targets.cmake") From b3f4dcd9426611045f3025520f743828778d9158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 4 Dec 2024 21:04:17 +0100 Subject: [PATCH 32/67] d --- versions/o-/openturns.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/o-/openturns.json b/versions/o-/openturns.json index e3ba0991fde5d2..07972c05a7d9a9 100644 --- a/versions/o-/openturns.json +++ b/versions/o-/openturns.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "98d7dd2aca85b113a50f9240fac56b158052f855", + "git-tree": "4fdf6074aaa4dba7ec495d10befc3fe4cc0c0407", "version": "1.24", "port-version": 0 }, From 5d3f0c96d0791694d666b800f4d902248a344928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 4 Dec 2024 21:17:19 +0100 Subject: [PATCH 33/67] d --- ports/openturns/vcpkg.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/openturns/vcpkg.json b/ports/openturns/vcpkg.json index 3bc3f98c892d7b..f8414d735c03ad 100644 --- a/ports/openturns/vcpkg.json +++ b/ports/openturns/vcpkg.json @@ -6,6 +6,8 @@ "license": null, "dependencies": [ "blas", + "boost-geometry", + "boost-math", "boost-multiprecision", "boost-random", "ceres", From da61845a32be0eb88bd3d7e660357b88692b4ad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 4 Dec 2024 21:17:26 +0100 Subject: [PATCH 34/67] d --- versions/o-/openturns.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/o-/openturns.json b/versions/o-/openturns.json index 07972c05a7d9a9..59ea9c828e9e97 100644 --- a/versions/o-/openturns.json +++ b/versions/o-/openturns.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "4fdf6074aaa4dba7ec495d10befc3fe4cc0c0407", + "git-tree": "f1aa9f9bb6f1819f37fbd39a33d751589077b790", "version": "1.24", "port-version": 0 }, From 7066000550dbe4dbd204d97e3930727ccc5b50cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 4 Dec 2024 22:02:15 +0100 Subject: [PATCH 35/67] d --- ports/openturns/link-gmp.patch | 35 ++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/ports/openturns/link-gmp.patch b/ports/openturns/link-gmp.patch index 6ac1ce2cb83587..20d75f9ac963fa 100644 --- a/ports/openturns/link-gmp.patch +++ b/ports/openturns/link-gmp.patch @@ -1,15 +1,42 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 81f0f30d1..6146ab517 100644 +index 81f0f30d1..c846b403a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -290,6 +290,10 @@ if (USE_BOOST) +@@ -272,15 +272,6 @@ if (USE_BOOST) + set (Boost_VERSION "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") + endif () + set (OPENTURNS_HAVE_BOOST TRUE) +- if (USE_MPFR) +- find_package (MPFR) +- if (MPFR_FOUND) +- set (OPENTURNS_HAVE_MPFR TRUE) +- list (APPEND OPENTURNS_PRIVATE_INCLUDE_DIRS ${MPFR_INCLUDE_DIRS}) +- list (APPEND OPENTURNS_PRIVATE_LIBRARIES ${MPFR_LIBRARIES}) +- list (APPEND OPENTURNS_ENABLED_FEATURES "mpfr") +- endif () +- endif () + if (USE_MPC AND NOT Boost_VERSION VERSION_LESS 1.68) + find_package (MPC) + if (MPC_FOUND) +@@ -290,8 +281,19 @@ if (USE_BOOST) list (APPEND OPENTURNS_ENABLED_FEATURES "mpc") endif () endif () +- list (APPEND OPENTURNS_PRIVATE_LIBRARIES Boost::boost) +- list (APPEND OPENTURNS_ENABLED_FEATURES "boost") + if((USE_MPC OR USE_MPFR) AND NOT BUILD_SHARED_LIBS) + find_library(GMP_LIBRARY NAMES gmp) + list (APPEND OPENTURNS_PRIVATE_LIBRARIES ${GMP_LIBRARY}) + endif() - list (APPEND OPENTURNS_PRIVATE_LIBRARIES Boost::boost) - list (APPEND OPENTURNS_ENABLED_FEATURES "boost") ++ if (USE_MPFR) ++ find_package (MPFR) ++ if (MPFR_FOUND) ++ set (OPENTURNS_HAVE_MPFR TRUE) ++ list (APPEND OPENTURNS_PRIVATE_INCLUDE_DIRS ${MPFR_INCLUDE_DIRS}) ++ list (APPEND OPENTURNS_PRIVATE_LIBRARIES ${MPFR_LIBRARIES}) ++ list (APPEND OPENTURNS_ENABLED_FEATURES "mpfr") ++ endif () ++ endif () endif () + endif () + From 7e5f6f7a2f665a8ed95dd0e3cbc544a7f20c24eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 4 Dec 2024 22:02:22 +0100 Subject: [PATCH 36/67] d --- versions/o-/openturns.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/o-/openturns.json b/versions/o-/openturns.json index 59ea9c828e9e97..31c35aafe52bc7 100644 --- a/versions/o-/openturns.json +++ b/versions/o-/openturns.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "f1aa9f9bb6f1819f37fbd39a33d751589077b790", + "git-tree": "22a72b65a04f78381c81bab88ebba26b52acd5a4", "version": "1.24", "port-version": 0 }, From 3451349796f7d6fbee17fd4d3ff29bc1c0d8c1e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Thu, 5 Dec 2024 07:39:28 +0100 Subject: [PATCH 37/67] d --- ports/rtabmap/ceres-manifold.patch | 80 ++++++++++++++++++++++++++++++ ports/rtabmap/portfile.cmake | 1 + 2 files changed, 81 insertions(+) create mode 100644 ports/rtabmap/ceres-manifold.patch diff --git a/ports/rtabmap/ceres-manifold.patch b/ports/rtabmap/ceres-manifold.patch new file mode 100644 index 00000000000000..6be925c5a00887 --- /dev/null +++ b/ports/rtabmap/ceres-manifold.patch @@ -0,0 +1,80 @@ +diff --git a/corelib/src/optimizer/OptimizerCeres.cpp b/corelib/src/optimizer/OptimizerCeres.cpp +index 5a62283a..5a0d01dc 100644 +--- a/corelib/src/optimizer/OptimizerCeres.cpp ++++ b/corelib/src/optimizer/OptimizerCeres.cpp +@@ -37,7 +37,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + #ifdef RTABMAP_CERES + #include +-#include ++#include + #include "ceres/pose_graph_2d/types.h" + #include "ceres/pose_graph_2d/pose_graph_2d_error_term.h" + #include "ceres/pose_graph_2d/angle_local_parameterization.h" +@@ -118,8 +118,8 @@ std::map OptimizerCeres::optimize( + } + + ceres::LossFunction* loss_function = NULL; +- ceres::LocalParameterization* angle_local_parameterization = NULL; +- ceres::LocalParameterization* quaternion_local_parameterization = NULL; ++ ceres::Manifold* angle_local_parameterization = NULL; ++ ceres::Manifold* quaternion_local_parameterization = NULL; + + for(std::multimap::const_iterator iter=edgeConstraints.begin(); iter!=edgeConstraints.end(); ++iter) + { +@@ -196,7 +196,7 @@ std::map OptimizerCeres::optimize( + pose_end_iter->second.p.data(), pose_end_iter->second.q.coeffs().data()); + if(quaternion_local_parameterization == NULL) + { +- quaternion_local_parameterization = new ceres::EigenQuaternionParameterization; ++ quaternion_local_parameterization = new ceres::EigenQuaternionManifold; + } + problem.SetParameterization(pose_begin_iter->second.q.coeffs().data(), quaternion_local_parameterization); + problem.SetParameterization(pose_end_iter->second.q.coeffs().data(), quaternion_local_parameterization); +diff --git a/corelib/src/optimizer/ceres/pose_graph_2d/angle_local_parameterization.h b/corelib/src/optimizer/ceres/pose_graph_2d/angle_local_parameterization.h +index 428ccccd..b69f77dc 100644 +--- a/corelib/src/optimizer/ceres/pose_graph_2d/angle_local_parameterization.h ++++ b/corelib/src/optimizer/ceres/pose_graph_2d/angle_local_parameterization.h +@@ -31,7 +31,8 @@ + #ifndef CERES_EXAMPLES_POSE_GRAPH_2D_ANGLE_LOCAL_PARAMETERIZATION_H_ + #define CERES_EXAMPLES_POSE_GRAPH_2D_ANGLE_LOCAL_PARAMETERIZATION_H_ + +-#include "ceres/local_parameterization.h" ++#include "ceres/autodiff_manifold.h" ++#include "ceres/manifold.h" + #include "normalize_angle.h" + + namespace ceres { +@@ -51,8 +52,8 @@ class AngleLocalParameterization { + return true; + } + +- static ceres::LocalParameterization* Create() { +- return (new ceres::AutoDiffLocalParameterization); + } + }; +diff --git a/corelib/src/optimizer/ceres/pose_graph_3d/eigen_quaternion_parameterization.h b/corelib/src/optimizer/ceres/pose_graph_3d/eigen_quaternion_parameterization.h +index ae03ebda..ffab3042 100644 +--- a/corelib/src/optimizer/ceres/pose_graph_3d/eigen_quaternion_parameterization.h ++++ b/corelib/src/optimizer/ceres/pose_graph_3d/eigen_quaternion_parameterization.h +@@ -31,7 +31,7 @@ + #ifndef CERES_EXAMPLES_POSE_GRAPH_3D_EIGEN_QUATERNION_PARAMETERIZATION_H_ + #define CERES_EXAMPLES_POSE_GRAPH_3D_EIGEN_QUATERNION_PARAMETERIZATION_H_ + +-#include "ceres/local_parameterization.h" ++#include "ceres/manifold.h" + + namespace ceres { + +@@ -46,7 +46,7 @@ namespace ceres { + // + // Plus(x, delta) = [sin(|delta|) delta / |delta|, cos(|delta|)] * x + // with * being the quaternion multiplication operator. +-class EigenQuaternionParameterization : public ceres::LocalParameterization { ++class EigenQuaternionParameterization : public ceres::Manifold { + public: + virtual ~EigenQuaternionParameterization() {} + virtual bool Plus(const double* x_ptr, diff --git a/ports/rtabmap/portfile.cmake b/ports/rtabmap/portfile.cmake index e063c884d1ae1e..20c74c181c2cd1 100644 --- a/ports/rtabmap/portfile.cmake +++ b/ports/rtabmap/portfile.cmake @@ -11,6 +11,7 @@ vcpkg_from_github( multi-definition.patch rtabmap-res-tool.patch gklib.patch + ceres-manifold.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS From abd2334ee055ec354244bdcfcd49c19acbea985c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Thu, 5 Dec 2024 07:39:50 +0100 Subject: [PATCH 38/67] d --- versions/r-/rtabmap.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/r-/rtabmap.json b/versions/r-/rtabmap.json index 76323019173994..ed3801e0874cb4 100644 --- a/versions/r-/rtabmap.json +++ b/versions/r-/rtabmap.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "1161d6eb7dacc4aa2cff53381126c89c87f30fe0", + "git-tree": "4da69c59b7318e686a461c6f400361aa05ed9293", "version": "0.21.4.1", "port-version": 2 }, From 6d436bca232bd167847840d5d1913b8cf14d492e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Thu, 5 Dec 2024 07:44:23 +0100 Subject: [PATCH 39/67] d --- ports/openturns/link-gmp.patch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/openturns/link-gmp.patch b/ports/openturns/link-gmp.patch index 20d75f9ac963fa..bc0916a95e89f6 100644 --- a/ports/openturns/link-gmp.patch +++ b/ports/openturns/link-gmp.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 81f0f30d1..c846b403a 100644 +index 81f0f30d1..db08c345c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -272,15 +272,6 @@ if (USE_BOOST) @@ -24,10 +24,6 @@ index 81f0f30d1..c846b403a 100644 endif () - list (APPEND OPENTURNS_PRIVATE_LIBRARIES Boost::boost) - list (APPEND OPENTURNS_ENABLED_FEATURES "boost") -+ if((USE_MPC OR USE_MPFR) AND NOT BUILD_SHARED_LIBS) -+ find_library(GMP_LIBRARY NAMES gmp) -+ list (APPEND OPENTURNS_PRIVATE_LIBRARIES ${GMP_LIBRARY}) -+ endif() + if (USE_MPFR) + find_package (MPFR) + if (MPFR_FOUND) @@ -37,6 +33,10 @@ index 81f0f30d1..c846b403a 100644 + list (APPEND OPENTURNS_ENABLED_FEATURES "mpfr") + endif () + endif () ++ if((USE_MPC OR USE_MPFR) AND NOT BUILD_SHARED_LIBS) ++ find_library(GMP_LIBRARY NAMES gmp) ++ list (APPEND OPENTURNS_PRIVATE_LIBRARIES ${GMP_LIBRARY}) ++ endif() endif () endif () From 2cab7a0d0eb670ac9cb73ab988f03d88de2c094a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Thu, 5 Dec 2024 07:44:38 +0100 Subject: [PATCH 40/67] d --- versions/o-/openturns.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/o-/openturns.json b/versions/o-/openturns.json index 31c35aafe52bc7..f0423a38f481cb 100644 --- a/versions/o-/openturns.json +++ b/versions/o-/openturns.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "22a72b65a04f78381c81bab88ebba26b52acd5a4", + "git-tree": "a7fd1d7b26b1383de54594cbf65327ec8db97ea9", "version": "1.24", "port-version": 0 }, From a5b3f9acbd826c9d6f90ac332783b3a9aa797c22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Thu, 5 Dec 2024 07:53:13 +0100 Subject: [PATCH 41/67] d --- ports/theia/ceres-manifold.patch | 82 ++++++++++++++++++++++++++++++++ ports/theia/portfile.cmake | 1 + 2 files changed, 83 insertions(+) create mode 100644 ports/theia/ceres-manifold.patch diff --git a/ports/theia/ceres-manifold.patch b/ports/theia/ceres-manifold.patch new file mode 100644 index 00000000000000..d5fb2f6cec382d --- /dev/null +++ b/ports/theia/ceres-manifold.patch @@ -0,0 +1,82 @@ +diff --git a/src/theia/sfm/bundle_adjustment/bundle_adjust_two_views.cc b/src/theia/sfm/bundle_adjustment/bundle_adjust_two_views.cc +index aab0cfb..6f4ed86 100644 +--- a/src/theia/sfm/bundle_adjustment/bundle_adjust_two_views.cc ++++ b/src/theia/sfm/bundle_adjustment/bundle_adjust_two_views.cc +@@ -35,6 +35,7 @@ + #include "theia/sfm/bundle_adjustment/bundle_adjust_two_views.h" + + #include ++#include + #include + #include + +@@ -96,8 +97,8 @@ void AddCameraParametersToProblem(const bool constant_extrinsic_parameters, + constant_intrinsics.end(), + 1); + +- ceres::SubsetParameterization* subset_parameterization = +- new ceres::SubsetParameterization(num_intrinsics, ++ ceres::SubsetManifold* subset_parameterization = ++ new ceres::SubsetManifold(num_intrinsics, + constant_intrinsics); + problem->AddParameterBlock(camera_intrinsics, + num_intrinsics, +@@ -217,7 +218,7 @@ BundleAdjustmentSummary BundleAdjustTwoViewsAngular( + problem.AddParameterBlock(info->rotation_2.data(), kParameterBlockSize); + // Add the position as a parameter block, ensuring that the norm is 1. + ceres::LocalParameterization* position_parameterization = +- new ceres::AutoDiffLocalParameterization< ++ new ceres::AutoDiffManifold< + UnitNormThreeVectorParameterization, 3, 3>; + problem.AddParameterBlock(info->position_2.data(), + kParameterBlockSize, +diff --git a/src/theia/sfm/bundle_adjustment/bundle_adjuster.cc b/src/theia/sfm/bundle_adjustment/bundle_adjuster.cc +index 27a2efd..9f92a19 100644 +--- a/src/theia/sfm/bundle_adjustment/bundle_adjuster.cc ++++ b/src/theia/sfm/bundle_adjustment/bundle_adjuster.cc +@@ -258,10 +258,10 @@ void BundleAdjuster::SetCameraIntrinsicsParameterization() { + problem_->SetParameterBlockConstant( + camera_intrinsics->mutable_parameters()); + } else if (constant_intrinsics.size() > 0) { +- ceres::SubsetParameterization* subset_parameterization = +- new ceres::SubsetParameterization(camera_intrinsics->NumParameters(), ++ ceres::SubsetManifold* subset_parameterization = ++ new ceres::SubsetManifold(camera_intrinsics->NumParameters(), + constant_intrinsics); +- problem_->SetParameterization(camera_intrinsics->mutable_parameters(), ++ problem_->SetManifold(camera_intrinsics->mutable_parameters(), + subset_parameterization); + } + } +@@ -310,12 +310,12 @@ void BundleAdjuster::SetCameraExtrinsicsConstant(const ViewId view_id) { + void BundleAdjuster::SetCameraPositionConstant(const ViewId view_id) { + static const std::vector position_parameters = { + Camera::POSITION + 0, Camera::POSITION + 1, Camera::POSITION + 2}; +- ceres::SubsetParameterization* subset_parameterization = +- new ceres::SubsetParameterization(Camera::kExtrinsicsSize, ++ ceres::SubsetManifold* subset_parameterization = ++ new ceres::SubsetManifold(Camera::kExtrinsicsSize, + position_parameters); + View* view = reconstruction_->MutableView(view_id); + Camera* camera = view->MutableCamera(); +- problem_->SetParameterization(camera->mutable_extrinsics(), ++ problem_->SetManifold(camera->mutable_extrinsics(), + subset_parameterization); + } + +@@ -324,12 +324,12 @@ void BundleAdjuster::SetCameraOrientationConstant(const ViewId view_id) { + Camera::ORIENTATION + 0, + Camera::ORIENTATION + 1, + Camera::ORIENTATION + 2}; +- ceres::SubsetParameterization* subset_parameterization = +- new ceres::SubsetParameterization(Camera::kExtrinsicsSize, ++ ceres::SubsetManifold* subset_parameterization = ++ new ceres::SubsetManifold(Camera::kExtrinsicsSize, + orientation_parameters); + View* view = reconstruction_->MutableView(view_id); + Camera* camera = view->MutableCamera(); +- problem_->SetParameterization(camera->mutable_extrinsics(), ++ problem_->SetManifold(camera->mutable_extrinsics(), + subset_parameterization); + } + diff --git a/ports/theia/portfile.cmake b/ports/theia/portfile.cmake index a16ee7c460a36e..96fa40c672fe8c 100644 --- a/ports/theia/portfile.cmake +++ b/ports/theia/portfile.cmake @@ -12,6 +12,7 @@ vcpkg_from_github( eigen-3.4.patch 266.diff fix-last-openimageio.patch + ceres-manfild.patch ) file(REMOVE "${SOURCE_PATH}/cmake/FindSuiteSparse.cmake") From 7c04c601a356c1484aa49b53f8e5b618237778d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Thu, 5 Dec 2024 07:53:24 +0100 Subject: [PATCH 42/67] d --- versions/t-/theia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/t-/theia.json b/versions/t-/theia.json index 6da34965a18c73..fe48ebdb9a33a5 100644 --- a/versions/t-/theia.json +++ b/versions/t-/theia.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "fcce9342a3c7301139dd9d9a388657d99fdcc159", + "git-tree": "cf3c170fb9f1cfd4a7143d6ff2fbb2cb06f0aaee", "version": "0.8", "port-version": 12 }, From f85d66395bbcfd85a12497d49fef5ce12de1bc60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Thu, 5 Dec 2024 07:55:03 +0100 Subject: [PATCH 43/67] d --- ports/openmvg/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/openmvg/portfile.cmake b/ports/openmvg/portfile.cmake index 6021e8587ae1a6..179c1395257bbe 100644 --- a/ports/openmvg/portfile.cmake +++ b/ports/openmvg/portfile.cmake @@ -132,6 +132,7 @@ if("software" IN_LIST FEATURES) openMVG_main_ComputeMatches openMVG_main_ComputeSfM_DataColor openMVG_main_ComputeStructureFromKnownPoses + openMVG_main_ComputeVLAD openMVG_main_ConvertList openMVG_main_ConvertSfM_DataFormat openMVG_main_evalQuality From 88cbb028a25408c75c78acd7613020b7f4423a24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Thu, 5 Dec 2024 07:56:06 +0100 Subject: [PATCH 44/67] d --- versions/o-/openmvg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/o-/openmvg.json b/versions/o-/openmvg.json index a3e53ecc76df9d..b81d5233097cf8 100644 --- a/versions/o-/openmvg.json +++ b/versions/o-/openmvg.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "dc0ba1a2534852a26baf5359eed978854d7f5f48", + "git-tree": "28c8872842fd1bac86010c5a235831d25b6f8add", "version": "2.1", "port-version": 0 }, From c65ee75f6982a501ef0d96c8cebe89653a8103dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Thu, 5 Dec 2024 11:23:40 +0100 Subject: [PATCH 45/67] d --- ports/rtabmap/ceres-manifold.patch | 50 +++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/ports/rtabmap/ceres-manifold.patch b/ports/rtabmap/ceres-manifold.patch index 6be925c5a00887..199ba39b478543 100644 --- a/ports/rtabmap/ceres-manifold.patch +++ b/ports/rtabmap/ceres-manifold.patch @@ -1,5 +1,5 @@ diff --git a/corelib/src/optimizer/OptimizerCeres.cpp b/corelib/src/optimizer/OptimizerCeres.cpp -index 5a62283a..5a0d01dc 100644 +index 5a62283a..7d216b47 100644 --- a/corelib/src/optimizer/OptimizerCeres.cpp +++ b/corelib/src/optimizer/OptimizerCeres.cpp @@ -37,7 +37,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @@ -22,17 +22,33 @@ index 5a62283a..5a0d01dc 100644 for(std::multimap::const_iterator iter=edgeConstraints.begin(); iter!=edgeConstraints.end(); ++iter) { -@@ -196,7 +196,7 @@ std::map OptimizerCeres::optimize( +@@ -168,8 +168,8 @@ std::map OptimizerCeres::optimize( + { + angle_local_parameterization = ceres::examples::AngleLocalParameterization::Create(); + } +- problem.SetParameterization(&pose_begin_iter->second.yaw_radians, angle_local_parameterization); +- problem.SetParameterization(&pose_end_iter->second.yaw_radians, angle_local_parameterization); ++ problem.SetManifold(&pose_begin_iter->second.yaw_radians, angle_local_parameterization); ++ problem.SetManifold(&pose_end_iter->second.yaw_radians, angle_local_parameterization); + } + else + { +@@ -196,10 +196,10 @@ std::map OptimizerCeres::optimize( pose_end_iter->second.p.data(), pose_end_iter->second.q.coeffs().data()); if(quaternion_local_parameterization == NULL) { - quaternion_local_parameterization = new ceres::EigenQuaternionParameterization; + quaternion_local_parameterization = new ceres::EigenQuaternionManifold; } - problem.SetParameterization(pose_begin_iter->second.q.coeffs().data(), quaternion_local_parameterization); - problem.SetParameterization(pose_end_iter->second.q.coeffs().data(), quaternion_local_parameterization); +- problem.SetParameterization(pose_begin_iter->second.q.coeffs().data(), quaternion_local_parameterization); +- problem.SetParameterization(pose_end_iter->second.q.coeffs().data(), quaternion_local_parameterization); ++ problem.SetManifold(pose_begin_iter->second.q.coeffs().data(), quaternion_local_parameterization); ++ problem.SetManifold(pose_end_iter->second.q.coeffs().data(), quaternion_local_parameterization); + } + } + //else // not supporting pose prior and landmarks diff --git a/corelib/src/optimizer/ceres/pose_graph_2d/angle_local_parameterization.h b/corelib/src/optimizer/ceres/pose_graph_2d/angle_local_parameterization.h -index 428ccccd..b69f77dc 100644 +index 428ccccd..c0454c8d 100644 --- a/corelib/src/optimizer/ceres/pose_graph_2d/angle_local_parameterization.h +++ b/corelib/src/optimizer/ceres/pose_graph_2d/angle_local_parameterization.h @@ -31,7 +31,8 @@ @@ -45,17 +61,35 @@ index 428ccccd..b69f77dc 100644 #include "normalize_angle.h" namespace ceres { -@@ -51,8 +52,8 @@ class AngleLocalParameterization { +@@ -41,19 +42,20 @@ namespace examples { + // [-pi to pi). + class AngleLocalParameterization { + public: +- + template +- bool operator()(const T* theta_radians, const T* delta_theta_radians, +- T* theta_radians_plus_delta) const { +- *theta_radians_plus_delta = +- NormalizeAngle(*theta_radians + *delta_theta_radians); ++ bool Plus(const T* x, const T* delta, T* x_plus_delta) const { ++ *x_plus_delta = NormalizeAngle(*x + *delta); ++ return true; ++ } + ++ template ++ bool Minus(const double* y, const double* x, double* y_minus_x) const { ++ *y_minus_x = NormalizeAngle(*y - *x); return true; } - static ceres::LocalParameterization* Create() { - return (new ceres::AutoDiffLocalParameterization); + static ceres::Manifold* Create() { -+ return (new ceres::AutoDiffManifold); ++ return (new ceres::AutoDiffManifold); } }; + diff --git a/corelib/src/optimizer/ceres/pose_graph_3d/eigen_quaternion_parameterization.h b/corelib/src/optimizer/ceres/pose_graph_3d/eigen_quaternion_parameterization.h index ae03ebda..ffab3042 100644 --- a/corelib/src/optimizer/ceres/pose_graph_3d/eigen_quaternion_parameterization.h From 3efe26c2040f02984adb6a9617e146e02381124c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Thu, 5 Dec 2024 11:23:51 +0100 Subject: [PATCH 46/67] d --- versions/r-/rtabmap.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/r-/rtabmap.json b/versions/r-/rtabmap.json index ed3801e0874cb4..165bee865a1e53 100644 --- a/versions/r-/rtabmap.json +++ b/versions/r-/rtabmap.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "4da69c59b7318e686a461c6f400361aa05ed9293", + "git-tree": "d515695eb03837dc58afe4b5965b73d8e4387a23", "version": "0.21.4.1", "port-version": 2 }, From 0a52491a602169a82abd085e6f99355f827a7c8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Thu, 5 Dec 2024 11:36:24 +0100 Subject: [PATCH 47/67] d --- ports/rtabmap/ceres-manifold.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/rtabmap/ceres-manifold.patch b/ports/rtabmap/ceres-manifold.patch index 199ba39b478543..e84d463e844dce 100644 --- a/ports/rtabmap/ceres-manifold.patch +++ b/ports/rtabmap/ceres-manifold.patch @@ -48,7 +48,7 @@ index 5a62283a..7d216b47 100644 } //else // not supporting pose prior and landmarks diff --git a/corelib/src/optimizer/ceres/pose_graph_2d/angle_local_parameterization.h b/corelib/src/optimizer/ceres/pose_graph_2d/angle_local_parameterization.h -index 428ccccd..c0454c8d 100644 +index 428ccccd..d5bf1dcd 100644 --- a/corelib/src/optimizer/ceres/pose_graph_2d/angle_local_parameterization.h +++ b/corelib/src/optimizer/ceres/pose_graph_2d/angle_local_parameterization.h @@ -31,7 +31,8 @@ @@ -77,7 +77,7 @@ index 428ccccd..c0454c8d 100644 + } + template -+ bool Minus(const double* y, const double* x, double* y_minus_x) const { ++ bool Minus(const T* y, const T* x, T* y_minus_x) const { + *y_minus_x = NormalizeAngle(*y - *x); return true; } From 3bbe29942dc3a2ccd8ddee90bc91927d5843fab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Thu, 5 Dec 2024 11:36:33 +0100 Subject: [PATCH 48/67] d --- versions/r-/rtabmap.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/r-/rtabmap.json b/versions/r-/rtabmap.json index 165bee865a1e53..4b6ab5f1fd3ad1 100644 --- a/versions/r-/rtabmap.json +++ b/versions/r-/rtabmap.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "d515695eb03837dc58afe4b5965b73d8e4387a23", + "git-tree": "1724fe107ebd054a133ff197201900a136d60d0b", "version": "0.21.4.1", "port-version": 2 }, From 8952607f17c0fba4dba0f64fed2ef26c26ea51be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Thu, 5 Dec 2024 11:37:29 +0100 Subject: [PATCH 49/67] d --- ports/theia/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/theia/portfile.cmake b/ports/theia/portfile.cmake index 96fa40c672fe8c..84f493f16f31e0 100644 --- a/ports/theia/portfile.cmake +++ b/ports/theia/portfile.cmake @@ -12,7 +12,7 @@ vcpkg_from_github( eigen-3.4.patch 266.diff fix-last-openimageio.patch - ceres-manfild.patch + ceres-manifold.patch ) file(REMOVE "${SOURCE_PATH}/cmake/FindSuiteSparse.cmake") From 217782b15fb5597b8db55d216d956ac302977424 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Thu, 5 Dec 2024 11:37:34 +0100 Subject: [PATCH 50/67] d --- versions/t-/theia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/t-/theia.json b/versions/t-/theia.json index fe48ebdb9a33a5..57cf606a7b765f 100644 --- a/versions/t-/theia.json +++ b/versions/t-/theia.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "cf3c170fb9f1cfd4a7143d6ff2fbb2cb06f0aaee", + "git-tree": "67c1d86bbbdb6721594a4a50ebfbe48cd0b9e809", "version": "0.8", "port-version": 12 }, From 30a17dcce8672df471568ef80fe6f7d8dbdf952e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Thu, 5 Dec 2024 12:02:27 +0100 Subject: [PATCH 51/67] d --- ports/theia/ceres-manifold.patch | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/ports/theia/ceres-manifold.patch b/ports/theia/ceres-manifold.patch index d5fb2f6cec382d..9bdb0f80899410 100644 --- a/ports/theia/ceres-manifold.patch +++ b/ports/theia/ceres-manifold.patch @@ -1,16 +1,8 @@ diff --git a/src/theia/sfm/bundle_adjustment/bundle_adjust_two_views.cc b/src/theia/sfm/bundle_adjustment/bundle_adjust_two_views.cc -index aab0cfb..6f4ed86 100644 +index aab0cfb..8631d1c 100644 --- a/src/theia/sfm/bundle_adjustment/bundle_adjust_two_views.cc +++ b/src/theia/sfm/bundle_adjustment/bundle_adjust_two_views.cc -@@ -35,6 +35,7 @@ - #include "theia/sfm/bundle_adjustment/bundle_adjust_two_views.h" - - #include -+#include - #include - #include - -@@ -96,8 +97,8 @@ void AddCameraParametersToProblem(const bool constant_extrinsic_parameters, +@@ -96,8 +96,8 @@ void AddCameraParametersToProblem(const bool constant_extrinsic_parameters, constant_intrinsics.end(), 1); @@ -21,17 +13,22 @@ index aab0cfb..6f4ed86 100644 constant_intrinsics); problem->AddParameterBlock(camera_intrinsics, num_intrinsics, -@@ -217,7 +218,7 @@ BundleAdjustmentSummary BundleAdjustTwoViewsAngular( +@@ -216,12 +216,9 @@ BundleAdjustmentSummary BundleAdjustTwoViewsAngular( + const int kParameterBlockSize = 3; problem.AddParameterBlock(info->rotation_2.data(), kParameterBlockSize); // Add the position as a parameter block, ensuring that the norm is 1. - ceres::LocalParameterization* position_parameterization = +- ceres::LocalParameterization* position_parameterization = - new ceres::AutoDiffLocalParameterization< -+ new ceres::AutoDiffManifold< - UnitNormThreeVectorParameterization, 3, 3>; +- UnitNormThreeVectorParameterization, 3, 3>; problem.AddParameterBlock(info->position_2.data(), kParameterBlockSize, +- position_parameterization); ++ new ceres::SphereManifold<3>); + + // Add all the epipolar constraints from feature matches. + for (const FeatureCorrespondence& match : correspondences) { diff --git a/src/theia/sfm/bundle_adjustment/bundle_adjuster.cc b/src/theia/sfm/bundle_adjustment/bundle_adjuster.cc -index 27a2efd..9f92a19 100644 +index 27a2efd..c1a1506 100644 --- a/src/theia/sfm/bundle_adjustment/bundle_adjuster.cc +++ b/src/theia/sfm/bundle_adjustment/bundle_adjuster.cc @@ -258,10 +258,10 @@ void BundleAdjuster::SetCameraIntrinsicsParameterization() { @@ -40,10 +37,11 @@ index 27a2efd..9f92a19 100644 } else if (constant_intrinsics.size() > 0) { - ceres::SubsetParameterization* subset_parameterization = - new ceres::SubsetParameterization(camera_intrinsics->NumParameters(), +- constant_intrinsics); +- problem_->SetParameterization(camera_intrinsics->mutable_parameters(), + ceres::SubsetManifold* subset_parameterization = + new ceres::SubsetManifold(camera_intrinsics->NumParameters(), - constant_intrinsics); -- problem_->SetParameterization(camera_intrinsics->mutable_parameters(), ++ constant_intrinsics); + problem_->SetManifold(camera_intrinsics->mutable_parameters(), subset_parameterization); } From 6e1e65744bf7f8d406b462dd595ab3eab50e3f43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Thu, 5 Dec 2024 12:02:39 +0100 Subject: [PATCH 52/67] d --- versions/t-/theia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/t-/theia.json b/versions/t-/theia.json index 57cf606a7b765f..650b1366192c3f 100644 --- a/versions/t-/theia.json +++ b/versions/t-/theia.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "67c1d86bbbdb6721594a4a50ebfbe48cd0b9e809", + "git-tree": "eb1ed0cff079b1deddd5dccde7c5199d4dd01618", "version": "0.8", "port-version": 12 }, From 303130fa65660d8e8334f5c77e0c21b223b551af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Fri, 6 Dec 2024 06:46:07 +0100 Subject: [PATCH 53/67] d --- ports/rtabmap/vcpkg.json | 2 +- versions/r-/rtabmap.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/rtabmap/vcpkg.json b/ports/rtabmap/vcpkg.json index 051cbaaaba5ae0..928ed827a9734f 100644 --- a/ports/rtabmap/vcpkg.json +++ b/ports/rtabmap/vcpkg.json @@ -1,7 +1,7 @@ { "name": "rtabmap", "version": "0.21.4.1", - "port-version": 2, + "port-version": 3, "description": "Real-Time Appearance-Based Mapping", "homepage": "https://introlab.github.io/rtabmap/", "license": null, diff --git a/versions/r-/rtabmap.json b/versions/r-/rtabmap.json index 4b6ab5f1fd3ad1..76323019173994 100644 --- a/versions/r-/rtabmap.json +++ b/versions/r-/rtabmap.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "1724fe107ebd054a133ff197201900a136d60d0b", + "git-tree": "1161d6eb7dacc4aa2cff53381126c89c87f30fe0", "version": "0.21.4.1", "port-version": 2 }, From 91494ff244e3251fcc99ecc3afd2d3af76aac721 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Fri, 6 Dec 2024 06:46:25 +0100 Subject: [PATCH 54/67] d --- versions/t-/theia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/t-/theia.json b/versions/t-/theia.json index 650b1366192c3f..6da34965a18c73 100644 --- a/versions/t-/theia.json +++ b/versions/t-/theia.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "eb1ed0cff079b1deddd5dccde7c5199d4dd01618", + "git-tree": "fcce9342a3c7301139dd9d9a388657d99fdcc159", "version": "0.8", "port-version": 12 }, From 9b9c7f475c1237eb159b3a8d14491b32aa3f2251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Fri, 6 Dec 2024 06:46:38 +0100 Subject: [PATCH 55/67] d --- ports/theia/vcpkg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/theia/vcpkg.json b/ports/theia/vcpkg.json index 448ffaab3da38e..03cb2da5e9181b 100644 --- a/ports/theia/vcpkg.json +++ b/ports/theia/vcpkg.json @@ -1,7 +1,7 @@ { "name": "theia", "version": "0.8", - "port-version": 12, + "port-version": 13, "description": "An open source library for multiview geometry and structure from motion", "homepage": "https://github.com/sweeneychris/TheiaSfM", "license": "BSD-3-Clause", From eb518c63b48da0c52735001b42ec478afa4c8433 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Fri, 6 Dec 2024 06:47:06 +0100 Subject: [PATCH 56/67] cr --- versions/baseline.json | 4 ++-- versions/r-/rtabmap.json | 5 +++++ versions/t-/theia.json | 5 +++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/versions/baseline.json b/versions/baseline.json index 466ade04bbf646..4b8fd93eb2dd07 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -8046,7 +8046,7 @@ }, "rtabmap": { "baseline": "0.21.4.1", - "port-version": 2 + "port-version": 3 }, "rtabmap-res-tool": { "baseline": "0.21.4.1", @@ -8910,7 +8910,7 @@ }, "theia": { "baseline": "0.8", - "port-version": 12 + "port-version": 13 }, "think-cell-range": { "baseline": "2023.1", diff --git a/versions/r-/rtabmap.json b/versions/r-/rtabmap.json index 76323019173994..d39f9485fb7967 100644 --- a/versions/r-/rtabmap.json +++ b/versions/r-/rtabmap.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "6af91c914592f943f3f7ae824d2870558debc63f", + "version": "0.21.4.1", + "port-version": 3 + }, { "git-tree": "1161d6eb7dacc4aa2cff53381126c89c87f30fe0", "version": "0.21.4.1", diff --git a/versions/t-/theia.json b/versions/t-/theia.json index 6da34965a18c73..37e7ef5541b2ef 100644 --- a/versions/t-/theia.json +++ b/versions/t-/theia.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "8a204a8d80c0eea41176e6824406b28fe28c3b5c", + "version": "0.8", + "port-version": 13 + }, { "git-tree": "fcce9342a3c7301139dd9d9a388657d99fdcc159", "version": "0.8", From dacc45636e162df7251af45884070e4b00fe7422 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Fri, 6 Dec 2024 06:48:04 +0100 Subject: [PATCH 57/67] d --- versions/o-/openmvg.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/versions/o-/openmvg.json b/versions/o-/openmvg.json index b81d5233097cf8..5f10f12a84715e 100644 --- a/versions/o-/openmvg.json +++ b/versions/o-/openmvg.json @@ -5,11 +5,6 @@ "version": "2.1", "port-version": 0 }, - { - "git-tree": "4d295167110da197b9fa74056de4c0863d1953c9", - "version": "2.0", - "port-version": 12 - }, { "git-tree": "e08aec4337f9a281817b2c84d04fee5a079551d8", "version": "2.0", From 79d503d311f56f23613fccf7fbc6c737e6444df8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Tue, 10 Dec 2024 09:01:04 +0100 Subject: [PATCH 58/67] fix ceres --- ports/ceres/0001_cmakelists_fixes.patch | 14 ++++++++------ ports/ceres/portfile.cmake | 4 +++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ports/ceres/0001_cmakelists_fixes.patch b/ports/ceres/0001_cmakelists_fixes.patch index 4591bc511c20e4..e57308a737db26 100644 --- a/ports/ceres/0001_cmakelists_fixes.patch +++ b/ports/ceres/0001_cmakelists_fixes.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8e49c19e..330bb8cf 100644 +index 8e49c19e..f8c61d92 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -292,27 +292,28 @@ if (SUITESPARSE) @@ -43,7 +43,7 @@ index 8e49c19e..330bb8cf 100644 else (SUITESPARSE) message("-- Building without SuiteSparse.") list(APPEND CERES_COMPILE_OPTIONS CERES_NO_SUITESPARSE) -@@ -395,9 +396,10 @@ endif() +@@ -395,9 +396,12 @@ endif() # GFlags. if (GFLAGS) # Don't search with REQUIRED as we can continue without gflags. @@ -52,11 +52,13 @@ index 8e49c19e..330bb8cf 100644 if (gflags_FOUND) - if (TARGET gflags) + if (TARGET gflags::gflags) -+ add_library(gflags ALIAS gflags::gflags) ++ if(NOT TARGET gflags) ++ add_library(gflags ALIAS gflags::gflags) ++ endif() message("-- Found Google Flags (gflags) version ${gflags_VERSION}: ${gflags_DIR}") else() message("-- Detected version of gflags: ${gflags_VERSION} does not define " -@@ -430,28 +432,7 @@ if (MINIGLOG) +@@ -430,28 +434,7 @@ if (MINIGLOG) mark_as_advanced(FORCE GLOG_INCLUDE_DIR GLOG_LIBRARY) else (MINIGLOG) @@ -86,7 +88,7 @@ index 8e49c19e..330bb8cf 100644 endif (MINIGLOG) if (NOT SCHUR_SPECIALIZATIONS) -@@ -466,7 +447,7 @@ endif (NOT CUSTOM_BLAS) +@@ -466,7 +449,7 @@ endif (NOT CUSTOM_BLAS) if (BUILD_BENCHMARKS) # Version 1.3 was first to provide import targets @@ -95,7 +97,7 @@ index 8e49c19e..330bb8cf 100644 if (benchmark_FOUND) message("-- Found Google benchmark library. Building Ceres benchmarks.") else() -@@ -722,12 +703,6 @@ install(FILES "${Ceres_BINARY_DIR}/CeresConfig-install.cmake" +@@ -722,12 +705,6 @@ install(FILES "${Ceres_BINARY_DIR}/CeresConfig-install.cmake" DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) install(FILES "${Ceres_BINARY_DIR}/CeresConfigVersion.cmake" DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) diff --git a/ports/ceres/portfile.cmake b/ports/ceres/portfile.cmake index e39a58119ec0d5..f6363592f66ad1 100644 --- a/ports/ceres/portfile.cmake +++ b/ports/ceres/portfile.cmake @@ -55,7 +55,6 @@ endif() vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" - MAYBE_UNUSED_VARIABLES OPTIONS ${FEATURE_OPTIONS} ${TARGET_OPTIONS} @@ -67,6 +66,9 @@ vcpkg_cmake_configure( -DUSE_CUDA=${USE_CUDA} -DPROVIDE_UNINSTALL_TARGET=OFF -DMSVC_USE_STATIC_CRT=${MSVC_USE_STATIC_CRT_VALUE} + MAYBE_UNUSED_VARIABLES + CUDA + MSVC_USE_STATIC_CRT ) vcpkg_cmake_install() From 503648f844afcb2afcf0d1b462f631dafa77b78e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Tue, 10 Dec 2024 09:09:29 +0100 Subject: [PATCH 59/67] d --- versions/c-/ceres.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/c-/ceres.json b/versions/c-/ceres.json index 4be5ae3c8bb657..2875185a808aab 100644 --- a/versions/c-/ceres.json +++ b/versions/c-/ceres.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "8fcad7138812e4f098e080f9714466318f80abdf", + "git-tree": "ae2ddb638679c4955ec12f60c33eb43493786535", "version": "2.2.0", "port-version": 0 }, From 5bc2afd1bac86f40963cfea01cb75dee3f1f23d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Tue, 10 Dec 2024 14:45:47 +0100 Subject: [PATCH 60/67] fix --- ports/cartographer/fix-errors.patch | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/ports/cartographer/fix-errors.patch b/ports/cartographer/fix-errors.patch index 25e8b6075aaf8e..57be338e623a17 100644 --- a/ports/cartographer/fix-errors.patch +++ b/ports/cartographer/fix-errors.patch @@ -151,6 +151,24 @@ index ef2fcb3..eff0c68 100644 FILE CartographerTargets.cmake ) +diff --git a/cartographer-config.cmake.in b/cartographer-config.cmake.in +index 98193da..3e36ad9 100644 +--- a/cartographer-config.cmake.in ++++ b/cartographer-config.cmake.in +@@ -44,6 +44,13 @@ if(CARTOGRAPHER_HAS_GRPC) + find_package(async_grpc ${QUIET_OR_REQUIRED_OPTION}) + endif() + ++if(WIN32) ++ set(Boost_USE_STATIC_LIBS FALSE) ++endif() ++find_package(Boost ${QUIET_OR_REQUIRED_OPTION} COMPONENTS iostreams) ++find_package(Lua ${QUIET_OR_REQUIRED_OPTION}) ++find_package(Protobuf ${QUIET_OR_REQUIRED_OPTION}) ++ + include("${CARTOGRAPHER_CMAKE_DIR}/CartographerTargets.cmake") + + unset(QUIET_OR_REQUIRED_OPTION) diff --git a/cartographer/cloud/internal/map_builder_server.h b/cartographer/cloud/internal/map_builder_server.h index 03a70aa..3687f3d 100644 --- a/cartographer/cloud/internal/map_builder_server.h @@ -1576,10 +1594,10 @@ index 68551f1..9619735 100644 #include diff --git a/cmake/functions.cmake b/cmake/functions.cmake -index 8cfc05f..9ff4de0 100644 +index 1bbce43..ed320b1 100644 --- a/cmake/functions.cmake +++ b/cmake/functions.cmake -@@ -126,12 +126,7 @@ macro(google_initialize_cartographer_project) +@@ -130,12 +130,7 @@ macro(google_initialize_cartographer_project) set(LIST_FILES_CMD "find ${PROJECT_SOURCE_DIR}/ -not -iwholename '*.git*' | sort | sed 's/^/#/'") set(FILES_LIST_PATH "${PROJECT_BINARY_DIR}/AllFiles.cmake") set(DETECT_CHANGES_CMD "bash" "-c" "${LIST_FILES_CMD} | diff -N -q ${FILES_LIST_PATH} - || ${LIST_FILES_CMD} > ${FILES_LIST_PATH}") From 03c42f4e3c4bdab19d8cc5e03ff40b17898d166d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Tue, 10 Dec 2024 14:46:47 +0100 Subject: [PATCH 61/67] d --- versions/c-/cartographer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/c-/cartographer.json b/versions/c-/cartographer.json index 8ca628245daf34..fd27c5ea458c34 100644 --- a/versions/c-/cartographer.json +++ b/versions/c-/cartographer.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "54b308ddceadae0c4f0be267b086f846144e7d49", + "git-tree": "b98a382a2dd9435fe755b0960e7acefe07df4037", "version": "2.0.0", "port-version": 0 }, From edf9d08332b64074911f685eceb0663fdccf44b7 Mon Sep 17 00:00:00 2001 From: Billy Robert O'Neal III Date: Tue, 10 Dec 2024 16:55:31 -0800 Subject: [PATCH 62/67] Deindex theia and cartrographer on the grounds that they require huge patches to adapt to updated ceres versions, and are unmaintained by upstreams. --- ports/cartographer/fix-errors.patch | 1612 ----------------- ports/cartographer/portfile.cmake | 29 - ...ographer-to-deal-with-newer-ceres-24.patch | 604 ------ ports/cartographer/vcpkg.json | 29 - ports/theia/266.diff | 12 - ports/theia/ceres-manifold.patch | 80 - ports/theia/eigen-3.4.patch | 24 - ports/theia/fix-external-dependencies.patch | 457 ----- ports/theia/fix-external-dependencies2.patch | 76 - ports/theia/fix-last-openimageio.patch | 44 - ports/theia/portfile.cmake | 57 - ports/theia/vcpkg.json | 38 - versions/baseline.json | 8 - versions/c-/cartographer.json | 5 - versions/t-/theia.json | 5 - 15 files changed, 3080 deletions(-) delete mode 100644 ports/cartographer/fix-errors.patch delete mode 100644 ports/cartographer/portfile.cmake delete mode 100644 ports/cartographer/update-cartographer-to-deal-with-newer-ceres-24.patch delete mode 100644 ports/cartographer/vcpkg.json delete mode 100644 ports/theia/266.diff delete mode 100644 ports/theia/ceres-manifold.patch delete mode 100644 ports/theia/eigen-3.4.patch delete mode 100644 ports/theia/fix-external-dependencies.patch delete mode 100644 ports/theia/fix-external-dependencies2.patch delete mode 100644 ports/theia/fix-last-openimageio.patch delete mode 100644 ports/theia/portfile.cmake delete mode 100644 ports/theia/vcpkg.json diff --git a/ports/cartographer/fix-errors.patch b/ports/cartographer/fix-errors.patch deleted file mode 100644 index 57be338e623a17..00000000000000 --- a/ports/cartographer/fix-errors.patch +++ /dev/null @@ -1,1612 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index ef2fcb3..eff0c68 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -16,7 +16,7 @@ cmake_minimum_required(VERSION 3.2) - - project(cartographer) - --set(CARTOGRAPHER_MAJOR_VERSION 1) -+set(CARTOGRAPHER_MAJOR_VERSION 2) - set(CARTOGRAPHER_MINOR_VERSION 0) - set(CARTOGRAPHER_PATCH_VERSION 0) - set(CARTOGRAPHER_VERSION ${CARTOGRAPHER_MAJOR_VERSION}.${CARTOGRAPHER_MINOR_VERSION}.${CARTOGRAPHER_PATCH_VERSION}) -@@ -26,26 +26,19 @@ set(CARTOGRAPHER_HAS_GRPC ${BUILD_GRPC}) - option(BUILD_PROMETHEUS "build Prometheus monitoring support" false) - - include("${PROJECT_SOURCE_DIR}/cmake/functions.cmake") --google_initialize_cartographer_project() --google_enable_testing() - - find_package(absl REQUIRED) - set(BOOST_COMPONENTS iostreams) - if(WIN32) -- list(APPEND BOOST_COMPONENTS zlib) - set(Boost_USE_STATIC_LIBS FALSE) - endif() - find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS}) - find_package(Ceres REQUIRED COMPONENTS SuiteSparse) - find_package(Eigen3 REQUIRED) --find_package(LuaGoogle REQUIRED) --if(WIN32) -- # On Windows, Protobuf is incorrectly found by the bundled CMake module, so prefer native CMake config. -- set(protobuf_MODULE_COMPATIBLE TRUE CACHE INTERNAL "") -- find_package(Protobuf 3.0.0 CONFIG) --else() -- find_package(Protobuf 3.0.0 REQUIRED) --endif() -+find_package(Lua REQUIRED) -+find_package(Protobuf REQUIRED) -+find_package(glog REQUIRED) -+find_package(gflags REQUIRED) - - if (${BUILD_GRPC}) - find_package(async_grpc REQUIRED) -@@ -55,18 +48,7 @@ if(${BUILD_PROMETHEUS}) - find_package( ZLIB REQUIRED ) - endif() - --include(FindPkgConfig) --if (NOT WIN32) -- PKG_SEARCH_MODULE(CAIRO REQUIRED cairo>=1.12.16) --else() -- find_library(CAIRO_LIBRARIES cairo) --endif() -- --# Only build the documentation if we can find Sphinx. --find_package(Sphinx) --if(SPHINX_FOUND) -- add_subdirectory("docs") --endif() -+find_library(CAIRO_LIBRARY cairo${CAIRO_LIB_SUFFIX}) - - # Install catkin package.xml - install(FILES package.xml DESTINATION share/cartographer) -@@ -190,26 +172,6 @@ configure_file( - ${PROJECT_SOURCE_DIR}/cartographer/common/config.h.cmake - ${PROJECT_BINARY_DIR}/cartographer/common/config.h) - --google_binary(cartographer_autogenerate_ground_truth -- SRCS -- cartographer/ground_truth/autogenerate_ground_truth_main.cc --) -- --google_binary(cartographer_compute_relations_metrics -- SRCS -- cartographer/ground_truth/compute_relations_metrics_main.cc --) -- --google_binary(cartographer_pbstream -- SRCS -- cartographer/io/pbstream_main.cc --) -- --google_binary(cartographer_print_configuration -- SRCS -- cartographer/common/print_configuration_main.cc --) -- - if(${BUILD_GRPC}) - google_binary(cartographer_grpc_server - SRCS -@@ -247,8 +209,6 @@ else() - set(GLOG_LIBRARY glog) - endif() - --target_link_libraries(${PROJECT_NAME} PUBLIC ${GLOG_LIBRARY}) --target_link_libraries(${PROJECT_NAME} PUBLIC gflags) - if(WIN32) - # Needed to fix conflict with MSVC's error macro. - target_compile_definitions(${PROJECT_NAME} PUBLIC -DGLOG_NO_ABBREVIATED_SEVERITIES) -@@ -258,17 +218,11 @@ if(MSVC) - target_compile_definitions(${PROJECT_NAME} PUBLIC -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_USE_MATH_DEFINES) - endif() - --if("${CAIRO_INCLUDE_DIRS}") -- target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC -- "${CAIRO_INCLUDE_DIRS}") --endif() --target_link_libraries(${PROJECT_NAME} PUBLIC ${CAIRO_LIBRARIES}) -- - target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC - ${PROTOBUF_INCLUDE_DIR}) - # TODO(hrapp): This should not explicitly list pthread and use - # PROTOBUF_LIBRARIES, but that failed on first try. --target_link_libraries(${PROJECT_NAME} PUBLIC ${PROTOBUF_LIBRARY} -+target_link_libraries(${PROJECT_NAME} PUBLIC protobuf::libprotobuf - absl::algorithm - absl::base - absl::debugging -@@ -300,6 +254,7 @@ set(TARGET_COMPILE_FLAGS "${TARGET_COMPILE_FLAGS} ${GOOG_CXX_FLAGS}") - set_target_properties(${PROJECT_NAME} PROPERTIES - COMPILE_FLAGS ${TARGET_COMPILE_FLAGS}) - -+ if(0) - set(TEST_LIB - cartographer_test_library - ) -@@ -333,6 +288,7 @@ foreach(ABS_FIL ${ALL_TESTS}) - endif() - target_link_libraries("${TEST_TARGET_NAME}" PUBLIC ${TEST_LIB}) - endforeach() -+endif() - - # Add the binary directory first, so that port.h is included after it has - # been generated. -@@ -368,7 +324,7 @@ foreach(HDR ${INSTALL_GENERATED_HDRS}) - ) - endforeach() - --set(CARTOGRAPHER_CMAKE_DIR share/cartographer/cmake) -+set(CARTOGRAPHER_CMAKE_DIR share/cartographer) - include(CMakePackageConfigHelpers) - configure_package_config_file( - cartographer-config.cmake.in -@@ -379,7 +335,7 @@ configure_package_config_file( - - install( - EXPORT CartographerExport -- DESTINATION share/cartographer/cmake/ -+ DESTINATION share/cartographer/ - FILE CartographerTargets.cmake - ) - -diff --git a/cartographer-config.cmake.in b/cartographer-config.cmake.in -index 98193da..3e36ad9 100644 ---- a/cartographer-config.cmake.in -+++ b/cartographer-config.cmake.in -@@ -44,6 +44,13 @@ if(CARTOGRAPHER_HAS_GRPC) - find_package(async_grpc ${QUIET_OR_REQUIRED_OPTION}) - endif() - -+if(WIN32) -+ set(Boost_USE_STATIC_LIBS FALSE) -+endif() -+find_package(Boost ${QUIET_OR_REQUIRED_OPTION} COMPONENTS iostreams) -+find_package(Lua ${QUIET_OR_REQUIRED_OPTION}) -+find_package(Protobuf ${QUIET_OR_REQUIRED_OPTION}) -+ - include("${CARTOGRAPHER_CMAKE_DIR}/CartographerTargets.cmake") - - unset(QUIET_OR_REQUIRED_OPTION) -diff --git a/cartographer/cloud/internal/map_builder_server.h b/cartographer/cloud/internal/map_builder_server.h -index 03a70aa..3687f3d 100644 ---- a/cartographer/cloud/internal/map_builder_server.h -+++ b/cartographer/cloud/internal/map_builder_server.h -@@ -137,10 +137,10 @@ class MapBuilderServer : public MapBuilderServerInterface { - absl::Mutex subscriptions_lock_; - int current_subscription_index_ = 0; - std::map -- local_slam_subscriptions_ GUARDED_BY(subscriptions_lock_); -+ local_slam_subscriptions_ ABSL_GUARDED_BY(subscriptions_lock_); - std::map -- global_slam_subscriptions_ GUARDED_BY(subscriptions_lock_); -+ global_slam_subscriptions_ ABSL_GUARDED_BY(subscriptions_lock_); - std::unique_ptr local_trajectory_uploader_; - int starting_submap_index_ = 0; - }; -diff --git a/cartographer/common/internal/blocking_queue.h b/cartographer/common/internal/blocking_queue.h -index cba91c0..7e3a787 100644 ---- a/cartographer/common/internal/blocking_queue.h -+++ b/cartographer/common/internal/blocking_queue.h -@@ -47,7 +47,7 @@ class BlockingQueue { - - // Pushes a value onto the queue. Blocks if the queue is full. - void Push(T t) { -- const auto predicate = [this]() EXCLUSIVE_LOCKS_REQUIRED(mutex_) { -+ const auto predicate = [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_) { - return QueueNotFullCondition(); - }; - absl::MutexLock lock(&mutex_); -@@ -57,7 +57,7 @@ class BlockingQueue { - - // Like push, but returns false if 'timeout' is reached. - bool PushWithTimeout(T t, const common::Duration timeout) { -- const auto predicate = [this]() EXCLUSIVE_LOCKS_REQUIRED(mutex_) { -+ const auto predicate = [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_) { - return QueueNotFullCondition(); - }; - absl::MutexLock lock(&mutex_); -@@ -71,7 +71,7 @@ class BlockingQueue { - - // Pops the next value from the queue. Blocks until a value is available. - T Pop() { -- const auto predicate = [this]() EXCLUSIVE_LOCKS_REQUIRED(mutex_) { -+ const auto predicate = [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_) { - return !QueueEmptyCondition(); - }; - absl::MutexLock lock(&mutex_); -@@ -84,7 +84,7 @@ class BlockingQueue { - - // Like Pop, but can timeout. Returns nullptr in this case. - T PopWithTimeout(const common::Duration timeout) { -- const auto predicate = [this]() EXCLUSIVE_LOCKS_REQUIRED(mutex_) { -+ const auto predicate = [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_) { - return !QueueEmptyCondition(); - }; - absl::MutexLock lock(&mutex_); -@@ -100,7 +100,7 @@ class BlockingQueue { - // Like Peek, but can timeout. Returns nullptr in this case. - template - R* PeekWithTimeout(const common::Duration timeout) { -- const auto predicate = [this]() EXCLUSIVE_LOCKS_REQUIRED(mutex_) { -+ const auto predicate = [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_) { - return !QueueEmptyCondition(); - }; - absl::MutexLock lock(&mutex_); -@@ -131,7 +131,7 @@ class BlockingQueue { - - // Blocks until the queue is empty. - void WaitUntilEmpty() { -- const auto predicate = [this]() EXCLUSIVE_LOCKS_REQUIRED(mutex_) { -+ const auto predicate = [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_) { - return QueueEmptyCondition(); - }; - absl::MutexLock lock(&mutex_); -@@ -140,18 +140,18 @@ class BlockingQueue { - - private: - // Returns true iff the queue is empty. -- bool QueueEmptyCondition() EXCLUSIVE_LOCKS_REQUIRED(mutex_) { -+ bool QueueEmptyCondition() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_) { - return deque_.empty(); - } - - // Returns true iff the queue is not full. -- bool QueueNotFullCondition() EXCLUSIVE_LOCKS_REQUIRED(mutex_) { -+ bool QueueNotFullCondition() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_) { - return queue_size_ == kInfiniteQueueSize || deque_.size() < queue_size_; - } - - absl::Mutex mutex_; -- const size_t queue_size_ GUARDED_BY(mutex_); -- std::deque deque_ GUARDED_BY(mutex_); -+ const size_t queue_size_ ABSL_GUARDED_BY(mutex_); -+ std::deque deque_ ABSL_GUARDED_BY(mutex_); - }; - - } // namespace common -diff --git a/cartographer/common/internal/testing/thread_pool_for_testing.cc b/cartographer/common/internal/testing/thread_pool_for_testing.cc -index 89744ba..a4d540b 100644 ---- a/cartographer/common/internal/testing/thread_pool_for_testing.cc -+++ b/cartographer/common/internal/testing/thread_pool_for_testing.cc -@@ -72,7 +72,7 @@ std::weak_ptr ThreadPoolForTesting::Schedule(std::unique_ptr task) { - - void ThreadPoolForTesting::WaitUntilIdle() { - const auto predicate = [this]() -- EXCLUSIVE_LOCKS_REQUIRED(mutex_) { return idle_; }; -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_) { return idle_; }; - for (;;) { - { - absl::MutexLock locker(&mutex_); -@@ -85,7 +85,7 @@ void ThreadPoolForTesting::WaitUntilIdle() { - } - - void ThreadPoolForTesting::DoWork() { -- const auto predicate = [this]() EXCLUSIVE_LOCKS_REQUIRED(mutex_) { -+ const auto predicate = [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_) { - return !task_queue_.empty() || !running_; - }; - for (;;) { -diff --git a/cartographer/common/internal/testing/thread_pool_for_testing.h b/cartographer/common/internal/testing/thread_pool_for_testing.h -index f733d0f..9a10dfd 100644 ---- a/cartographer/common/internal/testing/thread_pool_for_testing.h -+++ b/cartographer/common/internal/testing/thread_pool_for_testing.h -@@ -35,7 +35,7 @@ class ThreadPoolForTesting : public ThreadPoolInterface { - ~ThreadPoolForTesting(); - - std::weak_ptr Schedule(std::unique_ptr task) -- LOCKS_EXCLUDED(mutex_) override; -+ ABSL_LOCKS_EXCLUDED(mutex_) override; - - void WaitUntilIdle(); - -@@ -44,14 +44,14 @@ class ThreadPoolForTesting : public ThreadPoolInterface { - - void DoWork(); - -- void NotifyDependenciesCompleted(Task* task) LOCKS_EXCLUDED(mutex_) override; -+ void NotifyDependenciesCompleted(Task* task) ABSL_LOCKS_EXCLUDED(mutex_) override; - - absl::Mutex mutex_; -- bool running_ GUARDED_BY(mutex_) = true; -- bool idle_ GUARDED_BY(mutex_) = true; -- std::deque> task_queue_ GUARDED_BY(mutex_); -- std::map> tasks_not_ready_ GUARDED_BY(mutex_); -- std::thread thread_ GUARDED_BY(mutex_); -+ bool running_ ABSL_GUARDED_BY(mutex_) = true; -+ bool idle_ ABSL_GUARDED_BY(mutex_) = true; -+ std::deque> task_queue_ ABSL_GUARDED_BY(mutex_); -+ std::map> tasks_not_ready_ ABSL_GUARDED_BY(mutex_); -+ std::thread thread_ ABSL_GUARDED_BY(mutex_); - }; - - } // namespace testing -diff --git a/cartographer/common/math.h b/cartographer/common/math.h -index c4a77ef..0248f66 100644 ---- a/cartographer/common/math.h -+++ b/cartographer/common/math.h -@@ -17,6 +17,10 @@ - #ifndef CARTOGRAPHER_COMMON_MATH_H_ - #define CARTOGRAPHER_COMMON_MATH_H_ - -+#ifndef M_PI -+#define M_PI 3.14159265358979323846 -+#endif -+ - #include - #include - -diff --git a/cartographer/common/task.h b/cartographer/common/task.h -index ae44fb1..4256225 100644 ---- a/cartographer/common/task.h -+++ b/cartographer/common/task.h -@@ -38,34 +38,34 @@ class Task { - Task() = default; - ~Task(); - -- State GetState() LOCKS_EXCLUDED(mutex_); -+ State GetState() ABSL_LOCKS_EXCLUDED(mutex_); - - // State must be 'NEW'. -- void SetWorkItem(const WorkItem& work_item) LOCKS_EXCLUDED(mutex_); -+ void SetWorkItem(const WorkItem& work_item) ABSL_LOCKS_EXCLUDED(mutex_); - - // State must be 'NEW'. 'dependency' may be nullptr, in which case it is - // assumed completed. -- void AddDependency(std::weak_ptr dependency) LOCKS_EXCLUDED(mutex_); -+ void AddDependency(std::weak_ptr dependency) ABSL_LOCKS_EXCLUDED(mutex_); - - private: - // Allowed in all states. - void AddDependentTask(Task* dependent_task); - - // State must be 'DEPENDENCIES_COMPLETED' and becomes 'COMPLETED'. -- void Execute() LOCKS_EXCLUDED(mutex_); -+ void Execute() ABSL_LOCKS_EXCLUDED(mutex_); - - // State must be 'NEW' and becomes 'DISPATCHED' or 'DEPENDENCIES_COMPLETED'. -- void SetThreadPool(ThreadPoolInterface* thread_pool) LOCKS_EXCLUDED(mutex_); -+ void SetThreadPool(ThreadPoolInterface* thread_pool) ABSL_LOCKS_EXCLUDED(mutex_); - - // State must be 'NEW' or 'DISPATCHED'. If 'DISPATCHED', may become - // 'DEPENDENCIES_COMPLETED'. - void OnDependenyCompleted(); - -- WorkItem work_item_ GUARDED_BY(mutex_); -- ThreadPoolInterface* thread_pool_to_notify_ GUARDED_BY(mutex_) = nullptr; -- State state_ GUARDED_BY(mutex_) = NEW; -- unsigned int uncompleted_dependencies_ GUARDED_BY(mutex_) = 0; -- std::set dependent_tasks_ GUARDED_BY(mutex_); -+ WorkItem work_item_ ABSL_GUARDED_BY(mutex_); -+ ThreadPoolInterface* thread_pool_to_notify_ ABSL_GUARDED_BY(mutex_) = nullptr; -+ State state_ ABSL_GUARDED_BY(mutex_) = NEW; -+ unsigned int uncompleted_dependencies_ ABSL_GUARDED_BY(mutex_) = 0; -+ std::set dependent_tasks_ ABSL_GUARDED_BY(mutex_); - - absl::Mutex mutex_; - }; -diff --git a/cartographer/common/thread_pool.cc b/cartographer/common/thread_pool.cc -index 2457152..f4681fa 100644 ---- a/cartographer/common/thread_pool.cc -+++ b/cartographer/common/thread_pool.cc -@@ -83,7 +83,7 @@ void ThreadPool::DoWork() { - // away CPU resources from more important foreground threads. - CHECK_NE(nice(10), -1); - #endif -- const auto predicate = [this]() EXCLUSIVE_LOCKS_REQUIRED(mutex_) { -+ const auto predicate = [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_) { - return !task_queue_.empty() || !running_; - }; - for (;;) { -diff --git a/cartographer/common/thread_pool.h b/cartographer/common/thread_pool.h -index 3f6b94c..e98311b 100644 ---- a/cartographer/common/thread_pool.h -+++ b/cartographer/common/thread_pool.h -@@ -65,19 +65,19 @@ class ThreadPool : public ThreadPoolInterface { - // When the returned weak pointer is expired, 'task' has certainly completed, - // so dependants no longer need to add it as a dependency. - std::weak_ptr Schedule(std::unique_ptr task) -- LOCKS_EXCLUDED(mutex_) override; -+ ABSL_LOCKS_EXCLUDED(mutex_) override; - - private: - void DoWork(); - -- void NotifyDependenciesCompleted(Task* task) LOCKS_EXCLUDED(mutex_) override; -+ void NotifyDependenciesCompleted(Task* task) ABSL_LOCKS_EXCLUDED(mutex_) override; - - absl::Mutex mutex_; -- bool running_ GUARDED_BY(mutex_) = true; -- std::vector pool_ GUARDED_BY(mutex_); -- std::deque> task_queue_ GUARDED_BY(mutex_); -+ bool running_ ABSL_GUARDED_BY(mutex_) = true; -+ std::vector pool_ ABSL_GUARDED_BY(mutex_); -+ std::deque> task_queue_ ABSL_GUARDED_BY(mutex_); - absl::flat_hash_map> tasks_not_ready_ -- GUARDED_BY(mutex_); -+ ABSL_GUARDED_BY(mutex_); - }; - - } // namespace common -diff --git a/cartographer/common/thread_pool_test.cc b/cartographer/common/thread_pool_test.cc -index fec82ee..6b44f32 100644 ---- a/cartographer/common/thread_pool_test.cc -+++ b/cartographer/common/thread_pool_test.cc -@@ -34,7 +34,7 @@ class Receiver { - - void WaitForNumberSequence(const std::vector& expected_numbers) { - const auto predicate = -- [this, &expected_numbers]() EXCLUSIVE_LOCKS_REQUIRED(mutex_) { -+ [this, &expected_numbers]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_) { - return (received_numbers_.size() >= expected_numbers.size()); - }; - absl::MutexLock locker(&mutex_); -@@ -43,7 +43,7 @@ class Receiver { - } - - absl::Mutex mutex_; -- std::vector received_numbers_ GUARDED_BY(mutex_); -+ std::vector received_numbers_ ABSL_GUARDED_BY(mutex_); - }; - - TEST(ThreadPoolTest, RunTask) { -diff --git a/cartographer/mapping/internal/2d/pose_graph_2d.cc b/cartographer/mapping/internal/2d/pose_graph_2d.cc -index 060277e..e912442 100644 ---- a/cartographer/mapping/internal/2d/pose_graph_2d.cc -+++ b/cartographer/mapping/internal/2d/pose_graph_2d.cc -@@ -164,7 +164,7 @@ NodeId PoseGraph2D::AddNode( - // execute the lambda. - const bool newly_finished_submap = - insertion_submaps.front()->insertion_finished(); -- AddWorkItem([=]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { - return ComputeConstraintsForNode(node_id, insertion_submaps, - newly_finished_submap); - }); -@@ -208,7 +208,7 @@ void PoseGraph2D::AddTrajectoryIfNeeded(const int trajectory_id) { - - void PoseGraph2D::AddImuData(const int trajectory_id, - const sensor::ImuData& imu_data) { -- AddWorkItem([=]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - if (CanAddWorkItemModifying(trajectory_id)) { - optimization_problem_->AddImuData(trajectory_id, imu_data); -@@ -219,7 +219,7 @@ void PoseGraph2D::AddImuData(const int trajectory_id, - - void PoseGraph2D::AddOdometryData(const int trajectory_id, - const sensor::OdometryData& odometry_data) { -- AddWorkItem([=]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - if (CanAddWorkItemModifying(trajectory_id)) { - optimization_problem_->AddOdometryData(trajectory_id, odometry_data); -@@ -231,7 +231,7 @@ void PoseGraph2D::AddOdometryData(const int trajectory_id, - void PoseGraph2D::AddFixedFramePoseData( - const int trajectory_id, - const sensor::FixedFramePoseData& fixed_frame_pose_data) { -- AddWorkItem([=]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - if (CanAddWorkItemModifying(trajectory_id)) { - optimization_problem_->AddFixedFramePoseData(trajectory_id, -@@ -243,7 +243,7 @@ void PoseGraph2D::AddFixedFramePoseData( - - void PoseGraph2D::AddLandmarkData(int trajectory_id, - const sensor::LandmarkData& landmark_data) { -- AddWorkItem([=]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - if (CanAddWorkItemModifying(trajectory_id)) { - for (const auto& observation : landmark_data.landmark_observations) { -@@ -572,7 +572,7 @@ void PoseGraph2D::WaitForAllComputations() { - // a WhenDone() callback. - { - const auto predicate = [this]() -- EXCLUSIVE_LOCKS_REQUIRED(work_queue_mutex_) { -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_queue_mutex_) { - return work_queue_ == nullptr; - }; - absl::MutexLock locker(&work_queue_mutex_); -@@ -589,13 +589,13 @@ void PoseGraph2D::WaitForAllComputations() { - constraint_builder_.WhenDone( - [this, - ¬ification](const constraints::ConstraintBuilder2D::Result& result) -- LOCKS_EXCLUDED(mutex_) { -+ ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - data_.constraints.insert(data_.constraints.end(), result.begin(), - result.end()); - notification = true; - }); -- const auto predicate = [¬ification]() EXCLUSIVE_LOCKS_REQUIRED(mutex_) { -+ const auto predicate = [¬ification]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_) { - return notification; - }; - while (!mutex_.AwaitWithTimeout(absl::Condition(&predicate), -@@ -618,7 +618,7 @@ void PoseGraph2D::DeleteTrajectory(const int trajectory_id) { - it->second.deletion_state = - InternalTrajectoryState::DeletionState::SCHEDULED_FOR_DELETION; - } -- AddWorkItem([this, trajectory_id]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([this, trajectory_id]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - CHECK(data_.trajectories_state.at(trajectory_id).state != - TrajectoryState::ACTIVE); -@@ -633,7 +633,7 @@ void PoseGraph2D::DeleteTrajectory(const int trajectory_id) { - } - - void PoseGraph2D::FinishTrajectory(const int trajectory_id) { -- AddWorkItem([this, trajectory_id]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([this, trajectory_id]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - CHECK(!IsTrajectoryFinished(trajectory_id)); - data_.trajectories_state[trajectory_id].state = TrajectoryState::FINISHED; -@@ -656,7 +656,7 @@ void PoseGraph2D::FreezeTrajectory(const int trajectory_id) { - absl::MutexLock locker(&mutex_); - data_.trajectory_connectivity_state.Add(trajectory_id); - } -- AddWorkItem([this, trajectory_id]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([this, trajectory_id]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - CHECK(!IsTrajectoryFrozen(trajectory_id)); - // Connect multiple frozen trajectories among each other. -@@ -720,7 +720,7 @@ void PoseGraph2D::AddSubmapFromProto( - } - - AddWorkItem( -- [this, submap_id, global_submap_pose_2d]() LOCKS_EXCLUDED(mutex_) { -+ [this, submap_id, global_submap_pose_2d]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - data_.submap_data.at(submap_id).state = SubmapState::kFinished; - optimization_problem_->InsertSubmap(submap_id, global_submap_pose_2d); -@@ -743,7 +743,7 @@ void PoseGraph2D::AddNodeFromProto(const transform::Rigid3d& global_pose, - TrajectoryNode{constant_data, global_pose}); - } - -- AddWorkItem([this, node_id, global_pose]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([this, node_id, global_pose]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - const auto& constant_data = - data_.trajectory_nodes.at(node_id).constant_data; -@@ -772,7 +772,7 @@ void PoseGraph2D::SetTrajectoryDataFromProto( - - const int trajectory_id = data.trajectory_id(); - AddWorkItem([this, trajectory_id, trajectory_data]() -- LOCKS_EXCLUDED(mutex_) { -+ ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - if (CanAddWorkItemModifying(trajectory_id)) { - optimization_problem_->SetTrajectoryData( -@@ -785,7 +785,7 @@ void PoseGraph2D::SetTrajectoryDataFromProto( - - void PoseGraph2D::AddNodeToSubmap(const NodeId& node_id, - const SubmapId& submap_id) { -- AddWorkItem([this, node_id, submap_id]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([this, node_id, submap_id]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - if (CanAddWorkItemModifying(submap_id.trajectory_id)) { - data_.submap_data.at(submap_id).node_ids.insert(node_id); -@@ -796,7 +796,7 @@ void PoseGraph2D::AddNodeToSubmap(const NodeId& node_id, - - void PoseGraph2D::AddSerializedConstraints( - const std::vector& constraints) { -- AddWorkItem([this, constraints]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([this, constraints]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - for (const auto& constraint : constraints) { - CHECK(data_.trajectory_nodes.Contains(constraint.node_id)); -@@ -831,7 +831,7 @@ void PoseGraph2D::AddSerializedConstraints( - void PoseGraph2D::AddTrimmer(std::unique_ptr trimmer) { - // C++11 does not allow us to move a unique_ptr into a lambda. - PoseGraphTrimmer* const trimmer_ptr = trimmer.release(); -- AddWorkItem([this, trimmer_ptr]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([this, trimmer_ptr]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - trimmers_.emplace_back(trimmer_ptr); - return WorkItem::Result::kDoNotRunOptimization; -@@ -840,13 +840,13 @@ void PoseGraph2D::AddTrimmer(std::unique_ptr trimmer) { - - void PoseGraph2D::RunFinalOptimization() { - { -- AddWorkItem([this]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([this]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - optimization_problem_->SetMaxNumIterations( - options_.max_num_final_iterations()); - return WorkItem::Result::kRunOptimization; - }); -- AddWorkItem([this]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([this]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - optimization_problem_->SetMaxNumIterations( - options_.optimization_problem_options() -@@ -985,7 +985,7 @@ std::map PoseGraph2D::GetLandmarkPoses() - void PoseGraph2D::SetLandmarkPose(const std::string& landmark_id, - const transform::Rigid3d& global_pose, - const bool frozen) { -- AddWorkItem([=]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - data_.landmark_nodes[landmark_id].global_landmark_pose = global_pose; - data_.landmark_nodes[landmark_id].frozen = frozen; -diff --git a/cartographer/mapping/internal/2d/pose_graph_2d.h b/cartographer/mapping/internal/2d/pose_graph_2d.h -index 3733425..a90174b 100644 ---- a/cartographer/mapping/internal/2d/pose_graph_2d.h -+++ b/cartographer/mapping/internal/2d/pose_graph_2d.h -@@ -81,28 +81,28 @@ class PoseGraph2D : public PoseGraph { - std::shared_ptr constant_data, - int trajectory_id, - const std::vector>& insertion_submaps) -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - - void AddImuData(int trajectory_id, const sensor::ImuData& imu_data) override -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - void AddOdometryData(int trajectory_id, - const sensor::OdometryData& odometry_data) override -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - void AddFixedFramePoseData( - int trajectory_id, - const sensor::FixedFramePoseData& fixed_frame_pose_data) override -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - void AddLandmarkData(int trajectory_id, - const sensor::LandmarkData& landmark_data) override -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - - void DeleteTrajectory(int trajectory_id) override; - void FinishTrajectory(int trajectory_id) override; - bool IsTrajectoryFinished(int trajectory_id) const override -- EXCLUSIVE_LOCKS_REQUIRED(mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); - void FreezeTrajectory(int trajectory_id) override; - bool IsTrajectoryFrozen(int trajectory_id) const override -- EXCLUSIVE_LOCKS_REQUIRED(mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); - void AddSubmapFromProto(const transform::Rigid3d& global_submap_pose, - const proto::Submap& submap) override; - void AddNodeFromProto(const transform::Rigid3d& global_pose, -@@ -115,61 +115,61 @@ class PoseGraph2D : public PoseGraph { - void AddTrimmer(std::unique_ptr trimmer) override; - void RunFinalOptimization() override; - std::vector> GetConnectedTrajectories() const override -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - PoseGraphInterface::SubmapData GetSubmapData(const SubmapId& submap_id) const -- LOCKS_EXCLUDED(mutex_) override; -+ ABSL_LOCKS_EXCLUDED(mutex_) override; - MapById GetAllSubmapData() const -- LOCKS_EXCLUDED(mutex_) override; -+ ABSL_LOCKS_EXCLUDED(mutex_) override; - MapById GetAllSubmapPoses() const -- LOCKS_EXCLUDED(mutex_) override; -+ ABSL_LOCKS_EXCLUDED(mutex_) override; - transform::Rigid3d GetLocalToGlobalTransform(int trajectory_id) const -- LOCKS_EXCLUDED(mutex_) override; -+ ABSL_LOCKS_EXCLUDED(mutex_) override; - MapById GetTrajectoryNodes() const override -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - MapById GetTrajectoryNodePoses() const override -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - std::map GetTrajectoryStates() const override -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - std::map GetLandmarkPoses() const override -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - void SetLandmarkPose(const std::string& landmark_id, - const transform::Rigid3d& global_pose, - const bool frozen = false) override -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - sensor::MapByTime GetImuData() const override -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - sensor::MapByTime GetOdometryData() const override -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - sensor::MapByTime GetFixedFramePoseData() -- const override LOCKS_EXCLUDED(mutex_); -+ const override ABSL_LOCKS_EXCLUDED(mutex_); - std::map -- GetLandmarkNodes() const override LOCKS_EXCLUDED(mutex_); -+ GetLandmarkNodes() const override ABSL_LOCKS_EXCLUDED(mutex_); - std::map GetTrajectoryData() const override -- LOCKS_EXCLUDED(mutex_); -- std::vector constraints() const override LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); -+ std::vector constraints() const override ABSL_LOCKS_EXCLUDED(mutex_); - void SetInitialTrajectoryPose(int from_trajectory_id, int to_trajectory_id, - const transform::Rigid3d& pose, - const common::Time time) override -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - void SetGlobalSlamOptimizationCallback( - PoseGraphInterface::GlobalSlamOptimizationCallback callback) override; - transform::Rigid3d GetInterpolatedGlobalTrajectoryPose( - int trajectory_id, const common::Time time) const -- EXCLUSIVE_LOCKS_REQUIRED(mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); - - static void RegisterMetrics(metrics::FamilyFactory* family_factory); - - private: - MapById GetSubmapDataUnderLock() -- const EXCLUSIVE_LOCKS_REQUIRED(mutex_); -+ const ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); - - // Handles a new work item. - void AddWorkItem(const std::function& work_item) -- LOCKS_EXCLUDED(mutex_) LOCKS_EXCLUDED(work_queue_mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_) ABSL_LOCKS_EXCLUDED(work_queue_mutex_); - - // Adds connectivity and sampler for a trajectory if it does not exist. - void AddTrajectoryIfNeeded(int trajectory_id) -- EXCLUSIVE_LOCKS_REQUIRED(mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); - - // Appends the new node and submap (if needed) to the internal data - // structures. -@@ -177,66 +177,66 @@ class PoseGraph2D : public PoseGraph { - std::shared_ptr constant_data, - int trajectory_id, - const std::vector>& insertion_submaps, -- const transform::Rigid3d& optimized_pose) LOCKS_EXCLUDED(mutex_); -+ const transform::Rigid3d& optimized_pose) ABSL_LOCKS_EXCLUDED(mutex_); - - // Grows the optimization problem to have an entry for every element of - // 'insertion_submaps'. Returns the IDs for the 'insertion_submaps'. - std::vector InitializeGlobalSubmapPoses( - int trajectory_id, const common::Time time, - const std::vector>& insertion_submaps) -- EXCLUSIVE_LOCKS_REQUIRED(mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); - - // Adds constraints for a node, and starts scan matching in the background. - WorkItem::Result ComputeConstraintsForNode( - const NodeId& node_id, - std::vector> insertion_submaps, -- bool newly_finished_submap) LOCKS_EXCLUDED(mutex_); -+ bool newly_finished_submap) ABSL_LOCKS_EXCLUDED(mutex_); - - // Computes constraints for a node and submap pair. - void ComputeConstraint(const NodeId& node_id, const SubmapId& submap_id) -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - - // Deletes trajectories waiting for deletion. Must not be called during - // constraint search. -- void DeleteTrajectoriesIfNeeded() EXCLUSIVE_LOCKS_REQUIRED(mutex_); -+ void DeleteTrajectoriesIfNeeded() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); - - // Runs the optimization, executes the trimmers and processes the work queue. - void HandleWorkQueue(const constraints::ConstraintBuilder2D::Result& result) -- LOCKS_EXCLUDED(mutex_) LOCKS_EXCLUDED(work_queue_mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_) ABSL_LOCKS_EXCLUDED(work_queue_mutex_); - - // Process pending tasks in the work queue on the calling thread, until the - // queue is either empty or an optimization is required. -- void DrainWorkQueue() LOCKS_EXCLUDED(mutex_) -- LOCKS_EXCLUDED(work_queue_mutex_); -+ void DrainWorkQueue() ABSL_LOCKS_EXCLUDED(mutex_) -+ ABSL_LOCKS_EXCLUDED(work_queue_mutex_); - - // Waits until we caught up (i.e. nothing is waiting to be scheduled), and - // all computations have finished. -- void WaitForAllComputations() LOCKS_EXCLUDED(mutex_) -- LOCKS_EXCLUDED(work_queue_mutex_); -+ void WaitForAllComputations() ABSL_LOCKS_EXCLUDED(mutex_) -+ ABSL_LOCKS_EXCLUDED(work_queue_mutex_); - - // Runs the optimization. Callers have to make sure, that there is only one - // optimization being run at a time. -- void RunOptimization() LOCKS_EXCLUDED(mutex_); -+ void RunOptimization() ABSL_LOCKS_EXCLUDED(mutex_); - - bool CanAddWorkItemModifying(int trajectory_id) -- EXCLUSIVE_LOCKS_REQUIRED(mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); - - // Computes the local to global map frame transform based on the given - // 'global_submap_poses'. - transform::Rigid3d ComputeLocalToGlobalTransform( - const MapById& global_submap_poses, -- int trajectory_id) const EXCLUSIVE_LOCKS_REQUIRED(mutex_); -+ int trajectory_id) const ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); - - SubmapData GetSubmapDataUnderLock(const SubmapId& submap_id) const -- EXCLUSIVE_LOCKS_REQUIRED(mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); - - common::Time GetLatestNodeTime(const NodeId& node_id, - const SubmapId& submap_id) const -- EXCLUSIVE_LOCKS_REQUIRED(mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); - - // Updates the trajectory connectivity structure with a new constraint. - void UpdateTrajectoryConnectivity(const Constraint& constraint) -- EXCLUSIVE_LOCKS_REQUIRED(mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); - - const proto::PoseGraphOptions options_; - GlobalSlamOptimizationCallback global_slam_optimization_callback_; -@@ -245,14 +245,14 @@ class PoseGraph2D : public PoseGraph { - - // If it exists, further work items must be added to this queue, and will be - // considered later. -- std::unique_ptr work_queue_ GUARDED_BY(work_queue_mutex_); -+ std::unique_ptr work_queue_ ABSL_GUARDED_BY(work_queue_mutex_); - - // We globally localize a fraction of the nodes from each trajectory. - absl::flat_hash_map> -- global_localization_samplers_ GUARDED_BY(mutex_); -+ global_localization_samplers_ ABSL_GUARDED_BY(mutex_); - - // Number of nodes added since last loop closure. -- int num_nodes_since_last_loop_closure_ GUARDED_BY(mutex_) = 0; -+ int num_nodes_since_last_loop_closure_ ABSL_GUARDED_BY(mutex_) = 0; - - // Current optimization problem. - std::unique_ptr optimization_problem_; -@@ -262,9 +262,9 @@ class PoseGraph2D : public PoseGraph { - common::ThreadPool* const thread_pool_; - - // List of all trimmers to consult when optimizations finish. -- std::vector> trimmers_ GUARDED_BY(mutex_); -+ std::vector> trimmers_ ABSL_GUARDED_BY(mutex_); - -- PoseGraphData data_ GUARDED_BY(mutex_); -+ PoseGraphData data_ ABSL_GUARDED_BY(mutex_); - - ValueConversionTables conversion_tables_; - -@@ -278,17 +278,17 @@ class PoseGraph2D : public PoseGraph { - int num_submaps(int trajectory_id) const override; - std::vector GetSubmapIds(int trajectory_id) const override; - MapById GetOptimizedSubmapData() const override -- EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); - const MapById& GetTrajectoryNodes() const override -- EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); - const std::vector& GetConstraints() const override -- EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); - void TrimSubmap(const SubmapId& submap_id) -- EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_) override; -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_) override; - bool IsFinished(int trajectory_id) const override -- EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); - void SetTrajectoryState(int trajectory_id, TrajectoryState state) override -- EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); - - private: - PoseGraph2D* const parent_; -diff --git a/cartographer/mapping/internal/3d/pose_graph_3d.cc b/cartographer/mapping/internal/3d/pose_graph_3d.cc -index 8a91e59..26a8677 100644 ---- a/cartographer/mapping/internal/3d/pose_graph_3d.cc -+++ b/cartographer/mapping/internal/3d/pose_graph_3d.cc -@@ -152,7 +152,7 @@ NodeId PoseGraph3D::AddNode( - // execute the lambda. - const bool newly_finished_submap = - insertion_submaps.front()->insertion_finished(); -- AddWorkItem([=]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { - return ComputeConstraintsForNode(node_id, insertion_submaps, - newly_finished_submap); - }); -@@ -196,7 +196,7 @@ void PoseGraph3D::AddTrajectoryIfNeeded(const int trajectory_id) { - - void PoseGraph3D::AddImuData(const int trajectory_id, - const sensor::ImuData& imu_data) { -- AddWorkItem([=]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - if (CanAddWorkItemModifying(trajectory_id)) { - optimization_problem_->AddImuData(trajectory_id, imu_data); -@@ -207,7 +207,7 @@ void PoseGraph3D::AddImuData(const int trajectory_id, - - void PoseGraph3D::AddOdometryData(const int trajectory_id, - const sensor::OdometryData& odometry_data) { -- AddWorkItem([=]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - if (CanAddWorkItemModifying(trajectory_id)) { - optimization_problem_->AddOdometryData(trajectory_id, odometry_data); -@@ -219,7 +219,7 @@ void PoseGraph3D::AddOdometryData(const int trajectory_id, - void PoseGraph3D::AddFixedFramePoseData( - const int trajectory_id, - const sensor::FixedFramePoseData& fixed_frame_pose_data) { -- AddWorkItem([=]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - if (CanAddWorkItemModifying(trajectory_id)) { - optimization_problem_->AddFixedFramePoseData(trajectory_id, -@@ -231,7 +231,7 @@ void PoseGraph3D::AddFixedFramePoseData( - - void PoseGraph3D::AddLandmarkData(int trajectory_id, - const sensor::LandmarkData& landmark_data) { -- AddWorkItem([=]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - if (CanAddWorkItemModifying(trajectory_id)) { - for (const auto& observation : landmark_data.landmark_observations) { -@@ -559,7 +559,7 @@ void PoseGraph3D::WaitForAllComputations() { - // a WhenDone() callback. - { - const auto predicate = [this]() -- EXCLUSIVE_LOCKS_REQUIRED(work_queue_mutex_) { -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_queue_mutex_) { - return work_queue_ == nullptr; - }; - absl::MutexLock locker(&work_queue_mutex_); -@@ -576,13 +576,13 @@ void PoseGraph3D::WaitForAllComputations() { - constraint_builder_.WhenDone( - [this, - ¬ification](const constraints::ConstraintBuilder3D::Result& result) -- LOCKS_EXCLUDED(mutex_) { -+ ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - data_.constraints.insert(data_.constraints.end(), result.begin(), - result.end()); - notification = true; - }); -- const auto predicate = [¬ification]() EXCLUSIVE_LOCKS_REQUIRED(mutex_) { -+ const auto predicate = [¬ification]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_) { - return notification; - }; - while (!mutex_.AwaitWithTimeout(absl::Condition(&predicate), -@@ -605,7 +605,7 @@ void PoseGraph3D::DeleteTrajectory(const int trajectory_id) { - it->second.deletion_state = - InternalTrajectoryState::DeletionState::SCHEDULED_FOR_DELETION; - } -- AddWorkItem([this, trajectory_id]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([this, trajectory_id]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - CHECK(data_.trajectories_state.at(trajectory_id).state != - TrajectoryState::ACTIVE); -@@ -620,7 +620,7 @@ void PoseGraph3D::DeleteTrajectory(const int trajectory_id) { - } - - void PoseGraph3D::FinishTrajectory(const int trajectory_id) { -- AddWorkItem([this, trajectory_id]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([this, trajectory_id]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - CHECK(!IsTrajectoryFinished(trajectory_id)); - data_.trajectories_state[trajectory_id].state = TrajectoryState::FINISHED; -@@ -643,7 +643,7 @@ void PoseGraph3D::FreezeTrajectory(const int trajectory_id) { - absl::MutexLock locker(&mutex_); - data_.trajectory_connectivity_state.Add(trajectory_id); - } -- AddWorkItem([this, trajectory_id]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([this, trajectory_id]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - CHECK(!IsTrajectoryFrozen(trajectory_id)); - // Connect multiple frozen trajectories among each other. -@@ -703,7 +703,7 @@ void PoseGraph3D::AddSubmapFromProto( - kActiveSubmapsMetric->Increment(); - } - -- AddWorkItem([this, submap_id, global_submap_pose]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([this, submap_id, global_submap_pose]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - data_.submap_data.at(submap_id).state = SubmapState::kFinished; - optimization_problem_->InsertSubmap(submap_id, global_submap_pose); -@@ -726,7 +726,7 @@ void PoseGraph3D::AddNodeFromProto(const transform::Rigid3d& global_pose, - TrajectoryNode{constant_data, global_pose}); - } - -- AddWorkItem([this, node_id, global_pose]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([this, node_id, global_pose]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - const auto& constant_data = - data_.trajectory_nodes.at(node_id).constant_data; -@@ -751,7 +751,7 @@ void PoseGraph3D::SetTrajectoryDataFromProto( - } - - const int trajectory_id = data.trajectory_id(); -- AddWorkItem([this, trajectory_id, trajectory_data]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([this, trajectory_id, trajectory_data]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - if (CanAddWorkItemModifying(trajectory_id)) { - optimization_problem_->SetTrajectoryData(trajectory_id, trajectory_data); -@@ -762,7 +762,7 @@ void PoseGraph3D::SetTrajectoryDataFromProto( - - void PoseGraph3D::AddNodeToSubmap(const NodeId& node_id, - const SubmapId& submap_id) { -- AddWorkItem([this, node_id, submap_id]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([this, node_id, submap_id]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - if (CanAddWorkItemModifying(submap_id.trajectory_id)) { - data_.submap_data.at(submap_id).node_ids.insert(node_id); -@@ -773,7 +773,7 @@ void PoseGraph3D::AddNodeToSubmap(const NodeId& node_id, - - void PoseGraph3D::AddSerializedConstraints( - const std::vector& constraints) { -- AddWorkItem([this, constraints]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([this, constraints]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - for (const auto& constraint : constraints) { - CHECK(data_.trajectory_nodes.Contains(constraint.node_id)); -@@ -801,7 +801,7 @@ void PoseGraph3D::AddSerializedConstraints( - void PoseGraph3D::AddTrimmer(std::unique_ptr trimmer) { - // C++11 does not allow us to move a unique_ptr into a lambda. - PoseGraphTrimmer* const trimmer_ptr = trimmer.release(); -- AddWorkItem([this, trimmer_ptr]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([this, trimmer_ptr]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - trimmers_.emplace_back(trimmer_ptr); - return WorkItem::Result::kDoNotRunOptimization; -@@ -810,13 +810,13 @@ void PoseGraph3D::AddTrimmer(std::unique_ptr trimmer) { - - void PoseGraph3D::RunFinalOptimization() { - { -- AddWorkItem([this]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([this]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - optimization_problem_->SetMaxNumIterations( - options_.max_num_final_iterations()); - return WorkItem::Result::kRunOptimization; - }); -- AddWorkItem([this]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([this]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - optimization_problem_->SetMaxNumIterations( - options_.optimization_problem_options() -@@ -982,7 +982,7 @@ std::map PoseGraph3D::GetLandmarkPoses() - void PoseGraph3D::SetLandmarkPose(const std::string& landmark_id, - const transform::Rigid3d& global_pose, - const bool frozen) { -- AddWorkItem([=]() LOCKS_EXCLUDED(mutex_) { -+ AddWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { - absl::MutexLock locker(&mutex_); - data_.landmark_nodes[landmark_id].global_landmark_pose = global_pose; - data_.landmark_nodes[landmark_id].frozen = frozen; -diff --git a/cartographer/mapping/internal/3d/pose_graph_3d.h b/cartographer/mapping/internal/3d/pose_graph_3d.h -index 12a3469..f38f20a 100644 ---- a/cartographer/mapping/internal/3d/pose_graph_3d.h -+++ b/cartographer/mapping/internal/3d/pose_graph_3d.h -@@ -79,28 +79,28 @@ class PoseGraph3D : public PoseGraph { - std::shared_ptr constant_data, - int trajectory_id, - const std::vector>& insertion_submaps) -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - - void AddImuData(int trajectory_id, const sensor::ImuData& imu_data) override -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - void AddOdometryData(int trajectory_id, - const sensor::OdometryData& odometry_data) override -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - void AddFixedFramePoseData( - int trajectory_id, - const sensor::FixedFramePoseData& fixed_frame_pose_data) override -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - void AddLandmarkData(int trajectory_id, - const sensor::LandmarkData& landmark_data) override -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - - void DeleteTrajectory(int trajectory_id) override; - void FinishTrajectory(int trajectory_id) override; - bool IsTrajectoryFinished(int trajectory_id) const override -- EXCLUSIVE_LOCKS_REQUIRED(mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); - void FreezeTrajectory(int trajectory_id) override; - bool IsTrajectoryFrozen(int trajectory_id) const override -- EXCLUSIVE_LOCKS_REQUIRED(mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); - void AddSubmapFromProto(const transform::Rigid3d& global_submap_pose, - const proto::Submap& submap) override; - void AddNodeFromProto(const transform::Rigid3d& global_pose, -@@ -113,132 +113,132 @@ class PoseGraph3D : public PoseGraph { - void AddTrimmer(std::unique_ptr trimmer) override; - void RunFinalOptimization() override; - std::vector> GetConnectedTrajectories() const override -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - PoseGraph::SubmapData GetSubmapData(const SubmapId& submap_id) const -- LOCKS_EXCLUDED(mutex_) override; -+ ABSL_LOCKS_EXCLUDED(mutex_) override; - MapById GetAllSubmapData() const -- LOCKS_EXCLUDED(mutex_) override; -+ ABSL_LOCKS_EXCLUDED(mutex_) override; - MapById GetAllSubmapPoses() const -- LOCKS_EXCLUDED(mutex_) override; -+ ABSL_LOCKS_EXCLUDED(mutex_) override; - transform::Rigid3d GetLocalToGlobalTransform(int trajectory_id) const -- LOCKS_EXCLUDED(mutex_) override; -+ ABSL_LOCKS_EXCLUDED(mutex_) override; - MapById GetTrajectoryNodes() const override -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - MapById GetTrajectoryNodePoses() const override -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - std::map GetTrajectoryStates() const override -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - std::map GetLandmarkPoses() const override -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - void SetLandmarkPose(const std::string& landmark_id, - const transform::Rigid3d& global_pose, - const bool frozen = false) override -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - sensor::MapByTime GetImuData() const override -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - sensor::MapByTime GetOdometryData() const override -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - sensor::MapByTime GetFixedFramePoseData() -- const override LOCKS_EXCLUDED(mutex_); -+ const override ABSL_LOCKS_EXCLUDED(mutex_); - std::map -- GetLandmarkNodes() const override LOCKS_EXCLUDED(mutex_); -+ GetLandmarkNodes() const override ABSL_LOCKS_EXCLUDED(mutex_); - std::map GetTrajectoryData() const override; - -- std::vector constraints() const override LOCKS_EXCLUDED(mutex_); -+ std::vector constraints() const override ABSL_LOCKS_EXCLUDED(mutex_); - void SetInitialTrajectoryPose(int from_trajectory_id, int to_trajectory_id, - const transform::Rigid3d& pose, - const common::Time time) override -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - void SetGlobalSlamOptimizationCallback( - PoseGraphInterface::GlobalSlamOptimizationCallback callback) override; - transform::Rigid3d GetInterpolatedGlobalTrajectoryPose( - int trajectory_id, const common::Time time) const -- EXCLUSIVE_LOCKS_REQUIRED(mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); - - static void RegisterMetrics(metrics::FamilyFactory* family_factory); - - protected: - // Waits until we caught up (i.e. nothing is waiting to be scheduled), and - // all computations have finished. -- void WaitForAllComputations() LOCKS_EXCLUDED(mutex_) -- LOCKS_EXCLUDED(work_queue_mutex_); -+ void WaitForAllComputations() ABSL_LOCKS_EXCLUDED(mutex_) -+ ABSL_LOCKS_EXCLUDED(work_queue_mutex_); - - private: - MapById GetSubmapDataUnderLock() const -- EXCLUSIVE_LOCKS_REQUIRED(mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); - - // Handles a new work item. - void AddWorkItem(const std::function& work_item) -- LOCKS_EXCLUDED(mutex_) LOCKS_EXCLUDED(work_queue_mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_) ABSL_LOCKS_EXCLUDED(work_queue_mutex_); - - // Adds connectivity and sampler for a trajectory if it does not exist. - void AddTrajectoryIfNeeded(int trajectory_id) -- EXCLUSIVE_LOCKS_REQUIRED(mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); - - // Appends the new node and submap (if needed) to the internal data stuctures. - NodeId AppendNode( - std::shared_ptr constant_data, - int trajectory_id, - const std::vector>& insertion_submaps, -- const transform::Rigid3d& optimized_pose) LOCKS_EXCLUDED(mutex_); -+ const transform::Rigid3d& optimized_pose) ABSL_LOCKS_EXCLUDED(mutex_); - - // Grows the optimization problem to have an entry for every element of - // 'insertion_submaps'. Returns the IDs for the 'insertion_submaps'. - std::vector InitializeGlobalSubmapPoses( - int trajectory_id, const common::Time time, - const std::vector>& insertion_submaps) -- EXCLUSIVE_LOCKS_REQUIRED(mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); - - // Adds constraints for a node, and starts scan matching in the background. - WorkItem::Result ComputeConstraintsForNode( - const NodeId& node_id, - std::vector> insertion_submaps, -- bool newly_finished_submap) LOCKS_EXCLUDED(mutex_); -+ bool newly_finished_submap) ABSL_LOCKS_EXCLUDED(mutex_); - - // Computes constraints for a node and submap pair. - void ComputeConstraint(const NodeId& node_id, const SubmapId& submap_id) -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - - // Deletes trajectories waiting for deletion. Must not be called during - // constraint search. -- void DeleteTrajectoriesIfNeeded() EXCLUSIVE_LOCKS_REQUIRED(mutex_); -+ void DeleteTrajectoriesIfNeeded() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); - - // Runs the optimization, executes the trimmers and processes the work queue. - void HandleWorkQueue(const constraints::ConstraintBuilder3D::Result& result) -- LOCKS_EXCLUDED(mutex_) LOCKS_EXCLUDED(work_queue_mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_) ABSL_LOCKS_EXCLUDED(work_queue_mutex_); - - // Process pending tasks in the work queue on the calling thread, until the - // queue is either empty or an optimization is required. -- void DrainWorkQueue() LOCKS_EXCLUDED(mutex_) -- LOCKS_EXCLUDED(work_queue_mutex_); -+ void DrainWorkQueue() ABSL_LOCKS_EXCLUDED(mutex_) -+ ABSL_LOCKS_EXCLUDED(work_queue_mutex_); - - // Runs the optimization. Callers have to make sure, that there is only one - // optimization being run at a time. -- void RunOptimization() LOCKS_EXCLUDED(mutex_); -+ void RunOptimization() ABSL_LOCKS_EXCLUDED(mutex_); - - bool CanAddWorkItemModifying(int trajectory_id) -- EXCLUSIVE_LOCKS_REQUIRED(mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); - - // Computes the local to global map frame transform based on the given - // 'global_submap_poses'. - transform::Rigid3d ComputeLocalToGlobalTransform( - const MapById& global_submap_poses, -- int trajectory_id) const EXCLUSIVE_LOCKS_REQUIRED(mutex_); -+ int trajectory_id) const ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); - - PoseGraph::SubmapData GetSubmapDataUnderLock(const SubmapId& submap_id) const -- EXCLUSIVE_LOCKS_REQUIRED(mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); - - common::Time GetLatestNodeTime(const NodeId& node_id, - const SubmapId& submap_id) const -- EXCLUSIVE_LOCKS_REQUIRED(mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); - - // Logs histograms for the translational and rotational residual of node - // poses. -- void LogResidualHistograms() const EXCLUSIVE_LOCKS_REQUIRED(mutex_); -+ void LogResidualHistograms() const ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); - - // Updates the trajectory connectivity structure with a new constraint. - void UpdateTrajectoryConnectivity(const Constraint& constraint) -- EXCLUSIVE_LOCKS_REQUIRED(mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); - - const proto::PoseGraphOptions options_; - GlobalSlamOptimizationCallback global_slam_optimization_callback_; -@@ -247,14 +247,14 @@ class PoseGraph3D : public PoseGraph { - - // If it exists, further work items must be added to this queue, and will be - // considered later. -- std::unique_ptr work_queue_ GUARDED_BY(work_queue_mutex_); -+ std::unique_ptr work_queue_ ABSL_GUARDED_BY(work_queue_mutex_); - - // We globally localize a fraction of the nodes from each trajectory. - absl::flat_hash_map> -- global_localization_samplers_ GUARDED_BY(mutex_); -+ global_localization_samplers_ ABSL_GUARDED_BY(mutex_); - - // Number of nodes added since last loop closure. -- int num_nodes_since_last_loop_closure_ GUARDED_BY(mutex_) = 0; -+ int num_nodes_since_last_loop_closure_ ABSL_GUARDED_BY(mutex_) = 0; - - // Current optimization problem. - std::unique_ptr optimization_problem_; -@@ -264,9 +264,9 @@ class PoseGraph3D : public PoseGraph { - common::ThreadPool* const thread_pool_; - - // List of all trimmers to consult when optimizations finish. -- std::vector> trimmers_ GUARDED_BY(mutex_); -+ std::vector> trimmers_ ABSL_GUARDED_BY(mutex_); - -- PoseGraphData data_ GUARDED_BY(mutex_); -+ PoseGraphData data_ ABSL_GUARDED_BY(mutex_); - - // Allows querying and manipulating the pose graph by the 'trimmers_'. The - // 'mutex_' of the pose graph is held while this class is used. -@@ -278,18 +278,18 @@ class PoseGraph3D : public PoseGraph { - int num_submaps(int trajectory_id) const override; - std::vector GetSubmapIds(int trajectory_id) const override; - MapById GetOptimizedSubmapData() const override -- EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); - const MapById& GetTrajectoryNodes() const override -- EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); - const std::vector& GetConstraints() const override -- EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); - void TrimSubmap(const SubmapId& submap_id) -- EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_) override; -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_) override; - bool IsFinished(int trajectory_id) const override -- EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); - - void SetTrajectoryState(int trajectory_id, TrajectoryState state) override -- EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->mutex_); - - private: - PoseGraph3D* const parent_; -diff --git a/cartographer/mapping/internal/connected_components.h b/cartographer/mapping/internal/connected_components.h -index 05f327e..bc9cb69 100644 ---- a/cartographer/mapping/internal/connected_components.h -+++ b/cartographer/mapping/internal/connected_components.h -@@ -41,45 +41,45 @@ class ConnectedComponents { - ConnectedComponents& operator=(const ConnectedComponents&) = delete; - - // Add a trajectory which is initially connected to only itself. -- void Add(int trajectory_id) LOCKS_EXCLUDED(lock_); -+ void Add(int trajectory_id) ABSL_LOCKS_EXCLUDED(lock_); - - // Connect two trajectories. If either trajectory is untracked, it will be - // tracked. This function is invariant to the order of its arguments. Repeated - // calls to Connect increment the connectivity count. -- void Connect(int trajectory_id_a, int trajectory_id_b) LOCKS_EXCLUDED(lock_); -+ void Connect(int trajectory_id_a, int trajectory_id_b) ABSL_LOCKS_EXCLUDED(lock_); - - // Determines if two trajectories have been (transitively) connected. If - // either trajectory is not being tracked, returns false, except when it is - // the same trajectory, where it returns true. This function is invariant to - // the order of its arguments. - bool TransitivelyConnected(int trajectory_id_a, int trajectory_id_b) -- LOCKS_EXCLUDED(lock_); -+ ABSL_LOCKS_EXCLUDED(lock_); - - // Return the number of _direct_ connections between 'trajectory_id_a' and - // 'trajectory_id_b'. If either trajectory is not being tracked, returns 0. - // This function is invariant to the order of its arguments. - int ConnectionCount(int trajectory_id_a, int trajectory_id_b) -- LOCKS_EXCLUDED(lock_); -+ ABSL_LOCKS_EXCLUDED(lock_); - - // The trajectory IDs, grouped by connectivity. -- std::vector> Components() LOCKS_EXCLUDED(lock_); -+ std::vector> Components() ABSL_LOCKS_EXCLUDED(lock_); - - // The list of trajectory IDs that belong to the same connected component as - // 'trajectory_id'. -- std::vector GetComponent(int trajectory_id) LOCKS_EXCLUDED(lock_); -+ std::vector GetComponent(int trajectory_id) ABSL_LOCKS_EXCLUDED(lock_); - - private: - // Find the representative and compresses the path to it. -- int FindSet(int trajectory_id) EXCLUSIVE_LOCKS_REQUIRED(lock_); -+ int FindSet(int trajectory_id) ABSL_EXCLUSIVE_LOCKS_REQUIRED(lock_); - void Union(int trajectory_id_a, int trajectory_id_b) -- EXCLUSIVE_LOCKS_REQUIRED(lock_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(lock_); - - absl::Mutex lock_; - // Tracks transitive connectivity using a disjoint set forest, i.e. each - // entry points towards the representative for the given trajectory. -- std::map forest_ GUARDED_BY(lock_); -+ std::map forest_ ABSL_GUARDED_BY(lock_); - // Tracks the number of direct connections between a pair of trajectories. -- std::map, int> connection_map_ GUARDED_BY(lock_); -+ std::map, int> connection_map_ ABSL_GUARDED_BY(lock_); - }; - - // Returns a proto encoding connected components. -diff --git a/cartographer/mapping/internal/constraints/constraint_builder_2d.cc b/cartographer/mapping/internal/constraints/constraint_builder_2d.cc -index ad3dfb7..32c88a4 100644 ---- a/cartographer/mapping/internal/constraints/constraint_builder_2d.cc -+++ b/cartographer/mapping/internal/constraints/constraint_builder_2d.cc -@@ -100,7 +100,7 @@ void ConstraintBuilder2D::MaybeAddConstraint( - const auto* scan_matcher = - DispatchScanMatcherConstruction(submap_id, submap->grid()); - auto constraint_task = absl::make_unique(); -- constraint_task->SetWorkItem([=]() LOCKS_EXCLUDED(mutex_) { -+ constraint_task->SetWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { - ComputeConstraint(submap_id, submap, node_id, false, /* match_full_submap */ - constant_data, initial_relative_pose, *scan_matcher, - constraint); -@@ -125,7 +125,7 @@ void ConstraintBuilder2D::MaybeAddGlobalConstraint( - const auto* scan_matcher = - DispatchScanMatcherConstruction(submap_id, submap->grid()); - auto constraint_task = absl::make_unique(); -- constraint_task->SetWorkItem([=]() LOCKS_EXCLUDED(mutex_) { -+ constraint_task->SetWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { - ComputeConstraint(submap_id, submap, node_id, true, /* match_full_submap */ - constant_data, transform::Rigid2d::Identity(), - *scan_matcher, constraint); -diff --git a/cartographer/mapping/internal/constraints/constraint_builder_2d.h b/cartographer/mapping/internal/constraints/constraint_builder_2d.h -index 6667fdb..b61f64c 100644 ---- a/cartographer/mapping/internal/constraints/constraint_builder_2d.h -+++ b/cartographer/mapping/internal/constraints/constraint_builder_2d.h -@@ -118,7 +118,7 @@ class ConstraintBuilder2D { - // accessed after 'creation_task_handle' has completed. - const SubmapScanMatcher* DispatchScanMatcherConstruction( - const SubmapId& submap_id, const Grid2D* grid) -- EXCLUSIVE_LOCKS_REQUIRED(mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); - - // Runs in a background thread and does computations for an additional - // constraint, assuming 'submap' and 'compressed_point_cloud' do not change -@@ -129,9 +129,9 @@ class ConstraintBuilder2D { - const transform::Rigid2d& initial_relative_pose, - const SubmapScanMatcher& submap_scan_matcher, - std::unique_ptr* constraint) -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - -- void RunWhenDoneCallback() LOCKS_EXCLUDED(mutex_); -+ void RunWhenDoneCallback() ABSL_LOCKS_EXCLUDED(mutex_); - - const constraints::proto::ConstraintBuilderOptions options_; - common::ThreadPoolInterface* thread_pool_; -@@ -139,34 +139,34 @@ class ConstraintBuilder2D { - - // 'callback' set by WhenDone(). - std::unique_ptr> when_done_ -- GUARDED_BY(mutex_); -+ ABSL_GUARDED_BY(mutex_); - - // TODO(gaschler): Use atomics instead of mutex to access these counters. - // Number of the node in reaction to which computations are currently - // added. This is always the number of nodes seen so far, even when older - // nodes are matched against a new submap. -- int num_started_nodes_ GUARDED_BY(mutex_) = 0; -+ int num_started_nodes_ ABSL_GUARDED_BY(mutex_) = 0; - -- int num_finished_nodes_ GUARDED_BY(mutex_) = 0; -+ int num_finished_nodes_ ABSL_GUARDED_BY(mutex_) = 0; - -- std::unique_ptr finish_node_task_ GUARDED_BY(mutex_); -+ std::unique_ptr finish_node_task_ ABSL_GUARDED_BY(mutex_); - -- std::unique_ptr when_done_task_ GUARDED_BY(mutex_); -+ std::unique_ptr when_done_task_ ABSL_GUARDED_BY(mutex_); - - // Constraints currently being computed in the background. A deque is used to - // keep pointers valid when adding more entries. Constraint search results - // with below-threshold scores are also 'nullptr'. -- std::deque> constraints_ GUARDED_BY(mutex_); -+ std::deque> constraints_ ABSL_GUARDED_BY(mutex_); - - // Map of dispatched or constructed scan matchers by 'submap_id'. - std::map submap_scan_matchers_ -- GUARDED_BY(mutex_); -+ ABSL_GUARDED_BY(mutex_); - std::map per_submap_sampler_; - - scan_matching::CeresScanMatcher2D ceres_scan_matcher_; - - // Histogram of scan matcher scores. -- common::Histogram score_histogram_ GUARDED_BY(mutex_); -+ common::Histogram score_histogram_ ABSL_GUARDED_BY(mutex_); - }; - - } // namespace constraints -diff --git a/cartographer/mapping/internal/constraints/constraint_builder_3d.cc b/cartographer/mapping/internal/constraints/constraint_builder_3d.cc -index 87b3742..5b46179 100644 ---- a/cartographer/mapping/internal/constraints/constraint_builder_3d.cc -+++ b/cartographer/mapping/internal/constraints/constraint_builder_3d.cc -@@ -102,7 +102,7 @@ void ConstraintBuilder3D::MaybeAddConstraint( - auto* const constraint = &constraints_.back(); - const auto* scan_matcher = DispatchScanMatcherConstruction(submap_id, submap); - auto constraint_task = absl::make_unique(); -- constraint_task->SetWorkItem([=]() LOCKS_EXCLUDED(mutex_) { -+ constraint_task->SetWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { - ComputeConstraint(submap_id, node_id, false, /* match_full_submap */ - constant_data, global_node_pose, global_submap_pose, - *scan_matcher, constraint); -@@ -128,7 +128,7 @@ void ConstraintBuilder3D::MaybeAddGlobalConstraint( - auto* const constraint = &constraints_.back(); - const auto* scan_matcher = DispatchScanMatcherConstruction(submap_id, submap); - auto constraint_task = absl::make_unique(); -- constraint_task->SetWorkItem([=]() LOCKS_EXCLUDED(mutex_) { -+ constraint_task->SetWorkItem([=]() ABSL_LOCKS_EXCLUDED(mutex_) { - ComputeConstraint(submap_id, node_id, true, /* match_full_submap */ - constant_data, - transform::Rigid3d::Rotation(global_node_rotation), -diff --git a/cartographer/mapping/internal/constraints/constraint_builder_3d.h b/cartographer/mapping/internal/constraints/constraint_builder_3d.h -index 247a9da..8005ccc 100644 ---- a/cartographer/mapping/internal/constraints/constraint_builder_3d.h -+++ b/cartographer/mapping/internal/constraints/constraint_builder_3d.h -@@ -126,7 +126,7 @@ class ConstraintBuilder3D { - // accessed after 'creation_task_handle' has completed. - const SubmapScanMatcher* DispatchScanMatcherConstruction( - const SubmapId& submap_id, const Submap3D* submap) -- EXCLUSIVE_LOCKS_REQUIRED(mutex_); -+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); - - // Runs in a background thread and does computations for an additional - // constraint. -@@ -138,9 +138,9 @@ class ConstraintBuilder3D { - const transform::Rigid3d& global_submap_pose, - const SubmapScanMatcher& submap_scan_matcher, - std::unique_ptr* constraint) -- LOCKS_EXCLUDED(mutex_); -+ ABSL_LOCKS_EXCLUDED(mutex_); - -- void RunWhenDoneCallback() LOCKS_EXCLUDED(mutex_); -+ void RunWhenDoneCallback() ABSL_LOCKS_EXCLUDED(mutex_); - - const proto::ConstraintBuilderOptions options_; - common::ThreadPoolInterface* thread_pool_; -@@ -148,36 +148,36 @@ class ConstraintBuilder3D { - - // 'callback' set by WhenDone(). - std::unique_ptr> when_done_ -- GUARDED_BY(mutex_); -+ ABSL_GUARDED_BY(mutex_); - - // TODO(gaschler): Use atomics instead of mutex to access these counters. - // Number of the node in reaction to which computations are currently - // added. This is always the number of nodes seen so far, even when older - // nodes are matched against a new submap. -- int num_started_nodes_ GUARDED_BY(mutex_) = 0; -+ int num_started_nodes_ ABSL_GUARDED_BY(mutex_) = 0; - -- int num_finished_nodes_ GUARDED_BY(mutex_) = 0; -+ int num_finished_nodes_ ABSL_GUARDED_BY(mutex_) = 0; - -- std::unique_ptr finish_node_task_ GUARDED_BY(mutex_); -+ std::unique_ptr finish_node_task_ ABSL_GUARDED_BY(mutex_); - -- std::unique_ptr when_done_task_ GUARDED_BY(mutex_); -+ std::unique_ptr when_done_task_ ABSL_GUARDED_BY(mutex_); - - // Constraints currently being computed in the background. A deque is used to - // keep pointers valid when adding more entries. Constraint search results - // with below-threshold scores are also 'nullptr'. -- std::deque> constraints_ GUARDED_BY(mutex_); -+ std::deque> constraints_ ABSL_GUARDED_BY(mutex_); - - // Map of dispatched or constructed scan matchers by 'submap_id'. - std::map submap_scan_matchers_ -- GUARDED_BY(mutex_); -+ ABSL_GUARDED_BY(mutex_); - std::map per_submap_sampler_; - - scan_matching::CeresScanMatcher3D ceres_scan_matcher_; - - // Histograms of scan matcher scores. -- common::Histogram score_histogram_ GUARDED_BY(mutex_); -- common::Histogram rotational_score_histogram_ GUARDED_BY(mutex_); -- common::Histogram low_resolution_score_histogram_ GUARDED_BY(mutex_); -+ common::Histogram score_histogram_ ABSL_GUARDED_BY(mutex_); -+ common::Histogram rotational_score_histogram_ ABSL_GUARDED_BY(mutex_); -+ common::Histogram low_resolution_score_histogram_ ABSL_GUARDED_BY(mutex_); - }; - - } // namespace constraints -diff --git a/cartographer/mapping/pose_graph_interface.h b/cartographer/mapping/pose_graph_interface.h -index 68551f1..9619735 100644 ---- a/cartographer/mapping/pose_graph_interface.h -+++ b/cartographer/mapping/pose_graph_interface.h -@@ -17,6 +17,7 @@ - #ifndef CARTOGRAPHER_MAPPING_POSE_GRAPH_INTERFACE_H_ - #define CARTOGRAPHER_MAPPING_POSE_GRAPH_INTERFACE_H_ - -+#include - #include - #include - -diff --git a/cmake/functions.cmake b/cmake/functions.cmake -index 1bbce43..ed320b1 100644 ---- a/cmake/functions.cmake -+++ b/cmake/functions.cmake -@@ -130,12 +130,7 @@ macro(google_initialize_cartographer_project) - set(LIST_FILES_CMD "find ${PROJECT_SOURCE_DIR}/ -not -iwholename '*.git*' | sort | sed 's/^/#/'") - set(FILES_LIST_PATH "${PROJECT_BINARY_DIR}/AllFiles.cmake") - set(DETECT_CHANGES_CMD "bash" "-c" "${LIST_FILES_CMD} | diff -N -q ${FILES_LIST_PATH} - || ${LIST_FILES_CMD} > ${FILES_LIST_PATH}") -- add_custom_target(${PROJECT_NAME}_detect_changes ALL -- COMMAND ${DETECT_CHANGES_CMD} -- VERBATIM -- ) - if(NOT EXISTS ${FILES_LIST_PATH}) -- execute_process(COMMAND ${DETECT_CHANGES_CMD}) - endif() - include(${FILES_LIST_PATH}) - endif() diff --git a/ports/cartographer/portfile.cmake b/ports/cartographer/portfile.cmake deleted file mode 100644 index 1d90a25c2bc48e..00000000000000 --- a/ports/cartographer/portfile.cmake +++ /dev/null @@ -1,29 +0,0 @@ -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO googlecartographer/cartographer - REF ${VERSION} - SHA512 78b9950c8336776e945219c12a15272c439683144d7c97356f1cda569d02fba551735572c5ac103e9472c7ef6375908c9381205d93286c8ba3593324268d7099 - HEAD_REF master - PATCHES - fix-errors.patch - update-cartographer-to-deal-with-newer-ceres-24.patch -) - -vcpkg_cmake_configure( - SOURCE_PATH "${SOURCE_PATH}" - OPTIONS_DEBUG - -DFORCE_DEBUG_BUILD=True -) - -vcpkg_cmake_install() -vcpkg_cmake_config_fixup() -vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/cartographer/CartographerTargets.cmake" "${SOURCE_PATH}/;" "") -vcpkg_copy_pdbs() - -# Clean -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") - -vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/cartographer/update-cartographer-to-deal-with-newer-ceres-24.patch b/ports/cartographer/update-cartographer-to-deal-with-newer-ceres-24.patch deleted file mode 100644 index a1fbd3f93e2965..00000000000000 --- a/ports/cartographer/update-cartographer-to-deal-with-newer-ceres-24.patch +++ /dev/null @@ -1,604 +0,0 @@ -From 07a159192e9ea653a27f5d2dd88da983107eb8c8 Mon Sep 17 00:00:00 2001 -From: Chris Lalancette -Date: Fri, 15 Mar 2024 10:23:38 -0400 -Subject: [PATCH] Update cartographer to deal with newer ceres (#24) - -* Use Manifold instead of LocalParameterization. - -* Changes to deal with old and new ceres. - -* Make sure to fully initialize test articles. - -Otherwise modern gcc complains that these are -possibly used uninitialized. - -Signed-off-by: zjwoody -Signed-off-by: Chris Lalancette ---- - CMakeLists.txt | 2 +- - .../internal/3d/rotation_parameterization.h | 67 +++++++++++++++++++ - .../3d/rotation_parameterization_test.cc | 50 ++++++++++++++ - .../3d/scan_matching/ceres_scan_matcher_3d.cc | 14 ++++ - .../eigen_quaterniond_from_two_vectors.h | 11 +++ - .../internal/imu_based_pose_extrapolator.cc | 34 ++++++++++ - .../internal/optimization/ceres_pose.cc | 14 ++++ - .../internal/optimization/ceres_pose.h | 11 +++ - .../optimization/optimization_problem_2d.cc | 8 +++ - .../optimization/optimization_problem_3d.cc | 61 +++++++++++++++++ - .../internal/range_data_collator_test.cc | 2 +- - cartographer/sensor/internal/test_helpers.h | 2 +- - 12 files changed, 273 insertions(+), 3 deletions(-) - create mode 100644 cartographer/mapping/internal/3d/rotation_parameterization_test.cc - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index f93b343..7a80f16 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -12,7 +12,7 @@ - # See the License for the specific language governing permissions and - # limitations under the License. - --cmake_minimum_required(VERSION 3.2) -+cmake_minimum_required(VERSION 3.5) - - project(cartographer) - -diff --git a/cartographer/mapping/internal/3d/rotation_parameterization.h b/cartographer/mapping/internal/3d/rotation_parameterization.h -index 4ce0055..10e46c8 100644 ---- a/cartographer/mapping/internal/3d/rotation_parameterization.h -+++ b/cartographer/mapping/internal/3d/rotation_parameterization.h -@@ -24,6 +24,72 @@ - namespace cartographer { - namespace mapping { - -+#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 -+// Provides operations used to create a Ceres Manifold with a 4-D ambient -+// space and a 1-D tangent space that represents a yaw rotation only. -+struct YawOnlyQuaternionOperations { -+ template -+ bool Plus(const T* x, const T* delta, T* x_plus_delta) const { -+ const T clamped_delta = common::Clamp(delta[0], T(-0.5), T(0.5)); -+ T q_delta[4]; -+ q_delta[0] = ceres::sqrt(1. - clamped_delta * clamped_delta); -+ q_delta[1] = T(0.); -+ q_delta[2] = T(0.); -+ q_delta[3] = clamped_delta; -+ ceres::QuaternionProduct(q_delta, x, x_plus_delta); -+ return true; -+ } -+ template -+ bool Minus(const T* y, const T* x, T* y_minus_x) const { -+ T minus_x[4] = {x[0], -x[1], -x[2], -x[3]}; -+ T q_delta[4]; -+ ceres::QuaternionProduct(y, minus_x, q_delta); -+ y_minus_x[0] = q_delta[3]; -+ return true; -+ } -+}; -+ -+// Provides operations used to create a Ceres Manifold with a 4-D ambient -+// space and a 2-D tangent space that represents a rotation only in pitch and -+// roll, but no yaw. -+struct ConstantYawQuaternionOperations { -+ template -+ bool Plus(const T* x, const T* delta, T* x_plus_delta) const { -+ const T delta_norm = -+ ceres::sqrt(common::Pow2(delta[0]) + common::Pow2(delta[1])); -+ const T sin_delta_over_delta = -+ delta_norm < 1e-6 ? T(1.) : ceres::sin(delta_norm) / delta_norm; -+ T q_delta[4]; -+ q_delta[0] = delta_norm < 1e-6 ? T(1.) : ceres::cos(delta_norm); -+ q_delta[1] = sin_delta_over_delta * delta[0]; -+ q_delta[2] = sin_delta_over_delta * delta[1]; -+ q_delta[3] = T(0.); -+ // We apply the 'delta' which is interpreted as an angle-axis rotation -+ // vector in the xy-plane of the submap frame. This way we can align to -+ // gravity because rotations around the z-axis in the submap frame do not -+ // change gravity alignment, while disallowing random rotations of the map -+ // that have nothing to do with gravity alignment (i.e. we disallow steps -+ // just changing "yaw" of the complete map). -+ ceres::QuaternionProduct(x, q_delta, x_plus_delta); -+ return true; -+ } -+ template -+ bool Minus(const T* y, const T* x, T* y_minus_x) const { -+ T minus_x[4] = {x[0], -x[1], -x[2], -x[3]}; -+ T q_delta[4]; -+ ceres::QuaternionProduct(minus_x, y, q_delta); -+ const T& cos_delta_norm = q_delta[0]; -+ const T sin_delta_norm = -+ ceres::sqrt(common::Pow2(q_delta[1]) + common::Pow2(q_delta[2])); -+ const T delta_norm = atan2(sin_delta_norm, cos_delta_norm); -+ const T delta_over_sin_delta = -+ delta_norm < 1e-6 ? T(1.) : delta_norm / sin_delta_norm; -+ y_minus_x[0] = q_delta[1] * delta_over_sin_delta; -+ y_minus_x[1] = q_delta[2] * delta_over_sin_delta; -+ return true; -+ } -+}; -+#else - struct YawOnlyQuaternionPlus { - template - bool operator()(const T* x, const T* delta, T* x_plus_delta) const { -@@ -60,6 +126,7 @@ struct ConstantYawQuaternionPlus { - return true; - } - }; -+#endif - - } // namespace mapping - } // namespace cartographer -diff --git a/cartographer/mapping/internal/3d/rotation_parameterization_test.cc b/cartographer/mapping/internal/3d/rotation_parameterization_test.cc -new file mode 100644 -index 0000000..977d277 ---- /dev/null -+++ b/cartographer/mapping/internal/3d/rotation_parameterization_test.cc -@@ -0,0 +1,50 @@ -+#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 -+#include "cartographer/mapping/internal/3d/rotation_parameterization.h" -+ -+#include "ceres/manifold_test_utils.h" -+#include "gtest/gtest.h" -+ -+namespace cartographer::mapping { -+ -+template -+class RotationParameterizationTests : public ::testing::Test {}; -+ -+using TestTypes = -+ ::testing::Types, ceres::AutoDiffManifold>; -+TYPED_TEST_SUITE(RotationParameterizationTests, TestTypes); -+ -+TYPED_TEST(RotationParameterizationTests, ManifoldInvariantsHold) { -+ const TypeParam manifold; -+ -+ constexpr static int kNumTrials = 10; -+ constexpr static double kTolerance = 1.e-5; -+ const std::vector delta_magnitutes = {0.0, 1.e-9, 1.e-3, 0.5}; -+ for (int trial = 0; trial < kNumTrials; ++trial) { -+ const Eigen::VectorXd x = -+ Eigen::VectorXd::Random(manifold.AmbientSize()).normalized(); -+ -+ for (const double delta_magnitude : delta_magnitutes) { -+ const Eigen::VectorXd delta = -+ Eigen::VectorXd::Random(manifold.TangentSize()) * delta_magnitude; -+ EXPECT_THAT(manifold, ceres::XPlusZeroIsXAt(x, kTolerance)); -+ EXPECT_THAT(manifold, ceres::XMinusXIsZeroAt(x, kTolerance)); -+ EXPECT_THAT(manifold, ceres::MinusPlusIsIdentityAt(x, delta, kTolerance)); -+ const Eigen::VectorXd zero_tangent = -+ Eigen::VectorXd::Zero(manifold.TangentSize()); -+ EXPECT_THAT(manifold, -+ ceres::MinusPlusIsIdentityAt(x, zero_tangent, kTolerance)); -+ -+ Eigen::VectorXd y(manifold.AmbientSize()); -+ ASSERT_TRUE(manifold.Plus(x.data(), delta.data(), y.data())); -+ EXPECT_THAT(manifold, ceres::PlusMinusIsIdentityAt(x, x, kTolerance)); -+ EXPECT_THAT(manifold, ceres::PlusMinusIsIdentityAt(x, y, kTolerance)); -+ EXPECT_THAT(manifold, ceres::HasCorrectPlusJacobianAt(x, kTolerance)); -+ EXPECT_THAT(manifold, ceres::HasCorrectMinusJacobianAt(x, kTolerance)); -+ EXPECT_THAT(manifold, -+ ceres::MinusPlusJacobianIsIdentityAt(x, kTolerance)); -+ } -+ } -+} -+ -+} // namespace cartographer::mapping -+#endif -diff --git a/cartographer/mapping/internal/3d/scan_matching/ceres_scan_matcher_3d.cc b/cartographer/mapping/internal/3d/scan_matching/ceres_scan_matcher_3d.cc -index 5aab1fd..0c287b6 100644 ---- a/cartographer/mapping/internal/3d/scan_matching/ceres_scan_matcher_3d.cc -+++ b/cartographer/mapping/internal/3d/scan_matching/ceres_scan_matcher_3d.cc -@@ -31,6 +31,9 @@ - #include "cartographer/transform/rigid_transform.h" - #include "cartographer/transform/transform.h" - #include "ceres/ceres.h" -+#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 -+#include "ceres/manifold.h" -+#endif - #include "glog/logging.h" - - namespace cartographer { -@@ -95,6 +98,16 @@ void CeresScanMatcher3D::Match( - transform::Rigid3d* const pose_estimate, - ceres::Solver::Summary* const summary) const { - ceres::Problem problem; -+#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 -+ optimization::CeresPose ceres_pose( -+ initial_pose_estimate, nullptr /* translation_parameterization */, -+ options_.only_optimize_yaw() -+ ? std::unique_ptr( -+ absl::make_unique>()) -+ : std::unique_ptr( -+ absl::make_unique()), -+ &problem); -+#else - optimization::CeresPose ceres_pose( - initial_pose_estimate, nullptr /* translation_parameterization */, - options_.only_optimize_yaw() -@@ -104,6 +117,7 @@ void CeresScanMatcher3D::Match( - : std::unique_ptr( - absl::make_unique()), - &problem); -+#endif - - CHECK_EQ(options_.occupied_space_weight_size(), - point_clouds_and_hybrid_grids.size()); -diff --git a/cartographer/mapping/internal/eigen_quaterniond_from_two_vectors.h b/cartographer/mapping/internal/eigen_quaterniond_from_two_vectors.h -index e8d04b3..294f45e 100644 ---- a/cartographer/mapping/internal/eigen_quaterniond_from_two_vectors.h -+++ b/cartographer/mapping/internal/eigen_quaterniond_from_two_vectors.h -@@ -17,7 +17,18 @@ - #ifndef CARTOGRAPHER_MAPPING_EIGEN_QUATERNIOND_FROM_TWO_VECTORS_H_ - #define CARTOGRAPHER_MAPPING_EIGEN_QUATERNIOND_FROM_TWO_VECTORS_H_ - -+// When using Eigen 3.4.0 on Ubuntu 24.04 on an x86_64 machine and -+// compiling with -O3 -NDEBUG, we get a warning that an SSE function -+// deep within Eigen might be used uninitialized. This seems like -+// a spurious warning, so just ignore it for now. -+#ifdef __linux__ -+#pragma GCC diagnostic push -+#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" -+#endif - #include "Eigen/Geometry" -+#ifdef __linux__ -+#pragma GCC diagnostic pop -+#endif - - namespace cartographer { - namespace mapping { -diff --git a/cartographer/mapping/internal/imu_based_pose_extrapolator.cc b/cartographer/mapping/internal/imu_based_pose_extrapolator.cc -index ddb88ea..4e0a950 100644 ---- a/cartographer/mapping/internal/imu_based_pose_extrapolator.cc -+++ b/cartographer/mapping/internal/imu_based_pose_extrapolator.cc -@@ -28,6 +28,9 @@ - #include "cartographer/mapping/internal/optimization/cost_functions/spa_cost_function_3d.h" - #include "cartographer/mapping/pose_graph_interface.h" - #include "cartographer/transform/transform.h" -+#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 -+#include "ceres/manifold.h" -+#endif - #include "glog/logging.h" - - namespace cartographer { -@@ -135,9 +138,16 @@ ImuBasedPoseExtrapolator::ExtrapolatePosesWithGravity( - - // Track gravity alignment over time and use this as a frame here so that - // we can estimate the gravity alignment of the current pose. -+#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 -+ optimization::CeresPose gravity_from_local( -+ gravity_from_local_, nullptr, -+ absl::make_unique(), &problem); -+#else - optimization::CeresPose gravity_from_local( - gravity_from_local_, nullptr, - absl::make_unique(), &problem); -+#endif -+ - // Use deque so addresses stay constant during problem formulation. - std::deque nodes; - std::vector node_times; -@@ -160,6 +170,18 @@ ImuBasedPoseExtrapolator::ExtrapolatePosesWithGravity( - gravity_from_node = gravity_from_local_ * timed_pose.transform; - } - -+#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 -+ if (is_last) { -+ nodes.emplace_back(gravity_from_node, nullptr, -+ absl::make_unique>(), -+ &problem); -+ problem.SetParameterBlockConstant(nodes.back().translation()); -+ } else { -+ nodes.emplace_back(gravity_from_node, nullptr, -+ absl::make_unique(), -+ &problem); -+ } -+#else - if (is_last) { - nodes.emplace_back(gravity_from_node, nullptr, - absl::make_unique(), - &problem); - } -+#endif - } - - double gravity_constant = 9.8; -@@ -199,9 +222,15 @@ ImuBasedPoseExtrapolator::ExtrapolatePosesWithGravity( - gravity_constant * Eigen::Vector3d::UnitZ(), time, imu_data_, - &imu_it_prev_prev) - .pose; -+#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 -+ nodes.emplace_back(initial_estimate, nullptr, -+ absl::make_unique(), -+ &problem); -+#else - nodes.emplace_back(initial_estimate, nullptr, - absl::make_unique(), - &problem); -+#endif - node_times.push_back(time); - - // Add cost functions for node constraints. -@@ -222,8 +251,13 @@ ImuBasedPoseExtrapolator::ExtrapolatePosesWithGravity( - - std::array imu_calibration{{1., 0., 0., 0.}}; - -+#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 -+ problem.AddParameterBlock(imu_calibration.data(), 4, -+ new ceres::QuaternionManifold()); -+#else - problem.AddParameterBlock(imu_calibration.data(), 4, - new ceres::QuaternionParameterization()); -+#endif - problem.SetParameterBlockConstant(imu_calibration.data()); - - auto imu_it = imu_data_.begin(); -diff --git a/cartographer/mapping/internal/optimization/ceres_pose.cc b/cartographer/mapping/internal/optimization/ceres_pose.cc -index 807a67d..f15b427 100644 ---- a/cartographer/mapping/internal/optimization/ceres_pose.cc -+++ b/cartographer/mapping/internal/optimization/ceres_pose.cc -@@ -27,6 +27,19 @@ CeresPose::Data FromPose(const transform::Rigid3d& pose) { - pose.rotation().y(), pose.rotation().z()}}}; - } - -+#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 -+CeresPose::CeresPose( -+ const transform::Rigid3d& pose, -+ std::unique_ptr translation_manifold, -+ std::unique_ptr rotation_manifold, -+ ceres::Problem* problem) -+ : data_(std::make_shared(FromPose(pose))) { -+ problem->AddParameterBlock(data_->translation.data(), 3, -+ translation_manifold.release()); -+ problem->AddParameterBlock(data_->rotation.data(), 4, -+ rotation_manifold.release()); -+} -+#else - CeresPose::CeresPose( - const transform::Rigid3d& pose, - std::unique_ptr translation_parametrization, -@@ -38,6 +51,7 @@ CeresPose::CeresPose( - problem->AddParameterBlock(data_->rotation.data(), 4, - rotation_parametrization.release()); - } -+#endif - - const transform::Rigid3d CeresPose::ToRigid() const { - return transform::Rigid3d::FromArrays(data_->rotation, data_->translation); -diff --git a/cartographer/mapping/internal/optimization/ceres_pose.h b/cartographer/mapping/internal/optimization/ceres_pose.h -index d852d80..e4c7b05 100644 ---- a/cartographer/mapping/internal/optimization/ceres_pose.h -+++ b/cartographer/mapping/internal/optimization/ceres_pose.h -@@ -23,6 +23,9 @@ - #include "Eigen/Core" - #include "cartographer/transform/rigid_transform.h" - #include "ceres/ceres.h" -+#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 -+#include "ceres/manifold.h" -+#endif - - namespace cartographer { - namespace mapping { -@@ -30,11 +33,19 @@ namespace optimization { - - class CeresPose { - public: -+#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 -+ CeresPose( -+ const transform::Rigid3d& pose, -+ std::unique_ptr translation_manifold, -+ std::unique_ptr rotation_manifold, -+ ceres::Problem* problem); -+#else - CeresPose( - const transform::Rigid3d& rigid, - std::unique_ptr translation_parametrization, - std::unique_ptr rotation_parametrization, - ceres::Problem* problem); -+#endif - - const transform::Rigid3d ToRigid() const; - -diff --git a/cartographer/mapping/internal/optimization/optimization_problem_2d.cc b/cartographer/mapping/internal/optimization/optimization_problem_2d.cc -index 3faf255..64b3c2c 100644 ---- a/cartographer/mapping/internal/optimization/optimization_problem_2d.cc -+++ b/cartographer/mapping/internal/optimization/optimization_problem_2d.cc -@@ -142,11 +142,19 @@ void AddLandmarkCostFunctions( - ? landmark_node.second.global_landmark_pose.value() - : GetInitialLandmarkPose(observation, prev->data, next->data, - *prev_node_pose, *next_node_pose); -+#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 -+ C_landmarks->emplace( -+ landmark_id, -+ CeresPose(starting_point, nullptr /* translation_manifold */, -+ absl::make_unique(), -+ problem)); -+#else - C_landmarks->emplace( - landmark_id, - CeresPose(starting_point, nullptr /* translation_parametrization */, - absl::make_unique(), - problem)); -+#endif - // Set landmark constant if it is frozen. - if (landmark_node.second.frozen) { - problem->SetParameterBlockConstant( -diff --git a/cartographer/mapping/internal/optimization/optimization_problem_3d.cc b/cartographer/mapping/internal/optimization/optimization_problem_3d.cc -index fca36d1..e1d6bd3 100644 ---- a/cartographer/mapping/internal/optimization/optimization_problem_3d.cc -+++ b/cartographer/mapping/internal/optimization/optimization_problem_3d.cc -@@ -158,11 +158,19 @@ void AddLandmarkCostFunctions( - ? landmark_node.second.global_landmark_pose.value() - : GetInitialLandmarkPose(observation, prev->data, next->data, - *prev_node_pose, *next_node_pose); -+#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 -+ C_landmarks->emplace( -+ landmark_id, -+ CeresPose(starting_point, nullptr /* translation_manifold */, -+ absl::make_unique(), -+ problem)); -+#else - C_landmarks->emplace( - landmark_id, - CeresPose(starting_point, nullptr /* translation_parametrization */, - absl::make_unique(), - problem)); -+#endif - // Set landmark constant if it is frozen. - if (landmark_node.second.frozen) { - problem->SetParameterBlockConstant( -@@ -274,6 +282,14 @@ void OptimizationProblem3D::Solve( - ceres::Problem::Options problem_options; - ceres::Problem problem(problem_options); - -+#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 -+ const auto translation_manifold = -+ [this]() -> std::unique_ptr { -+ return options_.fix_z_in_3d() ? absl::make_unique( -+ 3, std::vector{2}) -+ : nullptr; -+ }; -+#else - const auto translation_parameterization = - [this]() -> std::unique_ptr { - return options_.fix_z_in_3d() -@@ -281,6 +297,7 @@ void OptimizationProblem3D::Solve( - 3, std::vector{2}) - : nullptr; - }; -+#endif - - // Set the starting point. - CHECK(!submap_data_.empty()); -@@ -295,6 +312,14 @@ void OptimizationProblem3D::Solve( - first_submap = false; - // Fix the first submap of the first trajectory except for allowing - // gravity alignment. -+#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 -+ C_submaps.Insert( -+ submap_id_data.id, -+ CeresPose(submap_id_data.data.global_pose, -+ translation_manifold(), -+ absl::make_unique>(), -+ &problem)); -+#else - C_submaps.Insert( - submap_id_data.id, - CeresPose(submap_id_data.data.global_pose, -@@ -302,15 +327,25 @@ void OptimizationProblem3D::Solve( - absl::make_unique>(), - &problem)); -+#endif - problem.SetParameterBlockConstant( - C_submaps.at(submap_id_data.id).translation()); - } else { -+#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 -+ C_submaps.Insert( -+ submap_id_data.id, -+ CeresPose(submap_id_data.data.global_pose, -+ translation_manifold(), -+ absl::make_unique(), -+ &problem)); -+#else - C_submaps.Insert( - submap_id_data.id, - CeresPose(submap_id_data.data.global_pose, - translation_parameterization(), - absl::make_unique(), - &problem)); -+#endif - } - if (frozen) { - problem.SetParameterBlockConstant( -@@ -322,11 +357,19 @@ void OptimizationProblem3D::Solve( - for (const auto& node_id_data : node_data_) { - const bool frozen = - frozen_trajectories.count(node_id_data.id.trajectory_id) != 0; -+#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 -+ C_nodes.Insert( -+ node_id_data.id, -+ CeresPose(node_id_data.data.global_pose, translation_manifold(), -+ absl::make_unique(), -+ &problem)); -+#else - C_nodes.Insert( - node_id_data.id, - CeresPose(node_id_data.data.global_pose, translation_parameterization(), - absl::make_unique(), - &problem)); -+#endif - if (frozen) { - problem.SetParameterBlockConstant(C_nodes.at(node_id_data.id).rotation()); - problem.SetParameterBlockConstant( -@@ -362,8 +405,13 @@ void OptimizationProblem3D::Solve( - } - TrajectoryData& trajectory_data = trajectory_data_.at(trajectory_id); - -+#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 -+ problem.AddParameterBlock(trajectory_data.imu_calibration.data(), 4, -+ new ceres::QuaternionManifold()); -+#else - problem.AddParameterBlock(trajectory_data.imu_calibration.data(), 4, - new ceres::QuaternionParameterization()); -+#endif - if (!options_.use_online_imu_extrinsics_in_3d()) { - problem.SetParameterBlockConstant( - trajectory_data.imu_calibration.data()); -@@ -536,6 +584,18 @@ void OptimizationProblem3D::Solve( - fixed_frame_pose_in_map = - node_data.global_pose * constraint_pose.zbar_ij.inverse(); - } -+#if CERES_VERSION_MAJOR > 2 || CERES_VERSION_MAJOR == 2 && CERES_VERSION_MINOR >= 1 -+ C_fixed_frames.emplace( -+ std::piecewise_construct, std::forward_as_tuple(trajectory_id), -+ std::forward_as_tuple( -+ transform::Rigid3d( -+ fixed_frame_pose_in_map.translation(), -+ Eigen::AngleAxisd( -+ transform::GetYaw(fixed_frame_pose_in_map.rotation()), -+ Eigen::Vector3d::UnitZ())), -+ nullptr, absl::make_unique>(), -+ &problem)); -+#else - C_fixed_frames.emplace( - std::piecewise_construct, std::forward_as_tuple(trajectory_id), - std::forward_as_tuple( -@@ -548,6 +608,7 @@ void OptimizationProblem3D::Solve( - absl::make_unique>(), - &problem)); -+#endif - fixed_frame_pose_initialized = true; - } - -diff --git a/cartographer/mapping/internal/range_data_collator_test.cc b/cartographer/mapping/internal/range_data_collator_test.cc -index 43ceb00..dce7717 100644 ---- a/cartographer/mapping/internal/range_data_collator_test.cc -+++ b/cartographer/mapping/internal/range_data_collator_test.cc -@@ -92,7 +92,7 @@ TEST(RangeDataCollatorTest, SingleSensorEmptyData) { - const std::string sensor_id = "single_sensor"; - RangeDataCollator collator({sensor_id}); - sensor::TimedPointCloudData empty_data{ -- common::FromUniversal(300), {}, {}, {}}; -+ common::FromUniversal(300), Eigen::Vector3f::Zero(), {}, {}}; - auto output_0 = collator.AddRangeData(sensor_id, empty_data); - EXPECT_EQ(output_0.time, empty_data.time); - EXPECT_EQ(output_0.ranges.size(), empty_data.ranges.size()); -diff --git a/cartographer/sensor/internal/test_helpers.h b/cartographer/sensor/internal/test_helpers.h -index 0b32d89..431758f 100644 ---- a/cartographer/sensor/internal/test_helpers.h -+++ b/cartographer/sensor/internal/test_helpers.h -@@ -47,7 +47,7 @@ struct CollatorInput { - const std::string& sensor_id, int time) { - return CollatorInput{ - trajectory_id, -- MakeDispatchable(sensor_id, ImuData{common::FromUniversal(time)}), -+ MakeDispatchable(sensor_id, ImuData{common::FromUniversal(time), Eigen::Vector3d::Zero(), Eigen::Vector3d::Zero()}), - CollatorOutput{trajectory_id, sensor_id, common::FromUniversal(time)}}; - } - static CollatorInput CreateTimedPointCloudData(int trajectory_id, --- -2.47.1 - diff --git a/ports/cartographer/vcpkg.json b/ports/cartographer/vcpkg.json deleted file mode 100644 index bc4697a019a896..00000000000000 --- a/ports/cartographer/vcpkg.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "cartographer", - "version": "2.0.0", - "description": "Google 2D & 3D SLAM package", - "homepage": "https://github.com/googlecartographer/cartographer", - "dependencies": [ - "boost-iostreams", - "cairo", - { - "name": "ceres", - "features": [ - "suitesparse" - ] - }, - "gflags", - "glog", - "gtest", - "lua", - "protobuf", - { - "name": "vcpkg-cmake", - "host": true - }, - { - "name": "vcpkg-cmake-config", - "host": true - } - ] -} diff --git a/ports/theia/266.diff b/ports/theia/266.diff deleted file mode 100644 index febcd8c31a63de..00000000000000 --- a/ports/theia/266.diff +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/libraries/vlfeat/CMakeLists.txt b/libraries/vlfeat/CMakeLists.txt -index 7f4ffc796..9535d0c22 100644 ---- a/libraries/vlfeat/CMakeLists.txt -+++ b/libraries/vlfeat/CMakeLists.txt -@@ -1,6 +1,6 @@ - project(vlfeat) - --include("${CMAKE_MODULE_PATH}/OptimizeTheiaCompilerFlags.cmake") -+include(OptimizeTheiaCompilerFlags) - optimizetheiacompilerflags() - - include_directories(./vl) diff --git a/ports/theia/ceres-manifold.patch b/ports/theia/ceres-manifold.patch deleted file mode 100644 index 9bdb0f80899410..00000000000000 --- a/ports/theia/ceres-manifold.patch +++ /dev/null @@ -1,80 +0,0 @@ -diff --git a/src/theia/sfm/bundle_adjustment/bundle_adjust_two_views.cc b/src/theia/sfm/bundle_adjustment/bundle_adjust_two_views.cc -index aab0cfb..8631d1c 100644 ---- a/src/theia/sfm/bundle_adjustment/bundle_adjust_two_views.cc -+++ b/src/theia/sfm/bundle_adjustment/bundle_adjust_two_views.cc -@@ -96,8 +96,8 @@ void AddCameraParametersToProblem(const bool constant_extrinsic_parameters, - constant_intrinsics.end(), - 1); - -- ceres::SubsetParameterization* subset_parameterization = -- new ceres::SubsetParameterization(num_intrinsics, -+ ceres::SubsetManifold* subset_parameterization = -+ new ceres::SubsetManifold(num_intrinsics, - constant_intrinsics); - problem->AddParameterBlock(camera_intrinsics, - num_intrinsics, -@@ -216,12 +216,9 @@ BundleAdjustmentSummary BundleAdjustTwoViewsAngular( - const int kParameterBlockSize = 3; - problem.AddParameterBlock(info->rotation_2.data(), kParameterBlockSize); - // Add the position as a parameter block, ensuring that the norm is 1. -- ceres::LocalParameterization* position_parameterization = -- new ceres::AutoDiffLocalParameterization< -- UnitNormThreeVectorParameterization, 3, 3>; - problem.AddParameterBlock(info->position_2.data(), - kParameterBlockSize, -- position_parameterization); -+ new ceres::SphereManifold<3>); - - // Add all the epipolar constraints from feature matches. - for (const FeatureCorrespondence& match : correspondences) { -diff --git a/src/theia/sfm/bundle_adjustment/bundle_adjuster.cc b/src/theia/sfm/bundle_adjustment/bundle_adjuster.cc -index 27a2efd..c1a1506 100644 ---- a/src/theia/sfm/bundle_adjustment/bundle_adjuster.cc -+++ b/src/theia/sfm/bundle_adjustment/bundle_adjuster.cc -@@ -258,10 +258,10 @@ void BundleAdjuster::SetCameraIntrinsicsParameterization() { - problem_->SetParameterBlockConstant( - camera_intrinsics->mutable_parameters()); - } else if (constant_intrinsics.size() > 0) { -- ceres::SubsetParameterization* subset_parameterization = -- new ceres::SubsetParameterization(camera_intrinsics->NumParameters(), -- constant_intrinsics); -- problem_->SetParameterization(camera_intrinsics->mutable_parameters(), -+ ceres::SubsetManifold* subset_parameterization = -+ new ceres::SubsetManifold(camera_intrinsics->NumParameters(), -+ constant_intrinsics); -+ problem_->SetManifold(camera_intrinsics->mutable_parameters(), - subset_parameterization); - } - } -@@ -310,12 +310,12 @@ void BundleAdjuster::SetCameraExtrinsicsConstant(const ViewId view_id) { - void BundleAdjuster::SetCameraPositionConstant(const ViewId view_id) { - static const std::vector position_parameters = { - Camera::POSITION + 0, Camera::POSITION + 1, Camera::POSITION + 2}; -- ceres::SubsetParameterization* subset_parameterization = -- new ceres::SubsetParameterization(Camera::kExtrinsicsSize, -+ ceres::SubsetManifold* subset_parameterization = -+ new ceres::SubsetManifold(Camera::kExtrinsicsSize, - position_parameters); - View* view = reconstruction_->MutableView(view_id); - Camera* camera = view->MutableCamera(); -- problem_->SetParameterization(camera->mutable_extrinsics(), -+ problem_->SetManifold(camera->mutable_extrinsics(), - subset_parameterization); - } - -@@ -324,12 +324,12 @@ void BundleAdjuster::SetCameraOrientationConstant(const ViewId view_id) { - Camera::ORIENTATION + 0, - Camera::ORIENTATION + 1, - Camera::ORIENTATION + 2}; -- ceres::SubsetParameterization* subset_parameterization = -- new ceres::SubsetParameterization(Camera::kExtrinsicsSize, -+ ceres::SubsetManifold* subset_parameterization = -+ new ceres::SubsetManifold(Camera::kExtrinsicsSize, - orientation_parameters); - View* view = reconstruction_->MutableView(view_id); - Camera* camera = view->MutableCamera(); -- problem_->SetParameterization(camera->mutable_extrinsics(), -+ problem_->SetManifold(camera->mutable_extrinsics(), - subset_parameterization); - } - diff --git a/ports/theia/eigen-3.4.patch b/ports/theia/eigen-3.4.patch deleted file mode 100644 index 9bbd5e24b0bd9d..00000000000000 --- a/ports/theia/eigen-3.4.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- a/libraries/akaze/src/nldiffusion_functions.cpp -+++ b/libraries/akaze/src/nldiffusion_functions.cpp -@@ -222,8 +222,8 @@ void halfsample_image(const RowMatrixXf& src, RowMatrixXf& dst) { - - // Do the whole resampling in one pass by using neighboring values. First, we - // compute the borders. -- const double x_kernel_size = static_cast(src.cols()) / dst.cols(); -- const double y_kernel_size = static_cast(src.rows()) / dst.rows(); -+ const int x_kernel_size = static_cast(src.cols()) / dst.cols(); -+ const int y_kernel_size = static_cast(src.rows()) / dst.rows(); - - // Do simple linear interpolation. - if (x_kernel_size == 2 && y_kernel_size == 2) { -@@ -237,8 +237,8 @@ void halfsample_image(const RowMatrixXf& src, RowMatrixXf& dst) { - return; - } - -- const double x_kernel_clamped_size = static_cast(ceil(x_kernel_size)); -- const double y_kernel_clamped_size = static_cast(ceil(y_kernel_size)); -+ const int x_kernel_clamped_size = static_cast(ceil(static_cast(src.cols()) / dst.cols())); -+ const int y_kernel_clamped_size = static_cast(ceil(static_cast(src.rows()) / dst.rows())); - - // Set up precomputed factor matrices. - Eigen::RowVectorXf x_kernel_mul(static_cast(x_kernel_clamped_size)), diff --git a/ports/theia/fix-external-dependencies.patch b/ports/theia/fix-external-dependencies.patch deleted file mode 100644 index 812aad4319350b..00000000000000 --- a/ports/theia/fix-external-dependencies.patch +++ /dev/null @@ -1,457 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 9c1b150..1adbfed 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -105,10 +105,10 @@ add_definitions(-DTHEIA_DATA_DIR="${CMAKE_SOURCE_DIR}/data") - - # Eigen - set(MIN_EIGEN_VERSION 3.2.0) --find_package(Eigen ${MIN_EIGEN_VERSION} REQUIRED) --if (EIGEN_FOUND) -- message("-- Found Eigen version ${EIGEN_VERSION}: ${EIGEN_INCLUDE_DIRS}") --endif (EIGEN_FOUND) -+find_package(Eigen3 ${MIN_EIGEN_VERSION} REQUIRED) -+if (EIGEN3_FOUND) -+ message("-- Found Eigen version ${EIGEN3_VERSION}: ${EIGEN3_INCLUDE_DIRS}") -+endif (EIGEN3_FOUND) - - # Use a larger inlining threshold for Clang, since it hobbles Eigen, - # resulting in an unreasonably slow version of the blas routines. The -@@ -129,70 +129,27 @@ endif () - - # GFlags. The namespace patch is borrow from Ceres Solver (see license in - # FindGflags.cmake) -+message("-- Check for Google Flags") - find_package(Gflags REQUIRED) --if (GFLAGS_FOUND) -- message("-- Found Google Flags: ${GFLAGS_INCLUDE_DIRS} in namespace: ${GFLAGS_NAMESPACE}") -- add_definitions(-DTHEIA_GFLAGS_NAMESPACE=${GFLAGS_NAMESPACE}) --else (GFLAGS_FOUND) -- message(FATAL_ERROR "Can't find Google FLAGS.") --endif (GFLAGS_FOUND) - - # Google Logging - message("-- Check for Google Log") - find_package(Glog REQUIRED) --if (GLOG_FOUND) -- message("-- Found Google Logging: ${GLOG_INCLUDE_DIRS}") --else (GLOG_FOUND) -- message(FATAL_ERROR "Can't find Google Logging. Please set GLOG_INCLUDE_DIR & " -- "GLOG_LIBRARY") --endif (GLOG_FOUND) -+ -+# Flann -+message("-- Check for Flann") -+find_package(Flann REQUIRED) - - # Ceres - message("-- Check for Ceres") - find_package(Ceres REQUIRED SuiteSparse) --if (CERES_FOUND) -- message("-- Found Ceres: ${CERES_INCLUDE_DIRS}") --else (CERES_FOUND) -- message(FATAL_ERROR "Can't find Ceres. Please set CERES_INCLUDE_DIR & " -- "CERES_LIBRARY") --endif (CERES_FOUND) - - # OpenImageIO - message("-- Check for OpenImageIO") - find_package(OpenImageIO REQUIRED) --if (OPENIMAGEIO_FOUND) -- message("-- Found OpenImageIO: ${OPENIMAGEIO_INCLUDE_DIRS}") --else (OPENIMAGEIO_FOUND) -- message(FATAL_ERROR "Can't find OpenImageIO. Please set OPENIMAGEIO_INCLUDE_DIR & " -- "OPENIMAGEIO_LIBRARY") --endif (OPENIMAGEIO_FOUND) - - # Suitesparse - find_package(SuiteSparse REQUIRED) --if (SUITESPARSE_FOUND) -- # On Ubuntu the system install of SuiteSparse (v3.4.0) up to at least -- # Ubuntu 13.10 cannot be used to link shared libraries. -- if (BUILD_SHARED_LIBS AND -- SUITESPARSE_IS_BROKEN_SHARED_LINKING_UBUNTU_SYSTEM_VERSION) -- message(FATAL_ERROR "You are attempting to build Theia as a shared " -- "library on Ubuntu using a system package install of SuiteSparse " -- "3.4.0. This package is broken and does not support the " -- "construction of shared libraries (you can still build Theia as " -- "a static library). If you wish to build a shared version of Theia " -- "you should uninstall the system install of SuiteSparse " -- "(libsuitesparse-dev) and perform a source install of SuiteSparse " -- "(we recommend that you use the latest version), " -- "see http://theia-solver.org/building.html for more information.") -- endif (BUILD_SHARED_LIBS AND -- SUITESPARSE_IS_BROKEN_SHARED_LINKING_UBUNTU_SYSTEM_VERSION) -- message("-- Found SuiteSparse ${SUITESPARSE_VERSION}") -- add_definitions(-DTHEIA_SUITESPARSE_VERSION="${SUITESPARSE_VERSION}") --else (SUITESPARSE_FOUND) -- # Disable use of SuiteSparse if it cannot be found and continue. -- message(FATAL ERROR "Can't find SuiteSparse. This library is required " -- "for bundle adjustment and for solving convex optimization problems. " -- "Please set SUITESPARSE_INCLUDE_DIR & SUITESPARSE_LIBRARY") --endif (SUITESPARSE_FOUND) - - include_directories( - include -@@ -225,24 +182,19 @@ include_directories( - libraries/spectra - ${akaze_SOURCE_DIR} - ${akaze_INCLUDE_DIR} -- ${cereal_SOURCE_DIR} -- ${cereal_SOURCE_DIR}/include -- ${flann_SOURCE_DIR} -- ${flann_SOURCE_DIR}/src/cpp -- ${gtest_SOURCE_DIR}/include -- ${gtest_SOURCE_DIR} - ${optimo_SOURCE_DIR} - ${statx_SOURCE_DIR} - ${stlplus3_SOURCE_DIR} - ${vlfeat_SOURCE_DIR} -- ${visual_sfm_SOURCE_DIR}) -+ ${visual_sfm_SOURCE_DIR} -+) - - list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") - include(OptimizeTheiaCompilerFlags) - optimizetheiacompilerflags() - - add_subdirectory(src/theia) --add_subdirectory(applications) -+#add_subdirectory(applications) - - if (BUILD_DOCUMENTATION) - message("-- Documentation building is enabled") -@@ -260,7 +212,13 @@ install(FILES ${THEIA_HDRS} DESTINATION include/theia) - file(GLOB_RECURSE THEIA_INTERNAL_HDRS ${CMAKE_SOURCE_DIR}/src/theia/*.h) - install(DIRECTORY src/theia/ DESTINATION include/theia FILES_MATCHING PATTERN "*.h") - --install(DIRECTORY libraries/ DESTINATION include/theia/libraries FILES_MATCHING PATTERN "*.h*") -+install(DIRECTORY libraries/akaze/ DESTINATION include/theia/libraries/akaze FILES_MATCHING PATTERN "*.h*") -+install(DIRECTORY libraries/optimo/ DESTINATION include/theia/libraries/optimo FILES_MATCHING PATTERN "*.h*") -+install(DIRECTORY libraries/spectra/ DESTINATION include/theia/libraries/spectra FILES_MATCHING PATTERN "*.h*") -+install(DIRECTORY libraries/statx/ DESTINATION include/theia/libraries/statx FILES_MATCHING PATTERN "*.h*") -+install(DIRECTORY libraries/stlplus3/ DESTINATION include/theia/libraries/stlplus3 FILES_MATCHING PATTERN "*.h*") -+install(DIRECTORY libraries/visual_sfm/ DESTINATION include/theia/libraries/visual_sfm FILES_MATCHING PATTERN "*.h*") -+install(DIRECTORY libraries/vlfeat/ DESTINATION include/theia/libraries/vlfeat FILES_MATCHING PATTERN "*.h*") - - # Add an uninstall target to remove all installed files. - configure_file("${CMAKE_SOURCE_DIR}/cmake/uninstall.cmake.in" -@@ -272,17 +230,10 @@ add_custom_target(uninstall - - # Set up install directories. INCLUDE_INSTALL_DIR, LIB_INSTALL_DIR and - # CMAKECONFIG_INSTALL_DIR must not be absolute paths. --if (WIN32) -- set(INCLUDE_INSTALL_DIR Include) -- set(LIB_INSTALL_DIR Lib) -- set(CMAKECONFIG_INSTALL_DIR CMake) -- set(RELATIVE_CMAKECONFIG_INSTALL_DIR CMake) --else () -- set(INCLUDE_INSTALL_DIR include) -- set(LIB_INSTALL_DIR lib) -- set(CMAKECONFIG_INSTALL_DIR share/Theia) -- set(RELATIVE_CMAKECONFIG_INSTALL_DIR share/Theia) --endif () -+set(INCLUDE_INSTALL_DIR include) -+set(LIB_INSTALL_DIR lib) -+set(CMAKECONFIG_INSTALL_DIR share/theia) -+set(RELATIVE_CMAKECONFIG_INSTALL_DIR share/theia) - - # This "exports" all targets which have been put into the export set - # "TheiaExport". This means that CMake generates a file with the given -@@ -319,9 +270,4 @@ configure_file("${CMAKE_SOURCE_DIR}/cmake/TheiaConfigVersion.cmake.in" - # in the public API of Theia and should thus be present in THEIA_INCLUDE_DIRS. - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/TheiaConfig.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/TheiaConfigVersion.cmake" -- "${CMAKE_SOURCE_DIR}/cmake/FindEigen.cmake" -- "${CMAKE_SOURCE_DIR}/cmake/FindGlog.cmake" -- "${CMAKE_SOURCE_DIR}/cmake/FindGflags.cmake" -- "${CMAKE_SOURCE_DIR}/cmake/FindOpenImageIO.cmake" -- "${CMAKE_SOURCE_DIR}/cmake/FindSuiteSparse.cmake" - DESTINATION ${CMAKECONFIG_INSTALL_DIR}) -diff --git a/cmake/TheiaConfig.cmake.in b/cmake/TheiaConfig.cmake.in -index a3ea187..7e9d912 100644 ---- a/cmake/TheiaConfig.cmake.in -+++ b/cmake/TheiaConfig.cmake.in -@@ -124,14 +124,7 @@ list(APPEND CERES_INCLUDE_DIR_HINTS @CERES_INCLUDE_DIR@) - get_filename_component(THEIA_BUILD_CERES_LIBRARY_DIR @CERES_LIBRARIES@ PATH) - list(APPEND CERES_LIBRARY_DIR_HINTS ${THEIA_BUILD_CERES_LIBRARY_DIR}) - # Search quietly s/t we control the timing of the error message if not found. --find_package(Ceres QUIET) --if (CERES_FOUND) -- message(STATUS "Found required Theia dependency: " -- "Ceres in ${CERES_INCLUDE_DIRS}") --else (CERES_FOUND) -- theia_report_not_found("Missing required Theia " -- "dependency: Ceres, please set CERES_INCLUDE_DIR.") --endif (CERES_FOUND) -+find_package(Ceres REQUIRED) - list(APPEND THEIA_INCLUDE_DIRS ${CERES_INCLUDE_DIRS}) - - # Glog. -@@ -140,64 +133,19 @@ list(APPEND GLOG_INCLUDE_DIR_HINTS @GLOG_INCLUDE_DIR@) - get_filename_component(THEIA_BUILD_GLOG_LIBRARY_DIR @GLOG_LIBRARY@ PATH) - list(APPEND GLOG_LIBRARY_DIR_HINTS ${THEIA_BUILD_GLOG_LIBRARY_DIR}) - # Search quietly s/t we control the timing of the error message if not found. --find_package(Glog QUIET) --if (GLOG_FOUND) -- message(STATUS "Found required Theia dependency: " -- "Glog in ${GLOG_INCLUDE_DIRS}") --else (GLOG_FOUND) -- theia_report_not_found("Missing required Theia " -- "dependency: Glog, please set GLOG_INCLUDE_DIR.") --endif (GLOG_FOUND) -+find_package(Glog REQUIRED) - list(APPEND THEIA_INCLUDE_DIRS ${GLOG_INCLUDE_DIRS}) - - # GFlags. The namespace patch is borrow from Ceres Solver (see license in - # FindGflags.cmake) --find_package(Gflags QUIET) --if (GFLAGS_FOUND) -- message(STATUS "Found required Theia dependency: Google Flags in " -- "${GFLAGS_INCLUDE_DIRS} in namespace: ${GFLAGS_NAMESPACE}") -- add_definitions(-DTHEIA_GFLAGS_NAMESPACE=${GFLAGS_NAMESPACE}) --else (GFLAGS_FOUND) -- theia_report_not_found("Missing required Theia dependency: Google Flags, please set " -- "GFLAGS_INCLUDE_DIR.") --endif (GFLAGS_FOUND) -+find_package(Gflags REQUIRED) - list(APPEND THEIA_INCLUDE_DIRS ${GFLAGS_INCLUDE_DIRS}) - - # OpenImageIO --find_package(OpenImageIO QUIET) --if (OPENIMAGEIO_FOUND) -- message(STATUS "Found Theia dependency: OpenImageIO in ${OPENIMAGEIO_INCLUDE_DIRS}") --else (OPENIMAGEIO_FOUND) -- theia_report_not_found("Missing required Theia dependency: OpenImageIO. Please set " -- "OPENIMAGEIO_INCLUDE_DIR & OPENIMAGEIO_LIBRARY") --endif (OPENIMAGEIO_FOUND) -+find_package(OpenImageIO REQUIRED) - list(APPEND THEIA_INCLUDE_DIRS ${OPENIMAGEIO_INCLUDE_DIRS}) - --find_package(SuiteSparse QUIET) --if (SUITESPARSE_FOUND) -- # On Ubuntu the system install of SuiteSparse (v3.4.0) up to at least -- # Ubuntu 13.10 cannot be used to link shared libraries. -- if (BUILD_SHARED_LIBS AND -- SUITESPARSE_IS_BROKEN_SHARED_LINKING_UBUNTU_SYSTEM_VERSION) -- theia_report_not_found("You are attempting to build Theia as a shared " -- "library on Ubuntu using a system package install of SuiteSparse " -- "3.4.0. This package is broken and does not support the " -- "construction of shared libraries (you can still build Theia as " -- "a static library). If you wish to build a shared version of Theia " -- "you should uninstall the system install of SuiteSparse " -- "(libsuitesparse-dev) and perform a source install of SuiteSparse " -- "(we recommend that you use the latest version), " -- "see http://theia-solver.org/building.html for more information.") -- endif (BUILD_SHARED_LIBS AND -- SUITESPARSE_IS_BROKEN_SHARED_LINKING_UBUNTU_SYSTEM_VERSION) -- message("-- Found SuiteSparse ${SUITESPARSE_VERSION}") -- add_definitions(-DTHEIA_SUITESPARSE_VERSION="${SUITESPARSE_VERSION}") --else (SUITESPARSE_FOUND) -- # Disable use of SuiteSparse if it cannot be found and continue. -- theia_report_not_found("Can't find SuiteSparse. This library is required " -- "for bundle adjustment and for solving convex optimization problems. " -- "Please set SUITESPARSE_INCLUDE_DIR & SUITESPARSE_LIBRARY") --endif (SUITESPARSE_FOUND) -+find_package(SuiteSparse REQUIRED) - list(APPEND THEIA_INCLUDE_DIRS ${SUITESPARSE_INCLUDE_DIRS}) - - # Import exported Theia targets. -@@ -207,22 +155,24 @@ endif (NOT TARGET theia AND NOT Theia_BINARY_DIR) - # Set the expected XX_LIBRARIES variable for FindPackage(). - set(THEIA_LIBRARIES theia) - -+find_package(cereal REQUIRED) -+list(APPEND THEIA_LIBRARIES cereal) -+ -+find_package(Flann REQUIRED) -+list(APPEND THEIA_INCLUDE_DIRS ${FLANN_INCLUDE_DIR}) -+list(APPEND THEIA_LIBRARIES ${FLANN_LIBRARY}) -+ - # Add the libraries included with the distribution. - set(THEIA_INTERNAL_LIB_PREFIX ${THEIA_INCLUDE_DIR}/theia/libraries) - set(THEIA_INTERNAL_LIBS_INCLUDES - ${THEIA_INTERNAL_LIB_PREFIX} - ${THEIA_INTERNAL_LIB_PREFIX}/akaze -- ${THEIA_INTERNAL_LIB_PREFIX}/cereal -- ${THEIA_INTERNAL_LIB_PREFIX}/cereal/include -- ${THEIA_INTERNAL_LIB_PREFIX}/flann -- ${THEIA_INTERNAL_LIB_PREFIX}/gtest -- ${THEIA_INTERNAL_LIB_PREFIX}/gtest/include - ${THEIA_INTERNAL_LIB_PREFIX}/optimo - ${THEIA_INTERNAL_LIB_PREFIX}/spectra - ${THEIA_INTERNAL_LIB_PREFIX}/statx - ${THEIA_INTERNAL_LIB_PREFIX}/stlplus3 -- ${THEIA_INTERNAL_LIB_PREFIX}/vlfeat -- ${THEIA_INTERNAL_LIB_PREFIX}/visual_sfm) -+ ${THEIA_INTERNAL_LIB_PREFIX}/visual_sfm -+ ${THEIA_INTERNAL_LIB_PREFIX}/vlfeat) - - list(APPEND THEIA_INCLUDE_DIRS ${THEIA_INTERNAL_LIBS_INCLUDES}) - -diff --git a/libraries/CMakeLists.txt b/libraries/CMakeLists.txt -index 84f3829..f88d75a 100644 ---- a/libraries/CMakeLists.txt -+++ b/libraries/CMakeLists.txt -@@ -5,12 +5,6 @@ endif (${BUILD_TESTING}) - # AKAZE feature extractor. - add_subdirectory(akaze) - --# Cereal for portable IO. --add_subdirectory(cereal) -- --# Flann for fast approximate nearest neighbor searches. --add_subdirectory(flann) -- - # Add Optimo. - add_subdirectory(optimo) - -@@ -24,4 +18,4 @@ add_subdirectory(stlplus3) - add_subdirectory(vlfeat) - - # Add VisualSfM files. --add_subdirectory(visual_sfm) -\ No newline at end of file -+add_subdirectory(visual_sfm) -diff --git a/libraries/optimo/CMakeLists.txt b/libraries/optimo/CMakeLists.txt -index 80f5e5f..ea57f1b 100644 ---- a/libraries/optimo/CMakeLists.txt -+++ b/libraries/optimo/CMakeLists.txt -@@ -67,11 +67,11 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) - - # Locations to search for Eigen - # Eigen --find_package(Eigen REQUIRED) --if (EIGEN_FOUND) -- message("-- Found Eigen version ${EIGEN_VERSION}: ${EIGEN_INCLUDE_DIRS}") --endif (EIGEN_FOUND) --include_directories(${EIGEN_INCLUDE_DIRS}) -+find_package(Eigen3 REQUIRED) -+if (EIGEN3_FOUND) -+ message("-- Found Eigen version ${EIGEN3_VERSION_STRING}: ${EIGEN3_INCLUDE_DIRS}") -+endif (EIGEN3_FOUND) -+include_directories(${EIGEN3_INCLUDE_DIRS}) - - # Setting CXX FLAGS appropriately. The code below was inspired from - # Google CERES and modified for this library. -diff --git a/libraries/statx/CMakeLists.txt b/libraries/statx/CMakeLists.txt -index 23b9e49..c58a550 100644 ---- a/libraries/statx/CMakeLists.txt -+++ b/libraries/statx/CMakeLists.txt -@@ -72,11 +72,11 @@ message("-- Default Install prefix: ${CMAKE_INSTALL_PREFIX}") - option(STATX_WITH_CERES "Enables GEV parameter estimation using Ceres" ON) - - # Eigen --find_package(Eigen REQUIRED) --if (EIGEN_FOUND) -- message("-- Found Eigen version ${EIGEN_VERSION}: ${EIGEN_INCLUDE_DIRS}") --endif (EIGEN_FOUND) --include_directories(${EIGEN_INCLUDE_DIRS}) -+find_package(Eigen3 REQUIRED) -+if (EIGEN3_FOUND) -+ message("-- Found Eigen version ${EIGEN3_VERSION_STRING}: ${EIGEN3_INCLUDE_DIRS}") -+endif (EIGEN3_FOUND) -+include_directories(${EIGEN3_INCLUDE_DIRS}) - - # Google Flags - find_package(Gflags REQUIRED) -@@ -103,7 +103,11 @@ if(STATX_WITH_CERES) - endif(CERES_FOUND) - - # BLAS -- find_package(BLAS REQUIRED) -+ if(UNIX AND NOT APPLE) -+ find_package(OpenBLAS REQUIRED) -+ else() -+ find_package(BLAS REQUIRED) -+ endif() - - # LAPACK - find_package(LAPACK REQUIRED) -@@ -129,7 +133,6 @@ set(XGAMMA_FILES ${XGAMMA_FUNCS}/asa121.cpp ${XGAMMA_FUNCS}/asa103.cpp) - - # Setting CXX FLAGS appropriately. The code below was inspired from - # Google CERES and modified for this library. --set (CMAKE_BUILD_TYPE Release) - set (STATX_CXX_FLAGS) - - if (CMAKE_BUILD_TYPE STREQUAL "Release") -diff --git a/libraries/vlfeat/CMakeLists.txt b/libraries/vlfeat/CMakeLists.txt -index 7f4ffc7..15bca12 100644 ---- a/libraries/vlfeat/CMakeLists.txt -+++ b/libraries/vlfeat/CMakeLists.txt -@@ -18,14 +18,19 @@ set(vl_sources - vl/random.c - vl/sift.c - vl/vlad.c) -+ - set_source_files_properties(${vl_sources} PROPERTIES LANGUAGE C) - -+add_library(vlfeat ${vl_sources}) -+ - if (MSVC) -- add_definitions(-DVL_BUILD_DLL) -- add_definitions(-DVL_DISABLE_SSE2) -+ if(BUILD_SHARED_LIBS) -+ target_compile_definitions(vlfeat PRIVATE VL_BUILD_DLL) -+ target_compile_definitions(vlfeat INTERFACE BUILD_DLL) -+ endif() -+ target_compile_definitions(vlfeat PUBLIC VL_DISABLE_SSE2) - endif (MSVC) - --add_library(vlfeat SHARED ${vl_sources}) - install(TARGETS vlfeat - EXPORT TheiaExport - RUNTIME DESTINATION bin -diff --git a/libraries/vlfeat/vl/host.h b/libraries/vlfeat/vl/host.h -index 293fe1f..0ea3d42 100644 ---- a/libraries/vlfeat/vl/host.h -+++ b/libraries/vlfeat/vl/host.h -@@ -312,27 +312,31 @@ defined(__DOXYGEN__) - #if defined(VL_COMPILER_MSC) & ! defined(__DOXYGEN__) - # define VL_UNUSED - # define VL_INLINE static __inline --# define snprintf _snprintf - # define isnan _isnan --# ifdef VL_BUILD_DLL -+# if defined(VL_BUILD_DLL) - # ifdef __cplusplus - # define VL_EXPORT extern "C" __declspec(dllexport) - # else - # define VL_EXPORT extern __declspec(dllexport) - # endif --# else -+# elif defined(VL_DLL) - # ifdef __cplusplus - # define VL_EXPORT extern "C" __declspec(dllimport) - # else - # define VL_EXPORT extern __declspec(dllimport) - # endif -+# else -+# ifdef __cplusplus -+# define VL_EXPORT extern "C" -+# else -+# define VL_EXPORT extern -+# endif - # endif - #endif - - #if defined(VL_COMPILER_LCC) & ! defined(__DOXYGEN__) - # define VL_UNUSED - # define VL_INLINE static __inline --# define snprintf _snprintf - # define isnan _isnan - VL_INLINE float fabsf(float x) { return (float) fabs((double) x) ; } - # ifdef VL_BUILD_DLL -diff --git a/src/theia/CMakeLists.txt b/src/theia/CMakeLists.txt -index 6830f71..768586d 100644 ---- a/src/theia/CMakeLists.txt -+++ b/src/theia/CMakeLists.txt -@@ -209,7 +209,6 @@ set(THEIA_LIBRARY_DEPENDENCIES - ${SUITESPARSE_LIBRARIES} - ${OPENIMAGEIO_LIBRARIES} - akaze -- flann_cpp - statx - stlplus3 - vlfeat diff --git a/ports/theia/fix-external-dependencies2.patch b/ports/theia/fix-external-dependencies2.patch deleted file mode 100644 index f7026ba1aa36b5..00000000000000 --- a/ports/theia/fix-external-dependencies2.patch +++ /dev/null @@ -1,76 +0,0 @@ -diff --git a/cmake/TheiaConfig.cmake.in b/cmake/TheiaConfig.cmake.in -index 7e9d912..2a98124 100644 ---- a/cmake/TheiaConfig.cmake.in -+++ b/cmake/TheiaConfig.cmake.in -@@ -43,7 +43,7 @@ macro(THEIA_REPORT_NOT_FOUND REASON_MSG) - # use the camelcase library name, not uppercase. - if (Theia_FIND_QUIETLY) - message(STATUS "Failed to find Theia - " ${REASON_MSG} ${ARGN}) -- else (Theia_FIND_REQUIRED) -+ elseif (Theia_FIND_REQUIRED) - message(FATAL_ERROR "Failed to find Theia - " ${REASON_MSG} ${ARGN}) - else() - # Neither QUIETLY nor REQUIRED, use SEND_ERROR which emits an error -@@ -103,35 +103,35 @@ set(THEIA_INCLUDE_DIRS ${THEIA_INCLUDE_DIR}) - - # Eigen. - # Flag set during configuration and build of Theia. --set(THEIA_EIGEN_VERSION @EIGEN_VERSION@) -+set(THEIA_EIGEN_VERSION @EIGEN3_VERSION@) - # Append the locations of Eigen when Theia was built to the search path hints. --list(APPEND EIGEN_INCLUDE_DIR_HINTS @EIGEN_INCLUDE_DIR@) -+list(APPEND EIGEN_INCLUDE_DIR_HINTS @EIGEN3_INCLUDE_DIR@) - # Search quietly s/t we control the timing of the error message if not found. --find_package(Eigen ${THEIA_EIGEN_VERSION} EXACT QUIET) --if (EIGEN_FOUND) -+find_package(Eigen3 ${THEIA_EIGEN_VERSION} REQUIRED) -+if (EIGEN3_FOUND) - message(STATUS "Found required Theia dependency: " -- "Eigen version ${THEIA_EIGEN_VERSION} in ${EIGEN_INCLUDE_DIRS}") --else (EIGEN_FOUND) -+ "Eigen version ${THEIA_EIGEN_VERSION} in ${EIGEN3_INCLUDE_DIRS}") -+else (EIGEN3_FOUND) - theia_report_not_found("Missing required Theia " - "dependency: Eigen version ${THEIA_EIGEN_VERSION}, please set " - "EIGEN_INCLUDE_DIR.") --endif (EIGEN_FOUND) --list(APPEND THEIA_INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS}) -+endif (EIGEN3_FOUND) -+list(APPEND THEIA_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIRS}) - - # Ceres. - # Append the locations of ceres when Theia was built to the search path hints. --list(APPEND CERES_INCLUDE_DIR_HINTS @CERES_INCLUDE_DIR@) --get_filename_component(THEIA_BUILD_CERES_LIBRARY_DIR @CERES_LIBRARIES@ PATH) --list(APPEND CERES_LIBRARY_DIR_HINTS ${THEIA_BUILD_CERES_LIBRARY_DIR}) -+#list(APPEND CERES_INCLUDE_DIR_HINTS @CERES_INCLUDE_DIR@) -+#get_filename_component(THEIA_BUILD_CERES_LIBRARY_DIR @CERES_LIBRARIES@ PATH) -+#list(APPEND CERES_LIBRARY_DIR_HINTS ${THEIA_BUILD_CERES_LIBRARY_DIR}) - # Search quietly s/t we control the timing of the error message if not found. - find_package(Ceres REQUIRED) - list(APPEND THEIA_INCLUDE_DIRS ${CERES_INCLUDE_DIRS}) - - # Glog. - # Append the locations of glog when Theia was built to the search path hints. --list(APPEND GLOG_INCLUDE_DIR_HINTS @GLOG_INCLUDE_DIR@) --get_filename_component(THEIA_BUILD_GLOG_LIBRARY_DIR @GLOG_LIBRARY@ PATH) --list(APPEND GLOG_LIBRARY_DIR_HINTS ${THEIA_BUILD_GLOG_LIBRARY_DIR}) -+#list(APPEND GLOG_INCLUDE_DIR_HINTS @GLOG_INCLUDE_DIR@) -+#get_filename_component(THEIA_BUILD_GLOG_LIBRARY_DIR @GLOG_LIBRARY@ PATH) -+#list(APPEND GLOG_LIBRARY_DIR_HINTS ${THEIA_BUILD_GLOG_LIBRARY_DIR}) - # Search quietly s/t we control the timing of the error message if not found. - find_package(Glog REQUIRED) - list(APPEND THEIA_INCLUDE_DIRS ${GLOG_INCLUDE_DIRS}) -diff --git a/src/theia/CMakeLists.txt b/src/theia/CMakeLists.txt -index 768586d..c1f6593 100644 ---- a/src/theia/CMakeLists.txt -+++ b/src/theia/CMakeLists.txt -@@ -207,7 +207,7 @@ set(THEIA_LIBRARY_DEPENDENCIES - ${GFLAGS_LIBRARIES} - ${GLOG_LIBRARIES} - ${SUITESPARSE_LIBRARIES} -- ${OPENIMAGEIO_LIBRARIES} -+ OpenImageIO::OpenImageIO - akaze - statx - stlplus3 diff --git a/ports/theia/fix-last-openimageio.patch b/ports/theia/fix-last-openimageio.patch deleted file mode 100644 index 21c596fa722b6a..00000000000000 --- a/ports/theia/fix-last-openimageio.patch +++ /dev/null @@ -1,44 +0,0 @@ -diff --git a/src/theia/image/image.cc b/src/theia/image/image.cc -index 6175a1f..18cb59b 100644 ---- a/src/theia/image/image.cc -+++ b/src/theia/image/image.cc -@@ -296,7 +296,7 @@ FloatImage FloatImage::ComputeGradient() const { - - void FloatImage::ApproximateGaussianBlur(const int kernel_size) { - oiio::ImageBuf kernel; -- oiio::ImageBufAlgo::make_kernel(kernel, "gaussian", -+ oiio::ImageBufAlgo::make_kernel("gaussian", - static_cast(kernel_size), - static_cast(kernel_size)); - oiio::ImageBufAlgo::convolve(image_, image_, kernel); -diff --git a/src/theia/sfm/exif_reader.cc b/src/theia/sfm/exif_reader.cc -index c63465a..6b0e702 100644 ---- a/src/theia/sfm/exif_reader.cc -+++ b/src/theia/sfm/exif_reader.cc -@@ -150,7 +150,7 @@ bool ExifReader::ExtractEXIFMetadata( - camera_intrinsics_prior->focal_length.is_set = true; - - // Set GPS latitude. -- const oiio::ImageIOParameter* latitude = -+ const OIIO::ParamValue* latitude = - image_spec.find_attribute("GPS:Latitude"); - if (latitude != nullptr) { - camera_intrinsics_prior->latitude.is_set = true; -@@ -169,7 +169,7 @@ bool ExifReader::ExtractEXIFMetadata( - } - - // Set GPS longitude. -- const oiio::ImageIOParameter* longitude = -+ const OIIO::ParamValue* longitude = - image_spec.find_attribute("GPS:Longitude"); - if (longitude != nullptr) { - camera_intrinsics_prior->longitude.is_set = true; -@@ -189,7 +189,7 @@ bool ExifReader::ExtractEXIFMetadata( - - - // Set GSP altitude. -- const oiio::ImageIOParameter* altitude = -+ const OIIO::ParamValue* altitude = - image_spec.find_attribute("GPS:Altitude"); - if (altitude != nullptr) { - camera_intrinsics_prior->altitude.is_set = true; diff --git a/ports/theia/portfile.cmake b/ports/theia/portfile.cmake deleted file mode 100644 index 84f493f16f31e0..00000000000000 --- a/ports/theia/portfile.cmake +++ /dev/null @@ -1,57 +0,0 @@ -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO sweeneychris/TheiaSfM - REF v0.8 - SHA512 2f620389c415badec36f4b44be0378fc62761dd6b2ee4cd7033b13573c372f098e248553575fb2cceb757b1ca00e86a11c67e03b6077e0a4b0f8797065746312 - HEAD_REF master - PATCHES - fix-external-dependencies.patch - fix-external-dependencies2.patch - eigen-3.4.patch - 266.diff - fix-last-openimageio.patch - ceres-manifold.patch -) - -file(REMOVE "${SOURCE_PATH}/cmake/FindSuiteSparse.cmake") -file(REMOVE "${SOURCE_PATH}/cmake/FindOpenImageIO.cmake") -file(REMOVE "${SOURCE_PATH}/cmake/FindGflags.cmake") -file(REMOVE "${SOURCE_PATH}/cmake/FindGlog.cmake") -file(REMOVE "${SOURCE_PATH}/cmake/FindEigen.cmake") - -vcpkg_cmake_configure( - SOURCE_PATH "${SOURCE_PATH}" - OPTIONS - -DCMAKE_CXX_STANDARD=14 - -DCMAKE_CXX_EXTENSIONS=OFF - -DCMAKE_CXX_STANDARD_REQUIRED=ON - -DBUILD_TESTING=OFF - -DTHEIA_USE_EXTERNAL_CEREAL=ON - -DTHEIA_USE_EXTERNAL_FLANN=ON - -DCMAKE_POLICY_DEFAULT_CMP0012=NEW - -DCMAKE_POLICY_DEFAULT_CMP0057=NEW - MAYBE_UNUSED_VARIABLES - CMAKE_POLICY_DEFAULT_CMP0012 - THEIA_USE_EXTERNAL_CEREAL - THEIA_USE_EXTERNAL_FLANN -) - -vcpkg_cmake_install() -vcpkg_cmake_config_fixup() -vcpkg_copy_pdbs() - -# Clean -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/optimo") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/optimo") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/theia/libraries/akaze/cimg/cmake-modules") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/theia/libraries/akaze/cmake") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/theia/libraries/akaze/datasets") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/theia/libraries/spectra/doxygen") - -# Handle copyright -vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/license.txt") -file(COPY "${SOURCE_PATH}/data/camera_sensor_database_license.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") diff --git a/ports/theia/vcpkg.json b/ports/theia/vcpkg.json deleted file mode 100644 index 03cb2da5e9181b..00000000000000 --- a/ports/theia/vcpkg.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "theia", - "version": "0.8", - "port-version": 13, - "description": "An open source library for multiview geometry and structure from motion", - "homepage": "https://github.com/sweeneychris/TheiaSfM", - "license": "BSD-3-Clause", - "supports": "!uwp & !arm & !(windows & x86)", - "dependencies": [ - "cereal", - { - "name": "ceres", - "features": [ - "suitesparse" - ] - }, - "flann", - { - "name": "freeglut", - "platform": "!osx" - }, - "glew", - { - "name": "openimageio", - "features": [ - "viewer" - ] - }, - { - "name": "vcpkg-cmake", - "host": true - }, - { - "name": "vcpkg-cmake-config", - "host": true - } - ] -} diff --git a/versions/baseline.json b/versions/baseline.json index 873f759b931c59..ae37be04578a4b 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1516,10 +1516,6 @@ "baseline": "1.2.0", "port-version": 0 }, - "cartographer": { - "baseline": "2.0.0", - "port-version": 0 - }, "casadi": { "baseline": "3.6.7", "port-version": 0 @@ -8908,10 +8904,6 @@ "baseline": "1.1.0", "port-version": 1 }, - "theia": { - "baseline": "0.8", - "port-version": 13 - }, "think-cell-range": { "baseline": "2023.1", "port-version": 1 diff --git a/versions/c-/cartographer.json b/versions/c-/cartographer.json index fd27c5ea458c34..4f60b8c9abf8a6 100644 --- a/versions/c-/cartographer.json +++ b/versions/c-/cartographer.json @@ -1,10 +1,5 @@ { "versions": [ - { - "git-tree": "b98a382a2dd9435fe755b0960e7acefe07df4037", - "version": "2.0.0", - "port-version": 0 - }, { "git-tree": "917d4ac19da5414db7ad690f8f315821b94a40ba", "version": "1.0.0", diff --git a/versions/t-/theia.json b/versions/t-/theia.json index 37e7ef5541b2ef..6da34965a18c73 100644 --- a/versions/t-/theia.json +++ b/versions/t-/theia.json @@ -1,10 +1,5 @@ { "versions": [ - { - "git-tree": "8a204a8d80c0eea41176e6824406b28fe28c3b5c", - "version": "0.8", - "port-version": 13 - }, { "git-tree": "fcce9342a3c7301139dd9d9a388657d99fdcc159", "version": "0.8", From b5b3e51ed5fa7fdac6d62ab685cdbc70481b0090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 11 Dec 2024 07:34:26 +0100 Subject: [PATCH 63/67] Update ports/openmvg/portfile.cmake Co-authored-by: Kai Pastor --- ports/openmvg/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/openmvg/portfile.cmake b/ports/openmvg/portfile.cmake index 179c1395257bbe..e1067ff4fa9e54 100644 --- a/ports/openmvg/portfile.cmake +++ b/ports/openmvg/portfile.cmake @@ -76,9 +76,9 @@ vcpkg_cmake_configure( vcpkg_cmake_install() -make_directory("${CURRENT_PACKAGES_DIR}/share/openMVG/") +file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/openMVG/") file(RENAME "${CURRENT_PACKAGES_DIR}/lib/openMVG/cmake" "${CURRENT_PACKAGES_DIR}/share/openMVG/cmake") -make_directory("${CURRENT_PACKAGES_DIR}/debug/share/openMVG/") +file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/share/openMVG/") file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/openMVG/cmake" "${CURRENT_PACKAGES_DIR}/debug/share/openMVG/cmake") vcpkg_cmake_config_fixup() From 278d0475b7f142b97b428ef8cbd8425f3c61a011 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 11 Dec 2024 07:38:49 +0100 Subject: [PATCH 64/67] d --- scripts/ci.baseline.txt | 1 - versions/o-/openmvg.json | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 65bad00886b7f6..03d4a44fb9e001 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -846,7 +846,6 @@ openmesh:x64-uwp=fail openmpi:arm-neon-android=fail openmpi:arm64-android=fail openmpi:x64-android=fail -openmvg:x64-linux=fail openmvg:arm64-windows-static-md=fail openmvs:arm64-windows-static-md=fail openscap:arm-neon-android=fail diff --git a/versions/o-/openmvg.json b/versions/o-/openmvg.json index 5f10f12a84715e..a2a3d178481095 100644 --- a/versions/o-/openmvg.json +++ b/versions/o-/openmvg.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "28c8872842fd1bac86010c5a235831d25b6f8add", + "git-tree": "897ab1ecaccba02608f2a36ebc8072548aa6c395", "version": "2.1", "port-version": 0 }, From 4301643025605108445100e2269df560b7a8fc38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 11 Dec 2024 17:20:23 +0100 Subject: [PATCH 65/67] d --- scripts/ci.baseline.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 03d4a44fb9e001..65bad00886b7f6 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -846,6 +846,7 @@ openmesh:x64-uwp=fail openmpi:arm-neon-android=fail openmpi:arm64-android=fail openmpi:x64-android=fail +openmvg:x64-linux=fail openmvg:arm64-windows-static-md=fail openmvs:arm64-windows-static-md=fail openscap:arm-neon-android=fail From 6b564c2dcf59e16b256ac6647b98195588e1b6df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Fri, 13 Dec 2024 09:53:03 +0100 Subject: [PATCH 66/67] d --- ports/rtabmap/vcpkg.json | 2 +- versions/baseline.json | 2 +- versions/r-/rtabmap.json | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ports/rtabmap/vcpkg.json b/ports/rtabmap/vcpkg.json index 928ed827a9734f..172663a521a482 100644 --- a/ports/rtabmap/vcpkg.json +++ b/ports/rtabmap/vcpkg.json @@ -1,7 +1,7 @@ { "name": "rtabmap", "version": "0.21.4.1", - "port-version": 3, + "port-version": 4, "description": "Real-Time Appearance-Based Mapping", "homepage": "https://introlab.github.io/rtabmap/", "license": null, diff --git a/versions/baseline.json b/versions/baseline.json index 05008f5438a287..471ad640965cf1 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -8046,7 +8046,7 @@ }, "rtabmap": { "baseline": "0.21.4.1", - "port-version": 3 + "port-version": 4 }, "rtabmap-res-tool": { "baseline": "0.21.4.1", diff --git a/versions/r-/rtabmap.json b/versions/r-/rtabmap.json index d71504e721e381..fc88ff261744fa 100644 --- a/versions/r-/rtabmap.json +++ b/versions/r-/rtabmap.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "118628a16f27821275f03865c6863075ad35e3fd", + "version": "0.21.4.1", + "port-version": 4 + }, { "git-tree": "9bab9b050ad5e8db991955d2905f95cc5ce4a1ff", "version": "0.21.4.1", From 54ea59f7ae44e9b55ed8bd369477993f265d89ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Fri, 13 Dec 2024 09:55:40 +0100 Subject: [PATCH 67/67] d --- versions/r-/rtabmap.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/r-/rtabmap.json b/versions/r-/rtabmap.json index fc88ff261744fa..22a77095a81cfe 100644 --- a/versions/r-/rtabmap.json +++ b/versions/r-/rtabmap.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "118628a16f27821275f03865c6863075ad35e3fd", + "git-tree": "8095952b0fbd2d24600e3314c345184503634e8f", "version": "0.21.4.1", "port-version": 4 },