From 0e4d6f084f95584b7fc7460509821115f1868d30 Mon Sep 17 00:00:00 2001 From: ras0219 <533828+ras0219@users.noreply.github.com> Date: Fri, 22 Jan 2021 12:25:40 -0800 Subject: [PATCH] [ceres] Mark all dependencies REQUIRED (#15802) * [ceres] Mark all dependencies REQUIRED * [suitesparse] Fix FindCXSparse.cmake * [ceres] Add version to db Co-authored-by: Robert Schumacher --- ports/ceres/find-package-required.patch | 58 +++++++++++++++++++++++++ ports/ceres/portfile.cmake | 1 + ports/ceres/vcpkg.json | 4 +- ports/suitesparse/CONTROL | 5 --- ports/suitesparse/FindCXSparse.cmake | 8 ++-- ports/suitesparse/vcpkg.json | 11 +++++ versions/baseline.json | 4 +- versions/c-/ceres.json | 5 +++ versions/s-/suitesparse.json | 5 +++ 9 files changed, 87 insertions(+), 14 deletions(-) create mode 100644 ports/ceres/find-package-required.patch delete mode 100644 ports/suitesparse/CONTROL create mode 100644 ports/suitesparse/vcpkg.json diff --git a/ports/ceres/find-package-required.patch b/ports/ceres/find-package-required.patch new file mode 100644 index 00000000000000..aae9cccdd47aa3 --- /dev/null +++ b/ports/ceres/find-package-required.patch @@ -0,0 +1,58 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b6a3d05..a78c027 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -245,7 +245,7 @@ if (EIGEN3_FOUND) + endif (EIGEN3_FOUND) + + if (LAPACK) +- find_package(LAPACK QUIET) ++ find_package(LAPACK REQUIRED) + if (LAPACK_FOUND) + message("-- Found LAPACK library: ${LAPACK_LIBRARIES}") + else (LAPACK_FOUND) +@@ -263,7 +263,7 @@ if (SUITESPARSE) + # built with SuiteSparse support. + + # Check for SuiteSparse and dependencies. +- find_package(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. +@@ -300,7 +300,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) + # By default, if CXSparse and all dependencies are found, Ceres is + # built with CXSparse support. +@@ -336,7 +336,7 @@ endif(NOT SUITESPARSE AND NOT CXSPARSE AND NOT EIGENSPARSE) + # GFlags. + if (GFLAGS) + # Don't search with REQUIRED as we can continue without gflags. +- find_package(gflags 2.2.0) ++ find_package(gflags REQUIRED) + if (gflags_FOUND) + if (TARGET gflags) + message("-- Found Google Flags (gflags) version ${gflags_VERSION}: ${gflags_DIR}") +@@ -537,7 +537,7 @@ else (NOT OPENMP AND NOT TBB AND NOT CXX11_THREADS) + set_ceres_threading_model("${CERES_THREADING_MODEL}") + + if (BUILD_BENCHMARKS) +- find_package(benchmark QUIET) ++ find_package(benchmark REQUIRED) + if (benchmark_FOUND) + message("-- Found Google benchmark library. Building Ceres benchmarks.") + else() +@@ -782,7 +782,7 @@ if (BUILD_DOCUMENTATION) + set(CERES_DOCS_INSTALL_DIR "share/doc/ceres" CACHE STRING + "Ceres docs install path relative to CMAKE_INSTALL_PREFIX") + +- find_package(Sphinx QUIET) ++ find_package(Sphinx REQUIRED) + if (NOT SPHINX_FOUND) + message("-- Failed to find Sphinx, disabling build of documentation.") + update_cache_variable(BUILD_DOCUMENTATION OFF) diff --git a/ports/ceres/portfile.cmake b/ports/ceres/portfile.cmake index e581306236a28b..6b67a7797b7ee8 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 + find-package-required.patch ) file(REMOVE ${SOURCE_PATH}/cmake/FindCXSparse.cmake) diff --git a/ports/ceres/vcpkg.json b/ports/ceres/vcpkg.json index d89a0179f90fa3..55e5b30e1752d1 100644 --- a/ports/ceres/vcpkg.json +++ b/ports/ceres/vcpkg.json @@ -1,7 +1,7 @@ { "name": "ceres", - "version-string": "2.0.0", - "port-version": 2, + "version-semver": "2.0.0", + "port-version": 3, "description": "non-linear optimization package", "homepage": "https://github.com/ceres-solver/ceres-solver", "dependencies": [ diff --git a/ports/suitesparse/CONTROL b/ports/suitesparse/CONTROL deleted file mode 100644 index 832306d5a8c37f..00000000000000 --- a/ports/suitesparse/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: suitesparse -Version: 5.8.0 -Build-Depends: lapack, metis -Homepage: http://suitesparse.com -Description: algebra library diff --git a/ports/suitesparse/FindCXSparse.cmake b/ports/suitesparse/FindCXSparse.cmake index 94ba41e045f786..65d596acaea2c1 100644 --- a/ports/suitesparse/FindCXSparse.cmake +++ b/ports/suitesparse/FindCXSparse.cmake @@ -33,9 +33,8 @@ include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake) -include(${CMAKE_ROOT}/Modules/CMakeFindDependencyMacro.cmake) -find_path(CXSPARSE_INCLUDE_DIR NAMES cs.h) +find_path(CXSPARSE_INCLUDE_DIR NAMES cs.h PATH_SUFFIXES suitesparse) find_library(CXSPARSE_LIBRARY_RELEASE NAMES cxsparse libcxsparse) find_library(CXSPARSE_LIBRARY_DEBUG NAMES cxsparsed libcxsparsed) @@ -65,11 +64,10 @@ endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(CXSparse - REQUIRED_VARS CXSPARSE_INCLUDE_DIRS CXSPARSE_LIBRARIES + REQUIRED_VARS CXSPARSE_INCLUDE_DIR CXSPARSE_LIBRARIES VERSION_VAR CXSPARSE_VERSION) set(CXSPARSE_FOUND ${CXSparse_FOUND}) set(CXSPARSE_INCLUDE_DIRS ${CXSPARSE_INCLUDE_DIR}) -set(CXSPARSE_LIBRARIES ${CXSPARSE_LIBRARY}) set(CXSparse_INCLUDE_DIRS ${CXSPARSE_INCLUDE_DIR}) -set(CXSparse_LIBRARIES ${CXSPARSE_LIBRARY}) +set(CXSparse_LIBRARIES ${CXSPARSE_LIBRARIES}) diff --git a/ports/suitesparse/vcpkg.json b/ports/suitesparse/vcpkg.json new file mode 100644 index 00000000000000..71f44d7242847e --- /dev/null +++ b/ports/suitesparse/vcpkg.json @@ -0,0 +1,11 @@ +{ + "name": "suitesparse", + "version-semver": "5.8.0", + "port-version": 1, + "description": "A suite of sparse matrix algorithms. Also provides libcxsparse.", + "homepage": "http://suitesparse.com", + "dependencies": [ + "lapack", + "metis" + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index a76263660b5bec..f24351b870008e 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1110,7 +1110,7 @@ }, "ceres": { "baseline": "2.0.0", - "port-version": 2 + "port-version": 3 }, "cfitsio": { "baseline": "3.49", @@ -5570,7 +5570,7 @@ }, "suitesparse": { "baseline": "5.8.0", - "port-version": 0 + "port-version": 1 }, "sundials": { "baseline": "5.5.0", diff --git a/versions/c-/ceres.json b/versions/c-/ceres.json index 5071e44c890c37..0ea9c26c4e584e 100644 --- a/versions/c-/ceres.json +++ b/versions/c-/ceres.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "bfe64de75017dfef5a1dbd6b034078a0316201c8", + "version-semver": "2.0.0", + "port-version": 3 + }, { "git-tree": "216c1a351f8af9be7952bd5dfcf262a66e24c11e", "version-string": "2.0.0", diff --git a/versions/s-/suitesparse.json b/versions/s-/suitesparse.json index c449b468544b75..8e99fa85061b4a 100644 --- a/versions/s-/suitesparse.json +++ b/versions/s-/suitesparse.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "4c709290c9cc6e7635c120dbd5cd9d227408a0ab", + "version-semver": "5.8.0", + "port-version": 1 + }, { "git-tree": "cafd2cb5688d179f1ca502ae8e1ce421db1c7ef5", "version-string": "5.8.0",