Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ceres] update to 2.2.0 #35021

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ports/ceres/0002_use_glog_target.patch
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
diff --git a/internal/ceres/CMakeLists.txt b/internal/ceres/CMakeLists.txt
index 0e33263..299b373 100644
index f9fc241..0aaabe4 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})
Expand Down
79 changes: 26 additions & 53 deletions ports/ceres/0003_fix_exported_ceres_config.patch
Original file line number Diff line number Diff line change
@@ -1,65 +1,38 @@
diff --git a/cmake/CeresConfig.cmake.in b/cmake/CeresConfig.cmake.in
index 4745483..b55462d 100644
index ceb7e26..9ed95c9 100644
--- a/cmake/CeresConfig.cmake.in
+++ b/cmake/CeresConfig.cmake.in
@@ -217,55 +217,14 @@ else (Eigen3_FOUND)
@@ -217,6 +217,7 @@ else (Eigen3_FOUND)
endif (Eigen3_FOUND)

# glog (and maybe gflags).
-#
-# Flags set during configuration and build of Ceres.
-set(CERES_USES_MINIGLOG @MINIGLOG@)
-set(CERES_GLOG_VERSION @glog_VERSION@)
-set(CERES_GLOG_WAS_BUILT_WITH_CMAKE @FOUND_INSTALLED_GLOG_CMAKE_CONFIGURATION@)
-
-set(CERES_USES_GFLAGS @GFLAGS@)
-set(CERES_GFLAGS_VERSION @gflags_VERSION@)
-
-if (CERES_USES_MINIGLOG)
- # Output message at standard log level (not the lower STATUS) so that
- # the message is output in GUI during configuration to warn user.
- ceres_message("-- Found Ceres compiled with miniglog substitute "
- "for glog, beware this will likely cause problems if glog is later linked.")
-else(CERES_USES_MINIGLOG)
- if (CERES_GLOG_WAS_BUILT_WITH_CMAKE)
- find_package(glog ${CERES_GLOG_VERSION} CONFIG QUIET)
- set(GLOG_FOUND ${glog_FOUND})
- else()
- # Version of glog against which Ceres was built was not built with CMake,
- # use the exported glog find_package() module from Ceres to find it again.
- # Append the locations of glog when Ceres was built to the search path hints.
- list(APPEND GLOG_INCLUDE_DIR_HINTS "@GLOG_INCLUDE_DIR@")
- get_filename_component(CERES_BUILD_GLOG_LIBRARY_DIR "@GLOG_LIBRARY@" PATH)
- list(APPEND GLOG_LIBRARY_DIR_HINTS ${CERES_BUILD_GLOG_LIBRARY_DIR})
-
- # 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()
+if(0)
#
# Flags set during configuration and build of Ceres.
set(CERES_USES_MINIGLOG @MINIGLOG@)
@@ -266,6 +267,26 @@ else(CERES_USES_MINIGLOG)
endif()
endif()
endif(CERES_USES_MINIGLOG)
+endif(0)
+
+include (CMakeFindDependencyMacro)
+find_dependency (Eigen3)
+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)
- # Search quietly s/t we control the timing of the error message if not found.
- find_package(gflags ${CERES_GFLAGS_VERSION} QUIET)
- if (gflags_FOUND AND TARGET gflags)
- ceres_message(STATUS "Found required Ceres dependency: gflags")
- else()
- ceres_report_not_found("Missing required Ceres "
- "dependency: gflags (not found, or not found as exported CMake target).")
- endif()
- endif()
-endif(CERES_USES_MINIGLOG)
+# SuiteSparse
+if (@EIGENSPARSE@)
+ find_dependency (metis CONFIG)
+endif()
+if (@SUITESPARSE@)
+ find_dependency(SuiteSparse CONFIG)
+ find_dependency(SuiteSparse CONFIG)
+endif()
+if (@LAPACK@)
+ find_dependency(LAPACK)
+endif()
+if (@USE_CUDA@)
+ find_dependency(CUDA)
+endif()
+if (@GFLAGS@)
+ find_dependency(gflags)
+endif()

