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:
parent
7e254c0534
commit
1248ea16e1
|
@ -1,10 +1,14 @@
|
||||||
{ mkDerivation, lib, fetchFromGitHub, cmake, boost17x, ceres-solver, eigen,
|
{ mkDerivation, lib, fetchFromGitHub, cmake, boost17x, ceres-solver, eigen,
|
||||||
freeimage, glog, libGLU, glew, qtbase,
|
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
|
in
|
||||||
mkDerivation rec {
|
mkDerivation rec {
|
||||||
version = "3.7";
|
version = "3.7";
|
||||||
|
@ -13,15 +17,27 @@ mkDerivation rec {
|
||||||
owner = "colmap";
|
owner = "colmap";
|
||||||
repo = "colmap";
|
repo = "colmap";
|
||||||
rev = version;
|
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 = [
|
buildInputs = [
|
||||||
boost_static ceres-solver eigen
|
boost_static ceres-solver eigen
|
||||||
freeimage glog libGLU glew qtbase
|
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; {
|
meta = with lib; {
|
||||||
description = "COLMAP - Structure-From-Motion and Multi-View Stereo pipeline";
|
description = "COLMAP - Structure-From-Motion and Multi-View Stereo pipeline";
|
||||||
|
|
|
@ -12214,8 +12214,8 @@ with pkgs;
|
||||||
|
|
||||||
colm = callPackage ../development/compilers/colm { };
|
colm = callPackage ../development/compilers/colm { };
|
||||||
|
|
||||||
colmap = libsForQt5.callPackage ../applications/science/misc/colmap { };
|
colmap = libsForQt5.callPackage ../applications/science/misc/colmap { cudaSupport = config.cudaSupport or false; };
|
||||||
colmapWithCuda = colmap.override { cudaSupport = true; cudatoolkit = cudatoolkit_11; };
|
colmapWithCuda = colmap.override { cudaSupport = true; };
|
||||||
|
|
||||||
chickenPackages_4 = callPackage ../development/compilers/chicken/4 { };
|
chickenPackages_4 = callPackage ../development/compilers/chicken/4 { };
|
||||||
chickenPackages_5 = callPackage ../development/compilers/chicken/5 { };
|
chickenPackages_5 = callPackage ../development/compilers/chicken/5 { };
|
||||||
|
|
Loading…
Reference in a new issue