Skip to content

Commit

Permalink
fix ceres-solver to enable 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xq114 committed Jan 24, 2024
1 parent a4018db commit a3173b7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
13 changes: 13 additions & 0 deletions packages/c/ceres-solver/patches/2.1.0/int64.patch
Original file line number Diff line number Diff line change
@@ -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<double>(SPQR_ORDERING_BESTAMD,
SPQR_DEFAULT_TOL,
- cholmod_jacobian.ncol,
+ static_cast<int64_t>(cholmod_jacobian.ncol),
&cholmod_jacobian,
&R,
&permutation,
5 changes: 3 additions & 2 deletions packages/c/ceres-solver/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"})

Expand All @@ -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
Expand Down

0 comments on commit a3173b7

Please sign in to comment.