diff options
Diffstat (limited to 'pkgs/applications/science/misc/colmap/default.nix')
-rw-r--r-- | pkgs/applications/science/misc/colmap/default.nix | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/pkgs/applications/science/misc/colmap/default.nix b/pkgs/applications/science/misc/colmap/default.nix index d071c90562cd4..59e58351c0f6b 100644 --- a/pkgs/applications/science/misc/colmap/default.nix +++ b/pkgs/applications/science/misc/colmap/default.nix @@ -1,43 +1,62 @@ -{ mkDerivation, lib, fetchFromGitHub, cmake, boost179, ceres-solver, eigen, +{ lib, fetchFromGitHub, cmake, boost179, ceres-solver, eigen, freeimage, glog, libGLU, glew, qtbase, + flann, + cgal, + gmp, + mpfr, autoAddDriverRunpath, config, - cudaSupport ? config.cudaSupport, cudaPackages + stdenv, + qt5, + xorg, + cudaSupport ? config.cudaSupport, + cudaCapabilities ? cudaPackages.cudaFlags.cudaCapabilities, + cudaPackages }: assert cudaSupport -> cudaPackages != { }; let boost_static = boost179.override { enableStatic = true; }; + stdenv' = if cudaSupport then cudaPackages.backendStdenv else stdenv; # TODO: migrate to redist packages inherit (cudaPackages) cudatoolkit; in -mkDerivation rec { - version = "3.7"; +stdenv'.mkDerivation rec { + version = "3.9.1"; pname = "colmap"; src = fetchFromGitHub { owner = "colmap"; repo = "colmap"; rev = version; - hash = "sha256-uVAw6qwhpgIpHkXgxttKupU9zU+vD0Za0maw2Iv4x+I="; + hash = "sha256-Xb4JOttCMERwPYs5DyGKHw+f9Wik1/rdJQKbgVuygH8="; }; - # 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" + (lib.cmakeBool "CUDA_ENABLED" true) + (lib.cmakeFeature "CMAKE_CUDA_ARCHITECTURES" + (lib.strings.concatStringsSep ";" + (map cudaPackages.cudaFlags.dropDot + cudaCapabilities))) ]; buildInputs = [ boost_static ceres-solver eigen freeimage glog libGLU glew qtbase + flann + cgal + gmp + mpfr + xorg.libSM ] ++ lib.optionals cudaSupport [ cudatoolkit + cudaPackages.cuda_cudart.static ]; nativeBuildInputs = [ cmake + qt5.wrapQtAppsHook ] ++ lib.optionals cudaSupport [ autoAddDriverRunpath ]; |