Commit de667ea1 authored by Patrick Chilton's avatar Patrick Chilton
Browse files

colmap: 4.0.2 -> 4.0.3

parent 97a3bdc7
Loading
Loading
Loading
Loading
+0 −19
Original line number Diff line number Diff line
commit a1f0a46b4932ed1c98ceb872e6b346b370f1b638
Author: Patrick Chilton <chpatrick@gmail.com>
Date:   Wed Mar 18 15:59:05 2026 +0100

    Disambiguate ceres::GradientChecker constructor

diff --git a/src/colmap/estimators/cost_functions/reprojection_error_test.cc b/src/colmap/estimators/cost_functions/reprojection_error_test.cc
index 25e6ffdc..7a1e4777 100644
--- a/src/colmap/estimators/cost_functions/reprojection_error_test.cc
+++ b/src/colmap/estimators/cost_functions/reprojection_error_test.cc
@@ -106,7 +106,7 @@ TEST(ReprojErrorCostFunctor, AnalyticalVersusAutoDiff) {
 
         ceres::NumericDiffOptions numeric_diff_options;
         ceres::GradientChecker gradient_checker(
-            analytical_cost_function.get(), nullptr, numeric_diff_options);
+            analytical_cost_function.get(), static_cast<const std::vector<const ceres::Manifold*>*>(nullptr), numeric_diff_options);
         ceres::GradientChecker::ProbeResults results;
         EXPECT_TRUE(
             gradient_checker.Probe(parameter_blocks.data(), kEps, &results));
+53 −12
Original line number Diff line number Diff line
@@ -2,7 +2,8 @@
  lib,
  fetchFromGitHub,
  fetchpatch,
  gitUpdater,
  fetchurl,
  nix-update-script,
  cmake,
  boost,
  ceres-solver,
@@ -31,6 +32,9 @@
  sqlite,
  llvmPackages,
  gtest,
  curl,

  enableTests ? true,
}:

assert cudaSupport -> cudaPackages != { };
@@ -65,30 +69,54 @@ let

  # TODO: migrate to redist packages
  inherit (cudaPackages) cudatoolkit;

  # COLMAP needs these model files to run the ONNX tests
  # Based on: https://github.com/colmap/colmap/blob/79efc74b2b614935a3c69b1f983f2bad23a836a1/src/colmap/feature/resources.h#L36
  modelsForTesting = [
    {
      name = "aliked-n16rot.onnx";
      url = "https://github.com/colmap/colmap/releases/download/3.13.0/aliked-n16rot.onnx";
      sha256 = "39c423d0a6f03d39ec89d3d1d61853765c2fb6a8b8381376c703e5758778a547";
    }
    {
      name = "aliked-n32.onnx";
      url = "https://github.com/colmap/colmap/releases/download/3.13.0/aliked-n32.onnx";
      sha256 = "a077728a02d2de1a775c66df6de8cfeb7c6b51ca57572c64c680131c988c8b3c";
    }
    {
      name = "aliked-lightglue.onnx";
      url = "https://github.com/colmap/colmap/releases/download/3.13.0/aliked-lightglue.onnx";
      sha256 = "b9a5de7204648b18a8cf5dcac819f9d30de1a5961ef03756803c8b86c2dceb8d";
    }
    {
      name = "bruteforce-matcher.onnx";
      url = "https://github.com/colmap/colmap/releases/download/3.13.0/bruteforce-matcher.onnx";
      sha256 = "3c1282f96d83f5ffc861a873298d08bbe5219f59af59223f5ceab5c41a182a47";
    }
    {
      name = "sift-lightglue.onnx";
      url = "https://github.com/colmap/colmap/releases/download/3.13.0/sift-lightglue.onnx";
      sha256 = "e0500228472b43f92b3d36881a09b3310d3b058b56187b246cc7b9ab6429096e";
    }
  ];
