summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Fux <samuel.fux@id.ethz.ch>2018-06-18 16:53:48 +0200
committerAdam J. Stewart <ajstewart426@gmail.com>2018-06-18 09:53:48 -0500
commit46bf21f05e09b4ba255667e4efa24c1463174f39 (patch)
treec26db7a657805dfbd7976e126dcd85c295c5d194
parentcb11e1b8ee98bc0ee6a29ee35906e3dc552927b7 (diff)
downloadspack-46bf21f05e09b4ba255667e4efa24c1463174f39.tar.gz
spack-46bf21f05e09b4ba255667e4efa24c1463174f39.tar.bz2
spack-46bf21f05e09b4ba255667e4efa24c1463174f39.tar.xz
spack-46bf21f05e09b4ba255667e4efa24c1463174f39.zip
Adding patch to Opencv (3.3.0-3.4.1) for fixing conflict between CUDA and OpenCV dnn header file (#8502)
* Adding patch for OpenCV to fix a conflict between an OpenCV and a CUDA header file * Added patch command to package.py file for OpenCV SPACK package. * Adding version range for patch. * shortening comment lines, since testsuite failed
-rw-r--r--var/spack/repos/builtin/packages/opencv/dnn_cuda.patch44
-rw-r--r--var/spack/repos/builtin/packages/opencv/package.py5
2 files changed, 49 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/opencv/dnn_cuda.patch b/var/spack/repos/builtin/packages/opencv/dnn_cuda.patch
new file mode 100644
index 0000000000..66ab59ba26
--- /dev/null
+++ b/var/spack/repos/builtin/packages/opencv/dnn_cuda.patch
@@ -0,0 +1,44 @@
+--- opencv-3.4.1/modules/dnn/src/layers/mvn_layer.cpp.orig 2018-06-14 10:46:28.025703093 +0200
++++ opencv-3.4.1/modules/dnn/src/layers/mvn_layer.cpp 2018-06-14 10:40:56.266069123 +0200
+@@ -43,7 +43,7 @@
+ #include "../precomp.hpp"
+ #include "layers_common.hpp"
+ #include <opencv2/dnn/shape_utils.hpp>
+-#include "math_functions.hpp"
++#include "../ocl4dnn/include/math_functions.hpp"
+ #include "opencl_kernels_dnn.hpp"
+
+ namespace cv
+--- opencv-3.4.1/modules/dnn/src/ocl4dnn/src/math_functions.cpp.orig 2018-06-14 10:45:23.565162940 +0200
++++ opencv-3.4.1/modules/dnn/src/ocl4dnn/src/math_functions.cpp 2018-06-14 10:44:48.513412965 +0200
+@@ -42,7 +42,7 @@
+
+ #include "../../precomp.hpp"
+ #include "common.hpp"
+-#include "math_functions.hpp"
++#include "../include/math_functions.hpp"
+ #include <vector>
+ #include "opencl_kernels_dnn.hpp"
+
+--- opencv-3.4.1/modules/dnn/src/ocl4dnn/src/ocl4dnn_conv_spatial.cpp.orig 2018-06-14 10:42:11.319534007 +0200
++++ opencv-3.4.1/modules/dnn/src/ocl4dnn/src/ocl4dnn_conv_spatial.cpp 2018-06-14 10:42:52.988236879 +0200
+@@ -52,7 +52,7 @@
+ #include "common.hpp"
+ #include "ocl4dnn.hpp"
+ #include "opencl_kernels_dnn.hpp"
+-#include "math_functions.hpp"
++#include "../include/math_functions.hpp"
+ #include "default_kernel_config.hpp"
+
+ #if defined WIN32 || defined _WIN32
+--- opencv-3.4.1/modules/dnn/src/ocl4dnn/src/ocl4dnn_inner_product.cpp.orig 2018-06-14 10:45:41.245036822 +0200
++++ opencv-3.4.1/modules/dnn/src/ocl4dnn/src/ocl4dnn_inner_product.cpp 2018-06-14 10:45:55.543934818 +0200
+@@ -43,7 +43,7 @@
+ #include "../../precomp.hpp"
+ #include "common.hpp"
+ #include "ocl4dnn.hpp"
+-#include "math_functions.hpp"
++#include "../include/math_functions.hpp"
+
+ #ifdef HAVE_OPENCL
+ namespace cv { namespace dnn { namespace ocl4dnn {
diff --git a/var/spack/repos/builtin/packages/opencv/package.py b/var/spack/repos/builtin/packages/opencv/package.py
index 0417ae1b4c..a8c4b819bd 100644
--- a/var/spack/repos/builtin/packages/opencv/package.py
+++ b/var/spack/repos/builtin/packages/opencv/package.py
@@ -105,6 +105,11 @@ class Opencv(CMakePackage):
variant('vtk', default=True, description='Activates support for VTK')
variant('zlib', default=True, description='Build zlib from source')
+ # Patch to fix conflict between CUDA and OpenCV (reproduced with 3.3.0
+ # and 3.4.1) header file that have the same name.Problem is fixed in
+ # the current development branch of OpenCV. See #8461 for more information.
+ patch('dnn_cuda.patch', when='@3.3.0:3.4.1+cuda+dnn')
+
depends_on('eigen~mpfr', when='+eigen', type='build')
depends_on('zlib', when='+zlib')