From 8b46de6f9a3e20aee9aa91e16a581463f661b9ca Mon Sep 17 00:00:00 2001 From: Hoildkv <42310255+xq114@users.noreply.github.com> Date: Wed, 24 Jan 2024 23:02:13 +0800 Subject: [PATCH] enable ceres-solver 2.1.0 (#3158) --- packages/c/ceres-solver/patches/2.1.0/int64.patch | 13 +++++++++++++ packages/c/ceres-solver/xmake.lua | 5 +++-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 packages/c/ceres-solver/patches/2.1.0/int64.patch diff --git a/packages/c/ceres-solver/patches/2.1.0/int64.patch b/packages/c/ceres-solver/patches/2.1.0/int64.patch new file mode 100644 index 000000000..a7a97fb4d --- /dev/null +++ b/packages/c/ceres-solver/patches/2.1.0/int64.patch @@ -0,0 +1,13 @@ +diff --git a/internal/ceres/covariance_impl.cc b/internal/ceres/covariance_impl.cc +index 324b553..d80554b 100644 +--- a/internal/ceres/covariance_impl.cc ++++ b/internal/ceres/covariance_impl.cc +@@ -630,7 +630,7 @@ bool CovarianceImpl::ComputeCovarianceValuesUsingSuiteSparseQR() { + // separately. + const SuiteSparse_long rank = SuiteSparseQR(SPQR_ORDERING_BESTAMD, + SPQR_DEFAULT_TOL, +- cholmod_jacobian.ncol, ++ static_cast(cholmod_jacobian.ncol), + &cholmod_jacobian, + &R, + &permutation, diff --git a/packages/c/ceres-solver/xmake.lua b/packages/c/ceres-solver/xmake.lua index 4ba012842..c72014629 100644 --- a/packages/c/ceres-solver/xmake.lua +++ b/packages/c/ceres-solver/xmake.lua @@ -9,6 +9,8 @@ package("ceres-solver") add_versions("2.1.0", "f7d74eecde0aed75bfc51ec48c91d01fe16a6bf16bce1987a7073286701e2fc6") add_versions("2.2.0", "48b2302a7986ece172898477c3bcd6deb8fb5cf19b3327bc49969aad4cede82d") + add_patches("2.1.0", "patches/2.1.0/int64.patch", "1df14f30abf1a942204b408c780eabbeac0859ba5a6db3459b55c47479583c57") + add_configs("blas", {description = "Choose BLAS library to use.", default = "openblas", type = "string", values = {"mkl", "openblas"}}) add_configs("suitesparse", {description = "Enable SuiteSparse.", default = true, type = "boolean"}) @@ -21,14 +23,13 @@ package("ceres-solver") end) on_install("windows|x64", "windows|x86", "linux", "macosx", function (package) - local configs = {"-DBUILD_TESTING=OFF", "-DBUILD_DOCUMENTATION=OFF", "-DBUILD_EXAMPLES=OFF", "-DBUILD_BENCHMARKS=OFF"} + local configs = {"-DBUILD_TESTING=OFF", "-DBUILD_DOCUMENTATION=OFF", "-DBUILD_EXAMPLES=OFF", "-DBUILD_BENCHMARKS=OFF", "-DCXSPARSE=OFF"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) if package:is_plat("windows") then table.insert(configs, "-DMSVC_USE_STATIC_CRT=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) end table.insert(configs, "-DSUITESPARSE=" .. (package:config("suitesparse") and "ON" or "OFF")) - table.insert(configs, "-DCXSPARSE=" .. (package:config("suitesparse") and "ON" or "OFF")) if package:config("suitesparse") then import("package.tools.cmake").install(package, configs, {packagedeps = {"openmp", "libomp"}}) else