summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSinan <sbulutw@gmail.com>2020-01-07 11:19:18 -0800
committerAdam J. Stewart <ajstewart426@gmail.com>2020-01-07 13:19:18 -0600
commite4f56378b1419a037fabdab92edf3e1974662edb (patch)
treee556abcb89a7a34a79d3d1d9d74d2e98247c4ed7
parent7546ca6d4deb3bd33f63af71ea6b23675bb55f67 (diff)
downloadspack-e4f56378b1419a037fabdab92edf3e1974662edb.tar.gz
spack-e4f56378b1419a037fabdab92edf3e1974662edb.tar.bz2
spack-e4f56378b1419a037fabdab92edf3e1974662edb.tar.xz
spack-e4f56378b1419a037fabdab92edf3e1974662edb.zip
Package/opencv: cudacodec fix (#14409)
* create new variant, fix build error * flake8 * add conflict, re-arrange config arg for cudacodec
-rw-r--r--var/spack/repos/builtin/packages/opencv/package.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/opencv/package.py b/var/spack/repos/builtin/packages/opencv/package.py
index 6bbb365169..fcd3cb7424 100644
--- a/var/spack/repos/builtin/packages/opencv/package.py
+++ b/var/spack/repos/builtin/packages/opencv/package.py
@@ -60,6 +60,7 @@ class Opencv(CMakePackage, CudaPackage):
# OpenCV modules
variant('calib3d', default=True, description='calib3d module')
variant('core', default=True, description='Include opencv_core module into the OpenCV build')
+ variant('cudacodec', default=False, description='Enable video encoding/decoding with CUDA')
variant('dnn', default=True, description='Build DNN support')
variant('features2d', default=True, description='features2d module')
variant('flann', default=True, description='flann module')
@@ -121,6 +122,11 @@ class Opencv(CMakePackage, CudaPackage):
depends_on('ffmpeg', when='+videoio')
depends_on('mpi', when='+videoio')
+ # TODO For Cuda >= 10, make sure 'dynlink_nvcuvid.h' or 'nvcuvid.h'
+ # exists, otherwise build will fail
+ # See https://github.com/opencv/opencv_contrib/issues/1786
+ conflicts('cuda@10:', when='+cudacodec')
+
extends('python', when='+python')
def cmake_args(self):
@@ -147,6 +153,8 @@ class Opencv(CMakePackage, CudaPackage):
'ON' if '+calib3d' in spec else 'OFF')),
'-DBUILD_opencv_core:BOOL={0}'.format((
'ON' if '+core' in spec else 'OFF')),
+ '-DBUILD_opencv_cudacodec={0}'.format((
+ 'ON' if '+cudacodec' in spec else 'OFF')),
'-DBUILD_opencv_dnn:BOOL={0}'.format((
'ON' if '+dnn' in spec else 'OFF')),
'-DBUILD_opencv_features2d={0}'.format((