in
stdenv'.mkDerivation {
  version = "4.0.2";
  version = "4.0.3";
  pname = "colmap";
  src = fetchFromGitHub {
    owner = "colmap";
    repo = "colmap";
    rev = "d927f7e518fc20afa33390712c4cc20d85b730b8";
    hash = "sha256-+cPkksfCLyEo7A70nuRWnOBEkhx8BFevQ9XWTipEkpM=";
    rev = "e5b4a3e2276fe0cb81c3643d8ffdf124020c372e";
    hash = "sha256-VV+ROjhrg7bEMV3QU6r4zCcMzC7tAPwTu6gV6/cmiH0=";
  };

  patches = [
    ./suitesparse-no-include-subdir.patch
    # Remove when https://github.com/colmap/colmap/pull/4265 is merged
    ./disambiguate-gradientchecker.patch
  ];

  cmakeFlags = [
    (lib.cmakeBool "DOWNLOAD_ENABLED" false)
    (lib.cmakeBool "DOWNLOAD_ENABLED" true) # We want COLMAP to be able to fetch models like LightGlue.
    (lib.cmakeBool "UNINSTALL_ENABLED" false)
    (lib.cmakeBool "FETCH_POSELIB" false)
    (lib.cmakeBool "FETCH_FAISS" false)
    (lib.cmakeBool "FETCH_ONNX" false)
    (lib.cmakeBool "TESTS_ENABLED" true)
    (lib.cmakeBool "TESTS_ENABLED" enableTests)
    (lib.cmakeFeature "CHOLMOD_INCLUDE_DIR_HINTS" "${suitesparse.dev}/include")
    (lib.cmakeFeature "CHOLMOD_LIBRARY_DIR_HINTS" "${suitesparse}/lib")
  ]
@@ -114,6 +142,7 @@ stdenv'.mkDerivation {
    gmp
    mpfr
    libsm
    curl
  ]
  ++ depsAlsoForPycolmap;

@@ -126,7 +155,19 @@ stdenv'.mkDerivation {
    autoAddDriverRunpath
  ];

  doCheck = enableTests;
  preCheck = lib.optionalString enableTests ''
    export GTEST_FILTER='-*Gpu*:*GPU*:*OpenGL*' # Disable any test involving OpenGL or GPU, these won't work in the sandbox.
    export HOME=$PWD
    # Pre-fetch the ONNX models into COLMAP's cache dir so we can run their tests.
    mkdir -p .cache/colmap
    ${lib.concatMapStringsSep "\n" (model: ''
      ln -s ${fetchurl model} .cache/colmap/${model.sha256}-${model.name}
    '') modelsForTesting}
  '';

  passthru.depsAlsoForPycolmap = depsAlsoForPycolmap;
  passthru.updateScript = nix-update-script { };

  meta = {
    description = "Structure-From-Motion and Multi-View Stereo pipeline";
+0 −22
Original line number Diff line number Diff line
diff --git a/cmake/FindCHOLMOD.cmake b/cmake/FindCHOLMOD.cmake
index a5daf0e3..b0f13e3e 100644
--- a/cmake/FindCHOLMOD.cmake
+++ b/cmake/FindCHOLMOD.cmake
@@ -57,7 +57,7 @@ if(TARGET CHOLMOD::CHOLMOD)
 else()
     find_path(CHOLMOD_INCLUDE_DIRS
         NAMES
-        suitesparse/cholmod.h
+        cholmod.h
         PATHS
         ${CHOLMOD_INCLUDE_DIR_HINTS}
         /usr/include
@@ -89,7 +89,7 @@ else()
 
     add_library(CHOLMOD::CHOLMOD INTERFACE IMPORTED)
     target_include_directories(
-        CHOLMOD::CHOLMOD INTERFACE ${CHOLMOD_INCLUDE_DIRS}/suitesparse)
+        CHOLMOD::CHOLMOD INTERFACE ${CHOLMOD_INCLUDE_DIRS})
     target_link_libraries(
         CHOLMOD::CHOLMOD INTERFACE ${CHOLMOD_LIBRARIES})
 endif()