summaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2020-03-15 21:42:43 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2020-03-15 21:42:43 +0000
commit429eae49144f23e281aa62ac5737c8502753d79d (patch)
tree9bc846926f715ed4a5875ba45ffa4931f22e6f69 /math
parent5cf73415b49127a8122832de3a374acbadb28c6c (diff)
downloadfreebsd-ports-429eae49144f23e281aa62ac5737c8502753d79d.zip
math/darknet: Update 3-446 -> 3_optimal-30
Diffstat (limited to 'math')
-rw-r--r--math/darknet/Makefile20
-rw-r--r--math/darknet/distinfo6
-rw-r--r--math/darknet/files/patch-CMakeLists.txt13
3 files changed, 33 insertions, 6 deletions
diff --git a/math/darknet/Makefile b/math/darknet/Makefile
index 8c5fd617a17e..559eafb806ad 100644
--- a/math/darknet/Makefile
+++ b/math/darknet/Makefile
@@ -2,9 +2,8 @@
PORTNAME= darknet
DISTVERSIONPREFIX= darknet_yolo_v
-DISTVERSION= 3-446
-DISTVERSIONSUFFIX= -gf2fc239
-PORTREVISION= 1
+DISTVERSION= 3_optimal-30
+DISTVERSIONSUFFIX= -g92e6e8e
PORTEPOCH= 1
CATEGORIES= math # machine-learning
@@ -28,6 +27,10 @@ PLIST_FILES= bin/darknet \
OPTIONS_DEFINE= OPENCV
OPTIONS_DEFAULT= OPENCV
+OPTIONS_DEFINE_amd64= SSE2 SSE3 SSE4 AVX
+OPTIONS_DEFINE_i386= SSE2 SSE3 SSE4 AVX
+OPTIONS_DEFAULT_amd64= SSE2
+OPTIONS_DEFAULT_i386= SSE2
# Many secondary functions in DarkNet depend on OpenCV which is a large dependency.
# Build with OPENCV=off for a self-contained executable which would support
# core NN computations but would not support many visualization, training and
@@ -38,6 +41,17 @@ OPENCV_CMAKE_BOOL= ENABLE_OPENCV
OPENCV_LIB_DEPENDS= libopencv_video.so:graphics/opencv \
libopencv_core.so:graphics/opencv-core
+OPTIONS_GROUP= SIMD
+OPTIONS_GROUP_SIMD_amd64= SSE2 SSE3 SSE4 AVX
+SSE2_DESC= Use SSE2 instructions
+SSE2_CMAKE_ON= -DFREEBSD_SIMD="-msse2"
+SSE3_DESC= Use SSE3 instructions
+SSE3_CMAKE_ON= -DFREEBSD_SIMD="-msse3"
+SSE4_DESC= Use SSE4 instructions
+SSE4_CMAKE_ON= -DFREEBSD_SIMD="-msse4.1 -msse4.2 -msse4a"
+AVX_DESC= Use AVX instructions
+AVX_CMAKE_ON= -DFREEBSD_SIMD="-mavx -mavx2"
+
do-install: # https://github.com/AlexeyAB/darknet/issues/4527
${INSTALL_PROGRAM} ${BUILD_WRKSRC}/darknet ${STAGEDIR}${PREFIX}/bin
cd ${WRKSRC} && ${COPYTREE_SHARE} include ${STAGEDIR}${PREFIX}
diff --git a/math/darknet/distinfo b/math/darknet/distinfo
index c6ad9f833ec4..1f8272d331ed 100644
--- a/math/darknet/distinfo
+++ b/math/darknet/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1576460707
-SHA256 (AlexeyAB-darknet-darknet_yolo_v3-446-gf2fc239_GH0.tar.gz) = db38891d52f8d664eeea63d8d4345b6d847a7e068f0e22c3ee9a486962e188dc
-SIZE (AlexeyAB-darknet-darknet_yolo_v3-446-gf2fc239_GH0.tar.gz) = 7376135
+TIMESTAMP = 1584304739
+SHA256 (AlexeyAB-darknet-darknet_yolo_v3_optimal-30-g92e6e8e_GH0.tar.gz) = 357f8ac423129c53e052b1c3b1223ac764bd4533db030336259da449d9a1add4
+SIZE (AlexeyAB-darknet-darknet_yolo_v3_optimal-30-g92e6e8e_GH0.tar.gz) = 7394166
diff --git a/math/darknet/files/patch-CMakeLists.txt b/math/darknet/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..02c8b6de2187
--- /dev/null
+++ b/math/darknet/files/patch-CMakeLists.txt
@@ -0,0 +1,13 @@
+--- CMakeLists.txt.orig 2019-12-17 03:49:21 UTC
++++ CMakeLists.txt
+@@ -158,8 +158,8 @@ if(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_CXX_COMPILER_ID
+ string(REGEX REPLACE "-O3" "-Ofast" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
+ string(REGEX REPLACE "-O0" "-Og" CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
+ string(REGEX REPLACE "-O3" "-Ofast" CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
+- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffp-contract=fast -mavx -mavx2 -msse3 -msse4.1 -msse4.2 -msse4a")
+- set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ffp-contract=fast -mavx -mavx2 -msse3 -msse4.1 -msse4.2 -msse4a")
++ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffp-contract=fast ${FREEBSD_SIMD}")
++ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ffp-contract=fast ${FREEBSD_SIMD}")
+ endif()
+
+ if(OpenCV_FOUND)