|
|
|
@ -1,10 +1,14 @@ |
|
|
|
|
{ mkDerivation, lib, fetchFromGitHub, cmake, boost17x, ceres-solver, eigen, |
|
|
|
|
freeimage, glog, libGLU, glew, qtbase, |
|
|
|
|
cudaSupport ? false, cudatoolkit ? null }: |
|
|
|
|
cudaSupport ? false, cudaPackages }: |
|
|
|
|
|
|
|
|
|
assert !cudaSupport || cudatoolkit != null; |
|
|
|
|
assert cudaSupport -> cudaPackages != { }; |
|
|
|
|
|
|
|
|
|
let boost_static = boost17x.override { enableStatic = true; }; |
|
|
|
|
let |
|
|
|
|
boost_static = boost17x.override { enableStatic = true; }; |
|
|
|
|
|
|
|
|
|
# TODO: migrate to redist packages |
|
|
|
|
inherit (cudaPackages) cudatoolkit; |
|
|
|
|
in |
|
|
|
|
mkDerivation rec { |
|
|
|
|
version = "3.7"; |
|
|
|
@ -13,15 +17,27 @@ mkDerivation rec { |
|
|
|
|
owner = "colmap"; |
|
|
|
|
repo = "colmap"; |
|
|
|
|
rev = version; |
|
|
|
|
sha256 = "sha256-uVAw6qwhpgIpHkXgxttKupU9zU+vD0Za0maw2Iv4x+I="; |
|
|
|
|
hash = "sha256-uVAw6qwhpgIpHkXgxttKupU9zU+vD0Za0maw2Iv4x+I="; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
# TODO: rm once the gcc11 issue is closed, https://github.com/colmap/colmap/issues/1418#issuecomment-1049305256 |
|
|
|
|
cmakeFlags = lib.optionals cudaSupport [ |
|
|
|
|
"-DCUDA_ENABLED=ON" |
|
|
|
|
"-DCUDA_NVCC_FLAGS=--std=c++14" |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
buildInputs = [ |
|
|
|
|
boost_static ceres-solver eigen |
|
|
|
|
freeimage glog libGLU glew qtbase |
|
|
|
|
] ++ lib.optional cudaSupport cudatoolkit; |
|
|
|
|
] ++ lib.optionals cudaSupport [ |
|
|
|
|
cudatoolkit |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ]; |
|
|
|
|
nativeBuildInputs = [ |
|
|
|
|
cmake |
|
|
|
|
] ++ lib.optionals cudaSupport [ |
|
|
|
|
cudaPackages.autoAddOpenGLRunpathHook |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
meta = with lib; { |
|
|
|
|
description = "COLMAP - Structure-From-Motion and Multi-View Stereo pipeline"; |
|
|
|
|