# Import exported Ceres targets, if they have not already been imported.
Expand Down
101 changes: 36 additions & 65 deletions ports/ceres/find-package-required.patch
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2d241fe..b79454d 100644
index 3a0debc..6997dac 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -244,7 +244,7 @@ else (CUDA)
endif (CUDA)
@@ -270,7 +270,7 @@ if (NOT USE_CUDA)
endif (NOT USE_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)
@@ -292,8 +292,7 @@ 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)
- find_package(SuiteSparse 4.5.6 COMPONENTS CHOLMOD SPQR
- OPTIONAL_COMPONENTS Partition)
+ find_package(SuiteSparse NAMES suitesparse REQUIRED)
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)
@@ -301,11 +300,11 @@ if (SUITESPARSE)
message("-- Found SuiteSparse ${SuiteSparse_VERSION}, "
"building with SuiteSparse.")

Expand All @@ -35,78 +35,49 @@ index 2d241fe..b79454d 100644
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.")
@@ -323,7 +322,7 @@ if (NOT SuiteSparse_Partition_FOUND)
endif (NOT SuiteSparse_Partition_FOUND)

- if (CXSparse_NO_CMAKE OR NOT CXSparse_DIR)
if (EIGENMETIS)
- find_package (METIS)
+ find_package(METIS NAMES metis REQUIRED)
if (METIS_FOUND)
# Since METIS is a private dependency of Ceres, it requires access to the
# link-only METIS::METIS target to avoid undefined linker errors in projects
@@ -331,10 +330,10 @@ if (EIGENMETIS)
# the link libraries (such as include directories.)
set(METIS_DEPENDENCY "find_dependency(METIS ${METIS_VERSION})")
# METIS find module must be installed unless a package config is being used.
- if (NOT METIS_DIR)
+ if (0)
install(FILES ${Ceres_SOURCE_DIR}/cmake/FindCXSparse.cmake
install(FILES ${Ceres_SOURCE_DIR}/cmake/FindMETIS.cmake
DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR})
- endif (CXSparse_NO_CMAKE OR NOT CXSparse_DIR)
- endif (NOT METIS_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)
Cheney-W marked this conversation as resolved.
Show resolved Hide resolved
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)
else (METIS_FOUND)
message("-- Did not find METIS, disabling Eigen METIS support.")
update_cache_variable(EIGENMETIS OFF)
diff --git a/internal/ceres/CMakeLists.txt b/internal/ceres/CMakeLists.txt
index 299b373..33d41d8 100644
index 0aaabe4..0035a70 100644
--- a/internal/ceres/CMakeLists.txt
+++ b/internal/ceres/CMakeLists.txt
@@ -108,14 +108,14 @@ endif (NOT MINIGLOG)
@@ -92,8 +92,8 @@ 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)
if (SuiteSparse_Partition_FOUND)
list(APPEND CERES_LIBRARY_PRIVATE_DEPENDENCIES SuiteSparse::Partition)
@@ -103,7 +103,7 @@ endif (SUITESPARSE AND SuiteSparse_FOUND)
if (SuiteSparse_Partition_FOUND OR EIGENMETIS)
# 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)
add_definitions(-DCERES_METIS_VERSION="${METIS_VERSION}")
- list(APPEND CERES_LIBRARY_PRIVATE_DEPENDENCIES METIS::METIS)
+ list(APPEND CERES_LIBRARY_PRIVATE_DEPENDENCIES metis)
endif (SuiteSparse_Partition_FOUND OR EIGENMETIS)

