summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Szuba <marecki@gentoo.org>2021-07-16 11:08:57 +0100
committerMarek Szuba <marecki@gentoo.org>2021-07-16 12:43:26 +0100
commit9280e069ddb743ca233d2091b7ccb5a74e3c1841 (patch)
treeaa810a24b05fb2bf4c7c7352c74ac2c3aeaafb5a /sci-libs
parentsci-libs/parmetis: major refactoring (diff)
downloadgentoo-9280e069ddb743ca233d2091b7ccb5a74e3c1841.tar.gz
gentoo-9280e069ddb743ca233d2091b7ccb5a74e3c1841.tar.bz2
gentoo-9280e069ddb743ca233d2091b7ccb5a74e3c1841.zip
sci-libs/metis: support USE="doc double-precision examples int64"
USE flags: all of these were implemented (incorrectly in case of the two type switchers, I might add) for the METIS version bundled in sci-libs/parmetis yet not here. Signed-off-by: Marek Szuba <marecki@gentoo.org>
Diffstat (limited to 'sci-libs')
-rw-r--r--sci-libs/metis/metadata.xml6
-rw-r--r--sci-libs/metis/metis-5.1.0-r5.ebuild79
2 files changed, 84 insertions, 1 deletions
diff --git a/sci-libs/metis/metadata.xml b/sci-libs/metis/metadata.xml
index 142ea93c83ad..cfc70289ed32 100644
--- a/sci-libs/metis/metadata.xml
+++ b/sci-libs/metis/metadata.xml
@@ -11,5 +11,9 @@
orderings for sparse matrices. The algorithms implemented in METIS are
based on the multilevel recursive-bisection, multilevel k-way, and
multi-constraint partitioning schemes.
-</longdescription>
+ </longdescription>
+ <use>
+ <flag name="double-precision">Use double- rather than single-precision floating-point representation</flag>
+ <flag name="int64">Use 64- rather than 32-bit integer representation (needed for &gt; 2^31 vertices)</flag>
+ </use>
</pkgmetadata>
diff --git a/sci-libs/metis/metis-5.1.0-r5.ebuild b/sci-libs/metis/metis-5.1.0-r5.ebuild
new file mode 100644
index 000000000000..f10620aef76d
--- /dev/null
+++ b/sci-libs/metis/metis-5.1.0-r5.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake
+
+DESCRIPTION="A package for unstructured serial graph partitioning"
+HOMEPAGE="https://www-users.cs.umn.edu/~karypis/metis/metis/"
+SRC_URI="http://glaros.dtc.umn.edu/gkhome/fetch/sw/${PN}/${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc double-precision examples int64 openmp"
+
+RDEPEND="!sci-libs/parmetis"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-shared-GKlib.patch
+ "${FILESDIR}"/${P}-multilib.patch
+ "${FILESDIR}"/${P}-remove-GKlib-O3.patch
+)
+
+src_prepare() {
+ if use int64; then
+ sed -i -e '/^#define IDXTYPEWIDTH/s/32/64/' include/metis.h || die
+ fi
+
+ if use double-precision; then
+ sed -i -e '/^#define REALTYPEWIDTH/s/32/64/' include/metis.h || die
+ fi
+
+ cmake_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DGKLIB_PATH="${S}"/GKlib
+ -DSHARED=yes
+ -DOPENMP=$(usex openmp)
+ )
+ cmake_src_configure
+}
+
+src_test() {
+ cd graphs || die
+ local PATH="${BUILD_DIR}"/programs/:${PATH}
+
+ ndmetis mdual.graph || die
+ mpmetis metis.mesh 2 || die
+ gpmetis test.mgraph 4 || die
+ gpmetis copter2.graph 4 || die
+ graphchk 4elt.graph || die
+}
+
+src_install() {
+ cmake_src_install
+ use doc && dodoc manual/manual.pdf
+ if use examples; then
+ docinto examples
+ dodoc -r programs graphs
+ fi
+
+ cat >> "${T}"/metis.pc <<- EOF || die
+ prefix=${EPREFIX}/usr
+ exec_prefix=\${prefix}
+ libdir=\${exec_prefix}/$(get_libdir)
+ includedir=\${prefix}/include
+
+ Name: METIS
+ Description: Software for partioning unstructured graphes and meshes
+ Version: ${PV}
+ Cflags: -I\${includedir}/metis
+ Libs: -L\${libdir} -lmetis
+ EOF
+ insinto /usr/$(get_libdir)/pkgconfig
+ doins "${T}"/metis.pc
+}