sci-libs/colpack: add 1.0.10_p20190621, 9999

Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/44994
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Paul Zander
2026-05-04 17:21:49 +02:00
committed by Sam James
parent 85fc03743c
commit d352b0e638
7 changed files with 366 additions and 0 deletions

View File

@@ -1 +1,2 @@
DIST colpack-1.0.10.tar.gz 658087 BLAKE2B af6409969f0dfee465ad88515d0d4f82525047a8268ac9fd4b0784de1f4fd30ce7ba968502a5d92ad3a86f554fb8f1a786defb09396c8e678f62aeaa3cc25397 SHA512 566b7906c5d0dbcd6dcb9c359510ee8b13bf3249e56d8f88f7806493d1df14f54638a0558d601ab4dbc28f36093795eede57a059a7c4e66438b47bf5a0119808
DIST colpack-1.0.10_p20190621.tar.gz 691679 BLAKE2B 6cca44a160ec973b1567bf7170c1cfca2f375689db8c9bae14cd0a79ea223a2d5d31e07d6bf1f727ebf51d75d316c21bd70b10979a1dedc1d1d1ab3755073ba3 SHA512 2f7216e817210785acc207599173b937233f3f890985df4e7a6d183d4cbd5ebeb3cbe58eaa39e87ce701d1ebdcc7776a03e68914faf04daf96a1e0fe667c088e

View File

