colmap: fix for cuda11.6/gcc11 (#169623)

* colmap: force nvcc std=c++14 after gcc11 bump

* colmap: optional -> optionals

* colmap: sha256 -> hash

* colmapWithCuda: force CUDA_ENABLED=ON safeguard

* colmapWithCuda: add opengl runpath
This commit is contained in:
Serge K 2022-04-27 23:09:30 +00:00 committed by GitHub
parent 7e254c0534
commit 1248ea16e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 8 deletions

View file

@ -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";

View file

@ -12214,8 +12214,8 @@ with pkgs;
colm = callPackage ../development/compilers/colm { };
colmap = libsForQt5.callPackage ../applications/science/misc/colmap { };
colmapWithCuda = colmap.override { cudaSupport = true; cudatoolkit = cudatoolkit_11; };
colmap = libsForQt5.callPackage ../applications/science/misc/colmap { cudaSupport = config.cudaSupport or false; };
colmapWithCuda = colmap.override { cudaSupport = true; };
chickenPackages_4 = callPackage ../development/compilers/chicken/4 { };
chickenPackages_5 = callPackage ../development/compilers/chicken/5 { };