Unverified Commit 5be22216 authored by Niklas Hambüchen's avatar Niklas Hambüchen Committed by GitHub
Browse files

colmap: 3.9.1 -> 3.12.5-unstable-openimageio, poselib: init at 2.0.5 (#438672)

parents d6b1cfb0 758b83b1
Loading
Loading
Loading
Loading
+4927 −0

File added.

Preview size limit exceeded, changes collapsed.

+64 −17
Original line number Diff line number Diff line
{
  lib,
  fetchFromGitHub,
  fetchpatch,
  gitUpdater,
  cmake,
  boost,
  ceres-solver,
  eigen,
  freeimage,
  openimageio,
  glog,
  libGLU,
  glew,
  qtbase,
  flann,
  cgal,
  gmp,
  mpfr,
  poselib,
  lz4,
  autoAddDriverRunpath,
  config,
  stdenv,
@@ -22,71 +25,115 @@
  cudaSupport ? config.cudaSupport,
  cudaCapabilities ? cudaPackages.flags.cudaCapabilities,
  cudaPackages,
  faiss,
  sqlite,
  llvmPackages,
  gtest,
}:

assert cudaSupport -> cudaPackages != { };

let
  boost_static = boost.override { enableStatic = true; };
  stdenv' = if cudaSupport then cudaPackages.backendStdenv else stdenv;

  depsAlsoForPycolmap = [
    boost
    eigen
    ceres-solver
    openimageio
    glog
    libGLU
    glew
    cgal
    poselib
    faiss
    sqlite
    gmp
    mpfr
    lz4
    qt5.qtbase
  ]
  ++ lib.optionals cudaSupport [
    cudatoolkit
    cudaPackages.cuda_cudart.static
  ]
  ++ lib.optional stdenv'.cc.isClang llvmPackages.openmp;

  # TODO: migrate to redist packages
  inherit (cudaPackages) cudatoolkit;
in
stdenv'.mkDerivation rec {
  version = "3.9.1";
  version = "unstable-3.12.5-openimageio";
  pname = "colmap";
  src = fetchFromGitHub {
    owner = "colmap";
    repo = "colmap";
    rev = version;
    hash = "sha256-Xb4JOttCMERwPYs5DyGKHw+f9Wik1/rdJQKbgVuygH8=";
    rev = "f8edccaa36909713b9d3930e1ca65cb364a38b26";
    hash = "sha256-0lD7ywM48ODe11u9D3XSk9btqQ4gs/APBFf9IyiXe6g=";
  };

  cmakeFlags = lib.optionals cudaSupport [
    (lib.cmakeBool "CUDA_ENABLED" true)
  # TODO: remove this when https://github.com/colmap/colmap/pull/3459 is in a release
  # This was produced with:
  # git diff f8edccaa36909713b9d3930e1ca65cb364a38b26 e40c0730020938587c9d4eb7634cbff93cbc2f81
  patches = [ ./openimageio.patch ];

  cmakeFlags = [
    (lib.cmakeBool "DOWNLOAD_ENABLED" false)
    (lib.cmakeBool "UNINSTALL_ENABLED" false)
    (lib.cmakeBool "FETCH_POSELIB" false)
    (lib.cmakeBool "FETCH_FAISS" false)
    (lib.cmakeBool "TESTS_ENABLED" true)
  ]
  ++ lib.optionals cudaSupport [
    (lib.cmakeBool "CUDA_ENABLED" cudaSupport)
    (lib.cmakeFeature "CMAKE_CUDA_ARCHITECTURES" (
      lib.strings.concatStringsSep ";" (map cudaPackages.flags.dropDots cudaCapabilities)
    ))
  ];

  buildInputs = [
    boost_static
    boost
    ceres-solver
    eigen
    freeimage
    openimageio
    glog
    libGLU
    glew
    qtbase
    qt5.qtbase
    flann
    lz4
    cgal
    gmp
    mpfr
    xorg.libSM
  ]
  ++ lib.optionals cudaSupport [
    cudatoolkit
    cudaPackages.cuda_cudart.static
  ];
  ++ depsAlsoForPycolmap;

  nativeBuildInputs = [
    cmake
    qt5.wrapQtAppsHook
    gtest
  ]
  ++ lib.optionals cudaSupport [
    autoAddDriverRunpath
  ];

  passthru.depsAlsoForPycolmap = depsAlsoForPycolmap;

  meta = with lib; {
    description = "Structure-From-Motion and Multi-View Stereo pipeline";
    longDescription = ''
      COLMAP is a general-purpose Structure-from-Motion (SfM) and Multi-View Stereo (MVS) pipeline
      with a graphical and command-line interface.
    '';
    mainProgram = "colmap";
    homepage = "https://colmap.github.io/index.html";
    license = licenses.bsd3;
    platforms = platforms.linux;
    maintainers = with maintainers; [ lebastr ];
    platforms = platforms.unix;
    maintainers = with maintainers; [
      lebastr
      usertam
      chpatrick
    ];
  };
}
+39 −0
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchFromGitHub,
  gitUpdater,
  cmake,
  eigen,
  pkg-config,
}:

stdenv.mkDerivation (final: {
  pname = "poselib";
  version = "2.0.5";

  src = fetchFromGitHub {
    owner = "PoseLib";
    repo = "PoseLib";
    rev = "v${final.version}";
    hash = "sha256-fARRKT2UoPuuk9FOOsBdrACwGiGXWg/mLV4R0QIjeak=";
  };

  buildInputs = [ eigen ];

  nativeBuildInputs = [
    cmake
    pkg-config
  ];

  passthru.updateScript = gitUpdater { rev-prefix = "v"; };

  meta = with lib; {
    description = "A collection of minimal solvers for camera pose estimation";
    homepage = "https://github.com/PoseLib/PoseLib";
    changelog = "https://github.com/PoseLib/PoseLib/releases/tag/v${final.version}";
    license = licenses.bsd3;
    platforms = platforms.unix;
    maintainers = with maintainers; [ usertam ];
  };
})
+0 −3
Original line number Diff line number Diff line
@@ -4546,9 +4546,6 @@ with pkgs;
    inherit (llvmPackages) lld stdenv;
  };

  colmap = libsForQt5.callPackage ../applications/science/misc/colmap {
    inherit (config) cudaSupport;
  };
  colmapWithCuda = colmap.override { cudaSupport = true; };

  opensplatWithCuda = opensplat.override { cudaSupport = true; };