if (ACCELERATESPARSE AND AccelerateSparse_FOUND)
16 changes: 7 additions & 9 deletions ports/ceres/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ceres-solver/ceres-solver
REF f68321e7de8929fbcdb95dd42877531e64f72f66 #2.1.0
SHA512 67bbd8a9385a40fe69d118fbc84da0fcc9aa1fbe14dd52f5403ed09686504213a1d931e95a1a0148d293b27ab5ce7c1d618fbf2e8fed95f2bbafab851a1ef449
REF "${VERSION}"
SHA512 d4cefe5851e25bd3c7b76352092d8d549eb371af2e35a325736554c54fe58a3523658697c3e2d65af660fe6895ae3d96fe31bd1875870474fc4b6fed3bbdfae9
HEAD_REF master
PATCHES
0001_cmakelists_fixes.patch
Expand All @@ -19,21 +19,17 @@ vcpkg_from_github(
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")
file(REMOVE "${SOURCE_PATH}/cmake/FindSuiteSparse.cmake")
file(REMOVE "${SOURCE_PATH}/cmake/FindMETIS.cmake")

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
"suitesparse" SUITESPARSE
"cxsparse" CXSPARSE
"lapack" LAPACK
"eigensparse" EIGENSPARSE
"tools" GFLAGS
"cuda" CUDA
"cuda" USE_CUDA
)
if(VCPKG_TARGET_IS_UWP)
list(APPEND FEATURE_OPTIONS -DMINIGLOG=ON)
Expand All @@ -58,10 +54,12 @@ vcpkg_cmake_configure(
-DBUILD_BENCHMARKS=OFF
-DBUILD_EXAMPLES=OFF
-DBUILD_TESTING=OFF
-DBUILD_BENCHMARKS=OFF
-DPROVIDE_UNINSTALL_TARGET=OFF
-DMSVC_USE_STATIC_CRT=${MSVC_USE_STATIC_CRT_VALUE}
-DLIB_SUFFIX=${LIB_SUFFIX}
MAYBE_UNUSED_VARIABLES
MSVC_USE_STATIC_CRT
LIB_SUFFIX
)

vcpkg_cmake_install()
Expand All @@ -73,4 +71,4 @@ vcpkg_copy_pdbs()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
17 changes: 4 additions & 13 deletions ports/ceres/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "ceres",
"version": "2.1.0",
"port-version": 4,
"version": "2.2.0",
"description": "non-linear optimization package",
"homepage": "https://github.com/ceres-solver/ceres-solver",
"license": "Apache-2.0",
Expand All @@ -28,20 +27,12 @@
"cuda"
]
},
"cxsparse": {
"description": "CXSparse support for Ceres",
"eigensparse": {
"description": "Use of Eigen as a sparse linear algebra library in Ceres",
"dependencies": [
{
"name": "ceres",
"features": [
"suitesparse"
]
}
"metis"
]
},
"eigensparse": {
"description": "Use of Eigen as a sparse linear algebra library in Ceres"
},
"lapack": {
"description": "Use Lapack in Ceres",
"dependencies": [
Expand Down
3 changes: 1 addition & 2 deletions ports/openmvg/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "openmvg",
"version": "2.0",
"port-version": 9,
"port-version": 10,
"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",
Expand All @@ -10,7 +10,6 @@
{
"name": "ceres",
"features": [
"cxsparse",
"suitesparse"
]
},
Expand Down
6 changes: 3 additions & 3 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -1501,8 +1501,8 @@
"port-version": 1
},
"ceres": {
"baseline": "2.1.0",
"port-version": 4
"baseline": "2.2.0",
"port-version": 0
},
"cfitsio": {
"baseline": "3.49",
Expand Down Expand Up @@ -6270,7 +6270,7 @@
},
"openmvg": {
"baseline": "2.0",
"port-version": 9
"port-version": 10
},
"openmvs": {
"baseline": "2.1.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/c-/ceres.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "8b88d8faef984aaa9604acd4c2d667ad1ac34566",
"version": "2.2.0",
"port-version": 0
},
{
"git-tree": "b2ebeb85c8833b2631210c4b790204151e402981",
"version": "2.1.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/o-/openmvg.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "da716bd3be4f20bd96fd253e86dae2e99abd0933",
"version": "2.0",
"port-version": 10
},
{
"git-tree": "6ddaa3bedcc57eb498c9e180bb8546a2726a1ddc",
"version": "2.0",
Expand Down
Loading