@@ -0,0 +1,69 @@
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake toolchain-funcs
MY_PN="ColPack"
DESCRIPTION="C++ algorithms for specialized vertex coloring problems"
HOMEPAGE="https://cscapes.cs.purdue.edu/coloringpage/"
if [[ ${PV} == *9999 ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/CSCsw/ColPack.git"
else
if [[ ${PV} == *_p* ]] ; then
COMMIT="9a7293a8dfd66a60434496b8df5ebb4274d70339"
SRC_URI="
https://github.com/CSCsw/${MY_PN}/archive/${COMMIT}.tar.gz -> ${P}.tar.gz
"
S="${WORKDIR}/${MY_PN}-${COMMIT}"
else
SRC_URI="
https://github.com/CSCsw/${MY_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
"
S="${WORKDIR}/${MY_PN}-${PV}"
fi
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86"
fi
LICENSE="BSD"
SLOT="0"
IUSE="openmp"
RESTRICT="test"
# Upstream is pretty much dead so we backport what's useful
PATCHES=(
"${FILESDIR}/${PN}-1.0.10-PR32.patch" # Fix install
"${FILESDIR}/${PN}-1.0.10-PR34.patch" # [cmake] Recovery .h -> .cpp
"${FILESDIR}/${PN}-1.0.10-PR43.patch" # NULL->string() to eliminate UB, support MSVC 2022
"${FILESDIR}/${PN}-1.0.10-PR47.patch" # Update Main.cpp
)
# "top-level" CMakeLists.txt is in build/cmake ...
CMAKE_USE_DIR="${S}/build/cmake"
BUILD_DIR="${S}_build"
pkg_pretend() {
if [[ ${MERGE_TYPE} != binary ]] && use openmp; then
tc-check-openmp
fi
}
pkg_setup() {
if [[ ${MERGE_TYPE} != binary ]] && use openmp; then
tc-check-openmp
fi
}
src_configure() {
local mycmakeargs=(
# -DENABLE_EXAMPLES="$(usex examples)"
-DENABLE_OPENMP="$(usex openmp)"
)
cmake_src_configure
}

View File

@@ -0,0 +1,69 @@
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake toolchain-funcs
MY_PN="ColPack"
DESCRIPTION="C++ algorithms for specialized vertex coloring problems"
HOMEPAGE="https://cscapes.cs.purdue.edu/coloringpage/"
if [[ ${PV} == *9999 ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/CSCsw/ColPack.git"
else
if [[ ${PV} == *_p* ]] ; then
COMMIT="9a7293a8dfd66a60434496b8df5ebb4274d70339"
SRC_URI="
https://github.com/CSCsw/${MY_PN}/archive/${COMMIT}.tar.gz -> ${P}.tar.gz
"
S="${WORKDIR}/${MY_PN}-${COMMIT}"
else
SRC_URI="
https://github.com/CSCsw/${MY_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
"
S="${WORKDIR}/${MY_PN}-${PV}"
fi
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86"
fi
LICENSE="BSD"
SLOT="0"
IUSE="openmp"
RESTRICT="test"
# Upstream is pretty much dead so we backport what's useful
PATCHES=(
"${FILESDIR}/${PN}-1.0.10-PR32.patch" # Fix install
"${FILESDIR}/${PN}-1.0.10-PR34.patch" # [cmake] Recovery .h -> .cpp
"${FILESDIR}/${PN}-1.0.10-PR43.patch" # NULL->string() to eliminate UB, support MSVC 2022
"${FILESDIR}/${PN}-1.0.10-PR47.patch" # Update Main.cpp
)
# "top-level" CMakeLists.txt is in build/cmake ...
CMAKE_USE_DIR="${S}/build/cmake"
BUILD_DIR="${S}_build"
pkg_pretend() {
if [[ ${MERGE_TYPE} != binary ]] && use openmp; then
tc-check-openmp
fi
}
pkg_setup() {
if [[ ${MERGE_TYPE} != binary ]] && use openmp; then
tc-check-openmp
fi
}
src_configure() {
local mycmakeargs=(
# -DENABLE_EXAMPLES="$(usex examples)"
-DENABLE_OPENMP="$(usex openmp)"
)
cmake_src_configure
}

View File

@@ -0,0 +1,139 @@
From 70e0b8359855c0d29c45d1ea7893fdbdb72fa999 Mon Sep 17 00:00:00 2001
From: ax487 <ax487@gmx.de>
Date: Mon, 28 Oct 2019 12:57:43 +0100
Subject: [PATCH 1/2] Fix install on linux
---
build/cmake/CMakeLists.txt | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/build/cmake/CMakeLists.txt b/build/cmake/CMakeLists.txt
index 6c171c9..dafb92d 100644
--- a/build/cmake/CMakeLists.txt
+++ b/build/cmake/CMakeLists.txt
@@ -69,13 +69,13 @@ if(ENABLE_OPENMP)
endif()
# Define variables to use for organizing the installation.
-include(GNUInstallDirs)
+include(GNUInstallDirs)
if(WIN32)
set(COLPACK_INSTALL_CMAKEDIR ColPack_libs)
set(COLPACK_INSTALL_EXAMPLESBINDIR ColPack_examples)
else()
- set(COLPACK_INSTALL_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/ColPack_libs)
+ set(COLPACK_INSTALL_CMAKEDIR "lib/cmake/ColPack")
# To follow the UNIX Filsystem Hierarchy Standard, we should install
# examples somewhere else:
set(COLPACK_INSTALL_EXAMPLESBINDIR ${CMAKE_INSTALL_LIBDIR}/ColPack_examples)
@@ -141,10 +141,7 @@ endif()
# "EXPORT" helps with creating a ColPackConfig.cmake file to place in the
# installation, to help downstream projects use ColPack.
-install(TARGETS ColPack_static EXPORT ColPackTargets
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/archive
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/library
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/runtime)
+install(TARGETS ColPack_static EXPORT ColPackTargets)
# Shared library.
@@ -170,12 +167,9 @@ if(ENABLE_OPENMP)
target_link_libraries(ColPack_shared PRIVATE ${OpenMP_CXX_FLAGS})
endif()
-install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ColPack_headers)
+install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ColPack)
-install(TARGETS ColPack_shared EXPORT ColPackTargets
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/shared_archive
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/shared_library
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/shared_runtime)
+install(TARGETS ColPack_shared EXPORT ColPackTargets)
From f2395664ec7819cd72bfdca23ecc0a3f2f362246 Mon Sep 17 00:00:00 2001
From: ax487 <ax487@gmx.de>
Date: Mon, 28 Oct 2019 13:43:26 +0100
Subject: [PATCH 2/2] Added namespaces to exported targets
---
build/cmake/CMakeLists.txt | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/build/cmake/CMakeLists.txt b/build/cmake/CMakeLists.txt
index dafb92d..3722c38 100644
--- a/build/cmake/CMakeLists.txt
+++ b/build/cmake/CMakeLists.txt
@@ -75,7 +75,7 @@ if(WIN32)
set(COLPACK_INSTALL_CMAKEDIR ColPack_libs)
set(COLPACK_INSTALL_EXAMPLESBINDIR ColPack_examples)
else()
- set(COLPACK_INSTALL_CMAKEDIR "lib/cmake/ColPack")
+ set(COLPACK_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/ColPack")
# To follow the UNIX Filsystem Hierarchy Standard, we should install
# examples somewhere else:
set(COLPACK_INSTALL_EXAMPLESBINDIR ${CMAKE_INSTALL_LIBDIR}/ColPack_examples)
@@ -132,7 +132,7 @@ target_include_directories(ColPack_static PRIVATE
# "$<BUILD_INTERFACE:${COLPACK_SOURCE_INCLUDE_DIRS}>")
# For clients of an installation of ColPack.
target_include_directories(ColPack_static INTERFACE
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/ColPack>)
if(ENABLE_OPENMP)
set_target_properties(ColPack_static PROPERTIES COMPILE_FLAGS
@@ -141,7 +141,8 @@ endif()
# "EXPORT" helps with creating a ColPackConfig.cmake file to place in the
# installation, to help downstream projects use ColPack.
-install(TARGETS ColPack_static EXPORT ColPackTargets)
+install(TARGETS ColPack_static EXPORT ColPackTargets
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
# Shared library.
@@ -159,7 +160,7 @@ target_include_directories(ColPack_shared PRIVATE
# "$<BUILD_INTERFACE:${COLPACK_SOURCE_INCLUDE_DIRS}>")
# For clients of an installation of ColPack.
target_include_directories(ColPack_shared INTERFACE
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/ColPack>)
if(ENABLE_OPENMP)
set_target_properties(ColPack_shared PROPERTIES COMPILE_FLAGS
@@ -248,23 +249,30 @@ endforeach()
# Create files that define the ColPack targets to import into other projects.
# https://cmake.org/cmake/help/v3.1/manual/cmake-packages.7.html
-install(EXPORT ColPackTargets DESTINATION ${COLPACK_INSTALL_CMAKEDIR})
+
+install(EXPORT ColPackTargets
+ DESTINATION ${COLPACK_INSTALL_CMAKEDIR}
+ NAMESPACE "ColPack::")
# CMake Config file., and version file, which CMake will look for when
# downstream projects use find_package(ColPack).
include(CMakePackageConfigHelpers)
# The ConfigVersion file determines if an installed copy of ColPack is
# compatible with a user's requested version for ColPack.
+
write_basic_package_version_file(
"${CMAKE_BINARY_DIR}/ColPackConfigVersion.cmake"
VERSION ${COLPACK_VERSION}
COMPATIBILITY AnyNewerVersion)
+
configure_package_config_file(ColPackConfig.cmake.in
"${CMAKE_BINARY_DIR}/ColPackConfigToInstall.cmake"
INSTALL_DESTINATION ${COLPACK_INSTALL_CMAKEDIR}
PATH_VARS CMAKE_INSTALL_PREFIX)
+
install(FILES "${CMAKE_BINARY_DIR}/ColPackConfigToInstall.cmake"
DESTINATION ${COLPACK_INSTALL_CMAKEDIR}
RENAME ColPackConfig.cmake)
+
install(FILES "${CMAKE_BINARY_DIR}/ColPackConfigVersion.cmake"
DESTINATION ${COLPACK_INSTALL_CMAKEDIR})

View File

@@ -0,0 +1,22 @@
From 4eca44e762cc32b8079575ab5e70572fa4b5d953 Mon Sep 17 00:00:00 2001
From: Christopher Dembia <cld72@cornell.edu>
Date: Mon, 28 Oct 2019 08:46:31 -0700
Subject: [PATCH] [cmake] Recovery .h -> .cpp
---
build/cmake/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/build/cmake/CMakeLists.txt b/build/cmake/CMakeLists.txt
index 6c171c9..f50ee51 100644
--- a/build/cmake/CMakeLists.txt
+++ b/build/cmake/CMakeLists.txt
@@ -98,7 +98,7 @@ file(GLOB SOURCES
${COLPACK_ROOT_DIR}/src/BipartiteGraphBicoloring/*.cpp
${COLPACK_ROOT_DIR}/src/BipartiteGraphPartialColoring/*.cpp
${COLPACK_ROOT_DIR}/src/GeneralGraphColoring/*.cpp
- ${COLPACK_ROOT_DIR}/src/Recovery/*.h
+ ${COLPACK_ROOT_DIR}/src/Recovery/*.cpp
${COLPACK_ROOT_DIR}/src/SMPGC/*.cpp)
#${COLPACK_ROOT_DIR}/src/PartialD2SMPGC/*.cpp)

View File

@@ -0,0 +1,27 @@
From 96ce0e7bc5ff6ced72f6ba072ac592024d3e9f81 Mon Sep 17 00:00:00 2001
From: Conrad Poelman <cpgithub@stellarscience.com>
Date: Tue, 5 Oct 2021 15:50:36 -0400
Subject: [PATCH] NULL->string() to eliminate UB, support MSVC 2022
Per https://www.cplusplus.com/reference/string/string/string: "If s is a null pointer ... it causes undefined behavior."
This article by C++ Standards Committee member Aaron Ballman reinforces that: https://wiki.sei.cmu.edu/confluence/display/cplusplus/STR51-CPP.+Do+not+attempt+to+create+a+std%3A%3Astring+from+a+null+pointer
The MSVC 2022 Preview release, with /std:c++latest, flags this lines as an error.
---
src/Utilities/StringTokenizer.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Utilities/StringTokenizer.cpp b/src/Utilities/StringTokenizer.cpp
index 6a37b50..d50ace3 100644
--- a/src/Utilities/StringTokenizer.cpp
+++ b/src/Utilities/StringTokenizer.cpp
@@ -221,7 +221,7 @@ namespace ColPack
if (TokenStringLength == 0)
{
- return(NULL);
+ return string();
}
if (DelimiterStringLength == 0)

View File

@@ -0,0 +1,39 @@
From 8d8a6c1e4c901c9a78126b1f4c231746062f005e Mon Sep 17 00:00:00 2001
From: alexeyroytman <33158117+alexeyroytman@users.noreply.github.com>
Date: Sun, 20 Nov 2022 21:48:04 +0200
Subject: [PATCH] Update Main.cpp
Fixing multiple typos in help message.
---
Examples/ColPackAll/Main.cpp | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/Examples/ColPackAll/Main.cpp b/Examples/ColPackAll/Main.cpp
index b6e3c49..237e892 100644
--- a/Examples/ColPackAll/Main.cpp
+++ b/Examples/ColPackAll/Main.cpp
@@ -240,17 +240,17 @@ void usage(){
" the following options shall be supported:\n"
"\n"
" -f files Indicates the graph file path name.\n"
- " -v Indicates verbose flag will be truned on and there will display more rich infomration.\n"
+ " -v Indicates verbose flag will be turned on and there will display more rich information.\n"
" -o orders Indicates the orderings. Could be 'RANDOM','NATURAL','LARGEST_FIRST','SMALLEST_LAST','DYNAMIC_LARGEST_FIRST','INCIDENCE_DEGREE'... . There could be some specific ordering for specific methods\n"
- " -m methods Indicates the methods. Could be 'DISTANCE_ONE','ACYCLIC','STAR','DISTNACE_TWO','ROW_PARTIAL_DISTANCE_TWO','D1_OMP_GMMP','PD2_OMP_GMMP',...\n"
+ " -m methods Indicates the methods. Could be 'DISTANCE_ONE','ACYCLIC','STAR','DISTANCE_TWO','ROW_PARTIAL_DISTANCE_TWO','D1_OMP_GMMP','PD2_OMP_GMMP',...\n"
" -nT Indicates number of threads used of parallel graph coloring\n"
- " -side Indiecate Row (L) or Column (R) side of coloring for parallel partial colroing.\n"
+ " -side Indicate Row (L) or Column (R) side of coloring for parallel partial coloring.\n"
"\n"
"DESCRIPTION\n"
- " if the method is one of 'DISTANCE_ONE','ACYCLIC','STAR','DISTANCE_TWO','ROW_PARTIAL_DISTANCE_TWO' The method belongs to gereral coloring on general graphs.\n"
- " if the method is one of 'ROW_PARTIAL_DISTANCE_TWO','COLUMN_PARTIAL_DISTANCE_TWO' The method belongs to partial coloring on bipartite graphs.\n"
- " if the method is one of 'IMPLICIT_COVERING__STAR_BICOLORING','EXPLICIT_COVERING__STAR_BICOLORING',EXPLICIT_COVERING__MODIFIED_STAR_BICOLORING','IMPLICIT_COVERING__GREEDY_STAR_BICOLORING'. The method belongs to bicoloring on bipartite graphs.\n"
- " if the method is one of 'D1_OMP_GM3P, D1_OMP_GM3P_LF, D1_OMP_GMMP, D1_OMP_GMMP_LF,D1_OMP_SERIAL, D1_OMP_SERIAL_LF, D1_OMP_JP, D1_OMP_JP_LF ,D1_OMP_MTJP, D1_OMP_MTJP_LF, D1_OMP_HBJP_GM3P, D1_OMP_HBJP_GM3P_.., D1_OMP_HBJP_GMMP.., D1_OMP_HBJP_.... ,D1_OMP_HBMTP_GM3P, D1_OMP_HBMTJP_GM3P_.., D1_OMP_HBMTJP_GMMP.., D1_OMP_HBMTJP_.... ,D2_OMP_GM3P, D2_OMP_GM3P_LF ,D2_OMP_GMMP, D2_OMP_GMMP_LF ,D2_OMP_SERIAL, D2_OMP_SERIAL_LF' the method belongs to parallel general graph coloring\n"
+ " If the method is one of 'DISTANCE_ONE','ACYCLIC','STAR','DISTANCE_TWO','ROW_PARTIAL_DISTANCE_TWO' the method belongs to general coloring on general graphs.\n"
+ " If the method is one of 'ROW_PARTIAL_DISTANCE_TWO','COLUMN_PARTIAL_DISTANCE_TWO' the method belongs to partial coloring on bipartite graphs.\n"
+ " If the method is one of 'IMPLICIT_COVERING__STAR_BICOLORING','EXPLICIT_COVERING__STAR_BICOLORING',EXPLICIT_COVERING__MODIFIED_STAR_BICOLORING','IMPLICIT_COVERING__GREEDY_STAR_BICOLORING' the method belongs to bicoloring on bipartite graphs.\n"
+ " If the method is one of 'D1_OMP_GM3P, D1_OMP_GM3P_LF, D1_OMP_GMMP, D1_OMP_GMMP_LF,D1_OMP_SERIAL, D1_OMP_SERIAL_LF, D1_OMP_JP, D1_OMP_JP_LF ,D1_OMP_MTJP, D1_OMP_MTJP_LF, D1_OMP_HBJP_GM3P, D1_OMP_HBJP_GM3P_.., D1_OMP_HBJP_GMMP.., D1_OMP_HBJP_.... ,D1_OMP_HBMTP_GM3P, D1_OMP_HBMTJP_GM3P_.., D1_OMP_HBMTJP_GMMP.., D1_OMP_HBMTJP_.... ,D2_OMP_GM3P, D2_OMP_GM3P_LF ,D2_OMP_GMMP, D2_OMP_GMMP_LF ,D2_OMP_SERIAL, D2_OMP_SERIAL_LF' the method belongs to parallel general graph coloring\n"
"\n"
"EXAMPLE\n"
"./ColPack -f ../Graphs/bcsstk01.mtx -o LARGEST_FIRST RANDOM -m DISTANCE_ONE -v\n"