aboutsummaryrefslogtreecommitdiff
path: root/graphics/opencv
diff options
context:
space:
mode:
authorJason E. Hale <jhale@FreeBSD.org>2015-06-14 15:28:03 +0000
committerJason E. Hale <jhale@FreeBSD.org>2015-06-14 15:28:03 +0000
commit6ca338fac76c5d6b6ca4ecaeafa722f43b73c3c0 (patch)
treebfa591c72df6d8a3f82bd85e94866973ca9a5238 /graphics/opencv
parentf420899280a792e977d27653f514d4cb69ca07ad (diff)
downloadports-6ca338fac76c5d6b6ca4ecaeafa722f43b73c3c0.tar.gz
ports-6ca338fac76c5d6b6ca4ecaeafa722f43b73c3c0.zip
- Add SIMD option to specifically disable CPU optimizations and prevent crashes
with ffmpeg on processors that do not support SSE instructions. OFF by default for package building, ON with autodetect for ports to keep with POLA. [1][2] - Bump PORTREVISION on all opencv ports PR: 199715 [1], 200234 [2] Submitted by: Randy Westlund <rwestlun@gmail.com> [1], sasamotikomi@gmail.com [2]
Notes
Notes: svn path=/head/; revision=389642
Diffstat (limited to 'graphics/opencv')
-rw-r--r--graphics/opencv/Makefile36
1 files changed, 34 insertions, 2 deletions
diff --git a/graphics/opencv/Makefile b/graphics/opencv/Makefile
index 68fda6504e77..cbee06e41e24 100644
--- a/graphics/opencv/Makefile
+++ b/graphics/opencv/Makefile
@@ -3,7 +3,7 @@
PORTNAME?= opencv
PORTVERSION= 2.4.9
-PORTREVISION?= 4
+PORTREVISION?= 5
CATEGORIES= graphics
MASTER_SITES= SF/${PORTNAME}library/${PORTNAME}-unix/${PORTVERSION}
@@ -42,7 +42,7 @@ OCV_NONFREE_MODS= nonfree
OCV_JAVA_MODS= java
OCV_PYTHON_MODS= python
-OPTIONS_DEFINE= DC1394 EXAMPLES NONFREE OPENGL
+OPTIONS_DEFINE= DC1394 EXAMPLES NONFREE OPENGL SIMD
OPTIONS_GROUP= IMAGE PERFORMANCE VIDEO
OPTIONS_GROUP_IMAGE= JASPER JPEG OPENEXR PNG TIFF
OPTIONS_GROUP_PERFORMANCE= EIGEN3 TBB
@@ -50,6 +50,9 @@ OPTIONS_GROUP_VIDEO= FFMPEG GSTREAMER V4L XINE
OPTIONS_RADIO= GUI
OPTIONS_RADIO_GUI= GTK2 QT4
OPTIONS_DEFAULT= EIGEN3 JASPER JPEG PNG TIFF V4L
+.if !defined(PACKAGE_BUILDING)
+OPTIONS_DEFAULT= SIMD
+.endif
OPTIONS_SUB= yes
.if defined(OCV_CORE)
OPTIONS_EXCLUDE= DC1394 EXAMPLES GTK2 QT4 JASPER JPEG NONFREE OPENEXR \
@@ -161,6 +164,35 @@ USE_QT4+= opengl
CMAKE_ARGS+= -DWITH_QT:BOOL=Off
.endif
+.if ${PORT_OPTIONS:MSIMD}
+. if ${MACHINE_CPU:Msse}
+CMAKE_ARGS+= -DENABLE_SSE:BOOL=On
+. else
+CMAKE_ARGS+= -DENABLE_SSE:BOOL=Off
+. endif
+. if ${MACHINE_CPU:Msse2}
+CMAKE_ARGS+= -DENABLE_SSE2:BOOL=On
+. else
+CMAKE_ARGS+= -DENABLE_SSE2:BOOL=Off
+. endif
+. if ${MACHINE_CPU:Msse3}
+CMAKE_ARGS+= -DENABLE_SSE3:BOOL=On
+. else
+CMAKE_ARGS+= -DENABLE_SSE3:BOOL=Off
+. endif
+# TODO: Add support for instructions above SSE3 (upstream has them off by default)
+CMAKE_ARGS+= -DENABLE_SSSE3:BOOL=Off \
+ -DENABLE_SSE41:BOOL=Off \
+ -DENABLE_SSE42:BOOL=Off
+.else
+CMAKE_ARGS+= -DENABLE_SSE:BOOL=Off \
+ -DENABLE_SSE2:BOOL=Off \
+ -DENABLE_SSE3:BOOL=Off \
+ -DENABLE_SSSE3:BOOL=Off \
+ -DENABLE_SSE41:BOOL=Off \
+ -DENABLE_SSE42:BOOL=Off
+.endif
+
.if ${PORT_OPTIONS:MTBB}
LIB_DEPENDS+= libtbb.so:${PORTSDIR}/devel/tbb
CMAKE_ARGS+= -DWITH_TBB:BOOL=On \