From 30c1ad5ca378ff46bc90f37bf04e14f9765d6f23 Mon Sep 17 00:00:00 2001 From: Matthew Daiter Date: Fri, 4 Nov 2016 14:18:50 +0100 Subject: [PATCH] opencv3: added in extra flag for enabling cuda with dependencies opencv3: added in optional buildFlag for enabling cuda opencv3: added CUDA enabling flags to cmakeFlags opencv3: added CUDA-speicifc FAST_MATH flag for enabling CUDA-accelerated math functions opencv3: change enableCUDA default to false opencv:added in cuda-enabling functionality. --- pkgs/development/libraries/opencv/3.x.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/opencv/3.x.nix b/pkgs/development/libraries/opencv/3.x.nix index 0167011ed49a..701aa8e26b4a 100644 --- a/pkgs/development/libraries/opencv/3.x.nix +++ b/pkgs/development/libraries/opencv/3.x.nix @@ -14,6 +14,7 @@ , enableFfmpeg ? false, ffmpeg , enableGStreamer ? false, gst_all_1 , enableEigen ? false, eigen +, enableCuda ? false, cudatoolkit, gcc49 }: let @@ -74,6 +75,7 @@ stdenv.mkDerivation rec { ++ lib.optional enableFfmpeg ffmpeg ++ lib.optionals enableGStreamer (with gst_all_1; [ gstreamer gst-plugins-base ]) ++ lib.optional enableEigen eigen + ++ lib.optional enableCuda [ cudatoolkit gcc49 ] ; propagatedBuildInputs = lib.optional enablePython pythonPackages.numpy; @@ -90,7 +92,10 @@ stdenv.mkDerivation rec { (opencvFlag "JPEG" enableJPEG) (opencvFlag "PNG" enablePNG) (opencvFlag "OPENEXR" enableEXR) - ] ++ lib.optionals enableContrib [ "-DOPENCV_EXTRA_MODULES_PATH=${contribSrc}/modules" ]; + (opencvFlag "CUDA" enableCuda) + (opencvFlag "CUBLAS" enableCuda) + ] ++ lib.optionals enableContrib [ "-DOPENCV_EXTRA_MODULES_PATH=${contribSrc}/modules" ] + ++ lib.optionals enableCuda [ "-DCUDA_FAST_MATH=ON" ]; enableParallelBuilding = true;