git: e311713eb28f - main - math/munkres-cpp: New port: Kuhn-Munkres (Hungarian) algorithm in C++

Yuri Victorovich yuri at FreeBSD.org
Thu Sep 9 15:53:07 UTC 2021


The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e311713eb28f47100c69755b58ec203d39a73248

commit e311713eb28f47100c69755b58ec203d39a73248
Author:     Yuri Victorovich <yuri at FreeBSD.org>
AuthorDate: 2021-09-09 06:53:10 +0000
Commit:     Yuri Victorovich <yuri at FreeBSD.org>
CommitDate: 2021-09-09 15:52:02 +0000

    math/munkres-cpp: New port: Kuhn-Munkres (Hungarian) algorithm in C++
---
 math/Makefile                                      |  1 +
 math/munkres-cpp/Makefile                          | 30 +++++++++++++++++++++
 math/munkres-cpp/distinfo                          |  3 +++
 math/munkres-cpp/files/patch-CMakeLists.txt        | 11 ++++++++
 math/munkres-cpp/files/patch-tests_CMakeLists.txt  | 31 ++++++++++++++++++++++
 .../patch-tests_adapters_std__2d__arraytest.cpp    | 11 ++++++++
 math/munkres-cpp/pkg-descr                         |  7 +++++
 7 files changed, 94 insertions(+)

diff --git a/math/Makefile b/math/Makefile
index e86508142732..5090666a3da5 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -463,6 +463,7 @@
     SUBDIR += multichoose
     SUBDIR += mumps
     SUBDIR += mumps4
+    SUBDIR += munkres-cpp
     SUBDIR += muparser
     SUBDIR += muparserx
     SUBDIR += nanoflann
diff --git a/math/munkres-cpp/Makefile b/math/munkres-cpp/Makefile
new file mode 100644
index 000000000000..0b54987a2479
--- /dev/null
+++ b/math/munkres-cpp/Makefile
@@ -0,0 +1,30 @@
+PORTNAME=	munkres-cpp
+DISTVERSIONPREFIX=	v
+DISTVERSION=	1.0.0-6
+DISTVERSIONSUFFIX=	-g61086fc
+CATEGORIES=	math
+
+MAINTAINER=	yuri at FreeBSD.org
+COMMENT=	Kuhn-Munkres (Hungarian) algorithm in C++
+
+LICENSE=	GPLv2
+LICENSE_FILE=	${WRKSRC}/COPYING
+
+USES=		cmake:testing localbase
+USE_LDCONFIG=	yes
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	saebyn
+
+CMAKE_ON=	BUILD_SHARED_LIBS
+CMAKE_TESTING_ON=	MUNKRESCPP_DEVEL_MODE
+
+CMAKE_TESTING_TARGET=	tests # tests are broken, see https://github.com/saebyn/munkres-cpp/issues/31
+
+PLIST_FILES=	include/munkres/adapters/adapter.h \
+		include/munkres/matrix.cpp \
+		include/munkres/matrix.h \
+		include/munkres/munkres.h \
+		lib/libmunkres.so
+
+.include <bsd.port.mk>
diff --git a/math/munkres-cpp/distinfo b/math/munkres-cpp/distinfo
new file mode 100644
index 000000000000..4d3fe79c2334
--- /dev/null
+++ b/math/munkres-cpp/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1631157520
+SHA256 (saebyn-munkres-cpp-v1.0.0-6-g61086fc_GH0.tar.gz) = 608d2032b0fe1592085df501248b9e46c5da6a3de863092daafa64f2cb8b46d3
+SIZE (saebyn-munkres-cpp-v1.0.0-6-g61086fc_GH0.tar.gz) = 25937
diff --git a/math/munkres-cpp/files/patch-CMakeLists.txt b/math/munkres-cpp/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..b07f69867b3a
--- /dev/null
+++ b/math/munkres-cpp/files/patch-CMakeLists.txt
@@ -0,0 +1,11 @@
+--- CMakeLists.txt.orig	2021-09-09 03:19:37 UTC
++++ CMakeLists.txt
+@@ -31,7 +31,7 @@ add_subdirectory(${PROJECT_SOURCE_DIR}/src/adapters)
+ 
+ # Library.
+ add_library (
+-    munkres STATIC
++    munkres
+     ${MunkresCppLib_SOURCES}
+ )
+ 
diff --git a/math/munkres-cpp/files/patch-tests_CMakeLists.txt b/math/munkres-cpp/files/patch-tests_CMakeLists.txt
new file mode 100644
index 000000000000..3f046d82927d
--- /dev/null
+++ b/math/munkres-cpp/files/patch-tests_CMakeLists.txt
@@ -0,0 +1,31 @@
+--- tests/CMakeLists.txt.orig	2021-09-09 05:45:47 UTC
++++ tests/CMakeLists.txt
+@@ -3,6 +3,7 @@ find_package (Boost     COMPONENTS      system      RE
+ enable_testing ()
+ 
+ # Framework for writing tests.
++if (FALSE)
+ ExternalProject_Add (
+     googletest
+     GIT_REPOSITORY "https://github.com/google/googletest.git"
+@@ -23,6 +24,11 @@ set (GTEST_BOTH_LIBRARIES ${GTEST_LIBRARIES} ${GTEST_M
+ 
+ include_directories (${GTEST_INCLUDE_DIRS})
+ 
++endif()
++
++find_package(GTest REQUIRED)
++
++
+ # Special flags fo generating code coverage.
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
+ set (CMAKE_SHARED_LINKER_FLAGS "-fprofile-arcs -ftest-coverage")
+@@ -52,7 +58,7 @@ set (
+     ${PROJECT_SOURCE_DIR}/tests/adapters/boost_matrixtest.cpp
+ )
+ add_executable (munkrestest EXCLUDE_FROM_ALL ${MunkresCppLib_SOURCES} ${MunkresCppTest_SOURCES})
+-target_link_libraries (munkrestest ${GTEST_BOTH_LIBRARIES} gcov pthread)
++target_link_libraries (munkrestest ${GTest} gcov pthread)
+ add_custom_target (tests)
+ add_dependencies  (tests munkrestest)
+ add_dependencies  (munkrestest googletest)
diff --git a/math/munkres-cpp/files/patch-tests_adapters_std__2d__arraytest.cpp b/math/munkres-cpp/files/patch-tests_adapters_std__2d__arraytest.cpp
new file mode 100644
index 000000000000..bdbac7f54854
--- /dev/null
+++ b/math/munkres-cpp/files/patch-tests_adapters_std__2d__arraytest.cpp
@@ -0,0 +1,11 @@
+--- tests/adapters/std_2d_arraytest.cpp.orig	2021-09-09 05:59:29 UTC
++++ tests/adapters/std_2d_arraytest.cpp
+@@ -3,7 +3,7 @@
+ #include <iostream>
+ #include <iomanip>
+ 
+-
++#include <array>
+ 
+ class Adapters_std_2d_array_Test : public ::testing::Test
+ {
diff --git a/math/munkres-cpp/pkg-descr b/math/munkres-cpp/pkg-descr
new file mode 100644
index 000000000000..c07dcdf3018a
--- /dev/null
+++ b/math/munkres-cpp/pkg-descr
@@ -0,0 +1,7 @@
+munkres-cpp is an implementation of the Kuhn-Munkres algorithm in C++.
+
+The Kuhn-Munkres algorithm, also called the Hungarian method, is a combinatorial
+optimization algorithm that solves the assignment problem in polynomial time and
+which anticipated later primal-dual methods.
+
+WWW: https://github.com/saebyn/munkres-cpp


More information about the dev-commits-ports-main mailing list