From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1520766-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 2BDEE15806E
	for <garchives@archives.gentoo.org>; Tue, 23 May 2023 11:03:04 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 70FF7E0928;
	Tue, 23 May 2023 11:03:03 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 4F386E0928
	for <gentoo-commits@lists.gentoo.org>; Tue, 23 May 2023 11:03:03 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 11F72340871
	for <gentoo-commits@lists.gentoo.org>; Tue, 23 May 2023 11:03:02 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 70CAB8E4
	for <gentoo-commits@lists.gentoo.org>; Tue, 23 May 2023 11:03:00 +0000 (UTC)
From: "Matthias Maier" <tamiko@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Matthias Maier" <tamiko@gentoo.org>
Message-ID: <1684839777.959b0c2f1f74a0c99b87c85083c829fc44129ad9.tamiko@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/trilinos/
X-VCS-Repository: repo/gentoo
X-VCS-Files: sci-libs/trilinos/Manifest sci-libs/trilinos/trilinos-14.0.0.ebuild
X-VCS-Directories: sci-libs/trilinos/
X-VCS-Committer: tamiko
X-VCS-Committer-Name: Matthias Maier
X-VCS-Revision: 959b0c2f1f74a0c99b87c85083c829fc44129ad9
X-VCS-Branch: master
Date: Tue, 23 May 2023 11:03:00 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 7090b2b8-df1d-405c-8bd0-c12ce582aa42
X-Archives-Hash: 84bad8504d549f1284e0cd2f7a32ccd5

commit:     959b0c2f1f74a0c99b87c85083c829fc44129ad9
Author:     Matthias Maier <tamiko <AT> gentoo <DOT> org>
AuthorDate: Tue May 23 11:01:37 2023 +0000
Commit:     Matthias Maier <tamiko <AT> gentoo <DOT> org>
CommitDate: Tue May 23 11:02:57 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=959b0c2f

sci-libs/trilinos: add 14.0.0

Signed-off-by: Matthias Maier <tamiko <AT> gentoo.org>

 sci-libs/trilinos/Manifest               |   1 +
 sci-libs/trilinos/trilinos-14.0.0.ebuild | 256 +++++++++++++++++++++++++++++++
 2 files changed, 257 insertions(+)

diff --git a/sci-libs/trilinos/Manifest b/sci-libs/trilinos/Manifest
index 5634d266afe3..ec1f4d6749d7 100644
--- a/sci-libs/trilinos/Manifest
+++ b/sci-libs/trilinos/Manifest
@@ -1,3 +1,4 @@
 DIST trilinos-13.4.0-patches-r0.tar.xz 8740 BLAKE2B 333ab9ff1acb2f4b08007c7b99b96f023f6c742e4f991fc0ab9dd6595be7e3e319a77d5e329790cedca72d7a9060df837549d28e8a6cb4b8a838570d455ae356 SHA512 f30c16801cadec2a612ab2f7d3ca05c5ddfdfc513343a182562253cdfb58d38fa8b771ab07f7bc6bcb2505d146469da2ddda478f74447de746d5eca850da123e
 DIST trilinos-13.4.0.tar.gz 168733479 BLAKE2B 3c4a1c89b792ec771c6347eebb6bb54a82fa5f172d1c5934bbd42c8bc9708a71451bd030ec0f5264191a62169b3c1305ac7a1290b3ab4845fb6e8ffef15ee03c SHA512 27a5636bac8106a0705948ca4705b739878f0d8afa74264d1cd31036811084457e27e03e86dfad59a80d5e9ee798237fa930b50574ec3e43979e53c6ab5da535
 DIST trilinos-13.4.1.tar.gz 168720416 BLAKE2B 5201c36aa998045f4eab99b67fce25f9a2f2a9524b8ca1147cd8db9ccc306e3df61336df3b2ee981317c8defbae2df9e36546a0e5ddfed3142213e437e4dfba0 SHA512 9c0fb3af2fa625cd0af1309bfa61c212e12657820707348c81355d506e07f540da5e42aa30237fbc80adf257bb636029345f248abaf7ef96fcdaed1c28ec3a19
+DIST trilinos-14.0.0.tar.gz 179086187 BLAKE2B 0e0c3e3fa4b88164cd7e90720ec42eb007f8e89734e5537a7eba1f17754faf30c21fa1d77f7e8a7968bdb8bb230596a1adc74f8170577fd7b4eccb2e88c5b8f6 SHA512 b08fcf4f6bf2605267c44c038f352949e5bfe14b853de77e4c80e28f66c088ead1699b1e49f8475f1b98ce5a21238b98a299e760f1373e585c78b65120fa18e5

diff --git a/sci-libs/trilinos/trilinos-14.0.0.ebuild b/sci-libs/trilinos/trilinos-14.0.0.ebuild
new file mode 100644
index 000000000000..ba271797a58f
--- /dev/null
+++ b/sci-libs/trilinos/trilinos-14.0.0.ebuild
@@ -0,0 +1,256 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+CMAKE_MAKEFILE_GENERATOR=emake
+inherit cmake toolchain-funcs
+
+DESCRIPTION="Scientific library collection for large scale problems"
+HOMEPAGE="http://trilinos.sandia.gov/"
+MY_PV="${PV//\./-}"
+PATCHSET="r0"
+SRC_URI="https://github.com/${PN}/Trilinos/archive/${PN}-release-${MY_PV}.tar.gz -> ${P}.tar.gz"
+
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+LICENSE="BSD LGPL-2.1"
+SLOT="0"
+
+IUSE="
+	adolc all-packages arprec clp cuda eigen glpk gtest hdf5 hwloc hypre
+	matio metis mkl mumps netcdf openmp petsc qd scalapack scotch sparse
+	superlu taucs tbb test threads tvmet yaml zlib X
+"
+
+# TODO: fix export cmake function for tests
+RESTRICT="test"
+
+RDEPEND="
+	!dev-cpp/kokkos
+	dev-libs/boost:=
+	sys-libs/binutils-libs:=
+	virtual/blas
+	virtual/lapack
+	virtual/mpi
+	adolc? ( sci-libs/adolc )
+	arprec? ( sci-libs/arprec )
+	clp? ( sci-libs/coinor-clp )
+	cuda? ( >=dev-util/nvidia-cuda-toolkit-3.2 )
+	eigen? ( dev-cpp/eigen:3 )
+	glpk? ( sci-mathematics/glpk )
+	gtest? ( dev-cpp/gtest )
+	hdf5? ( sci-libs/hdf5:=[mpi] )
+	hypre? ( sci-libs/hypre:= )
+	hwloc? ( sys-apps/hwloc:= )
+	matio? ( sci-libs/matio )
+	mkl? ( sci-libs/mkl )
+	metis? ( sci-libs/metis )
+	mumps? ( sci-libs/mumps )
+	netcdf? ( sci-libs/netcdf:= )
+	petsc? ( sci-mathematics/petsc )
+	qd? ( sci-libs/qd )
+	scalapack? ( sci-libs/scalapack )
+	scotch? ( sci-libs/scotch:= )
+	sparse? ( sci-libs/cxsparse sci-libs/umfpack )
+	superlu? ( sci-libs/superlu:= )
+	taucs? ( sci-libs/taucs )
+	tbb? ( dev-cpp/tbb:= )
+	tvmet? ( dev-libs/tvmet )
+	yaml? ( dev-cpp/yaml-cpp:= )
+	zlib? ( sys-libs/zlib )
+	X? ( x11-libs/libX11 )"
+DEPEND="${RDEPEND}
+	virtual/pkgconfig"
+
+S="${WORKDIR}/Trilinos-${PN}-release-${MY_PV}"
+
+PATCHES=(
+)
+
+pkg_pretend() {
+	[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+pkg_setup() {
+	[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+trilinos_conf() {
+	local dirs libs d
+	for d in $($(tc-getPKG_CONFIG) --libs-only-L $1); do
+		dirs="${dirs};${d:2}"
+	done
+	[[ -n ${dirs} ]] && mycmakeargs+=( "-D${2}_LIBRARY_DIRS=${dirs:1}" )
+	for d in $($(tc-getPKG_CONFIG) --libs-only-l $1); do
+		libs="${libs};${d:2}"
+	done
+	[[ -n ${libs} ]] && mycmakeargs+=( "-D${2}_LIBRARY_NAMES=${libs:1}" )
+	dirs=""
+	for d in $($(tc-getPKG_CONFIG) --cflags-only-I $1); do
+		dirs="${dirs};${d:2}"
+	done
+	[[ -n ${dirs} ]] && mycmakeargs+=( "-D${2}_INCLUDE_DIRS=${dirs:1}" )
+}
+
+#
+# The following packages are currently disabled:
+#  - Adelus/Zadelus due to underlinkage.
+#  - Moertel due to underlinkage
+#  - SEACAS is incompatible with netcdf, see
+#    https://github.com/trilinos/Trilinos/tree/master/packages/seacas#netcdf
+#
+
+src_configure() {
+	local mycmakeargs=(
+		-DBUILD_SHARED_LIBS=ON
+		-DCMAKE_INSTALL_PREFIX="${EPREFIX}"
+		-DCMAKE_SKIP_INSTALL_RPATH=ON
+		-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=OFF
+		-DTrilinos_INSTALL_CONFIG_DIR="${EPREFIX}/usr/$(get_libdir)/cmake"
+		-DTrilinos_INSTALL_INCLUDE_DIR="${EPREFIX}/usr/include/trilinos"
+		-DTrilinos_INSTALL_LIB_DIR="${EPREFIX}/usr/$(get_libdir)/trilinos"
+		-DTrilinos_ENABLE_ALL_PACKAGES="$(usex all-packages)"
+		-DTrilinos_ENABLE_Adelus=OFF
+		-DTrilinos_ENABLE_Moertel=OFF
+		-DTrilinos_ENABLE_PyTrilinos=OFF
+		-DTrilinos_ENABLE_SEACAS=OFF
+		-DTrilinos_ENABLE_Amesos=ON
+		-DTrilinos_ENABLE_AztecOO=ON
+		-DTrilinos_ENABLE_COMPLEX_DOUBLE=ON
+		-DTrilinos_ENABLE_COMPLEX_FLOAT=ON
+		-DTrilinos_ENABLE_EpetraExt=ON
+		-DTrilinos_ENABLE_Epetra=ON
+		-DTrilinos_ENABLE_Ifpack=ON
+		-DTrilinos_ENABLE_ML=ON
+		-DTrilinos_ENABLE_MueLu=ON
+		-DTrilinos_ENABLE_OpenMP="$(usex openmp)"
+		-DTrilinos_ENABLE_ROL=ON
+		-DTrilinos_ENABLE_Sacado=ON
+		-DTrilinos_ENABLE_Teuchos=ON
+		-DTrilinos_ENABLE_Tpetra=ON
+		-DTrilinos_ENABLE_Zoltan=ON
+		-DTrilinos_ENABLE_TESTS="$(usex test)"
+		-DTPL_ENABLE_BinUtils=ON
+		-DTPL_ENABLE_BLAS=ON
+		-DTPL_ENABLE_LAPACK=ON
+		-DTPL_ENABLE_MPI=ON
+		-DTPL_ENABLE_ADOLC="$(usex adolc)"
+		-DTPL_ENABLE_AMD="$(usex sparse)"
+		-DTPL_ENABLE_ARPREC="$(usex arprec)"
+		-DTPL_ENABLE_BLACS="$(usex scalapack)"
+		-DTPL_ENABLE_BoostLib=ON
+		-DTPL_ENABLE_Boost=ON
+		-DTPL_ENABLE_Clp="$(usex clp)"
+		-DTPL_ENABLE_CSparse="$(usex sparse)"
+		-DTPL_ENABLE_CUDA="$(usex cuda)"
+		-DTPL_ENABLE_CUSPARSE="$(usex cuda)"
+		-DTPL_ENABLE_Eigen="$(usex eigen)"
+		-DTPL_ENABLE_GLPK="$(usex glpk)"
+		-DTPL_ENABLE_gtest="$(usex gtest)"
+		-DTPL_ENABLE_HDF5="$(usex hdf5)"
+		-DTPL_ENABLE_HWLOC="$(usex hwloc)"
+		-DTPL_ENABLE_HYPRE="$(usex hypre)"
+		-DTPL_ENABLE_Matio="$(usex matio)"
+		-DTPL_ENABLE_METIS="$(usex metis)"
+		-DTPL_ENABLE_MKL="$(usex mkl)"
+		-DTPL_ENABLE_MUMPS="$(usex mumps)"
+		-DTPL_ENABLE_Netcdf="$(usex netcdf)"
+		-DTPL_ENABLE_PARDISO_MKL="$(usex mkl)"
+		-DTPL_ENABLE_PETSC="$(usex petsc)"
+		-DTPL_ENABLE_Pthread="$(usex threads)"
+		-DTPL_ENABLE_QD="$(usex qd)"
+		-DTPL_ENABLE_SCALAPACK="$(usex scalapack)"
+		-DTPL_ENABLE_Scotch="$(usex scotch)"
+		-DTPL_ENABLE_SuperLU="$(usex superlu)"
+		-DTPL_ENABLE_TAUCS="$(usex taucs)"
+		-DTPL_ENABLE_TBB="$(usex tbb)"
+		-DTPL_ENABLE_Thrust="$(usex cuda)"
+		-DTPL_ENABLE_TVMET="$(usex tvmet)"
+		-DTPL_ENABLE_UMFPACK="$(usex sparse)"
+		-DTPL_ENABLE_X11="$(usex X)"
+		-DTPL_ENABLE_yaml-cpp="$(usex yaml)"
+		-DTPL_ENABLE_Zlib="$(usex zlib)"
+	)
+
+	#
+	# Make sure some critical configuration options are always set
+	# correctly independently of what Trilinos dependency resolver thinks
+	# it should be doing.
+	#
+	local mycmakeargs+=(
+		-DAmesos2_ENABLE_LAPACK=ON
+		-DAmesos2_ENABLE_MUMPS=OFF
+		-DTpetra_INST_SERIAL=ON
+	)
+
+	use eigen && \
+		mycmakeargs+=(
+		-DEigen_INCLUDE_DIRS="${EPREFIX}/usr/include/eigen3"
+	)
+	use hypre && \
+		mycmakeargs+=(
+		-DHYPRE_INCLUDE_DIRS="${EPREFIX}/usr/include/hypre"
+	)
+	use scotch && \
+		mycmakeargs+=(
+		-DScotch_INCLUDE_DIRS="${EPREFIX}/usr/include/scotch"
+	)
+
+	# cxsparse is a rewrite of csparse + extras
+	use sparse && \
+		mycmakeargs+=(
+		-DCSparse_LIBRARY_NAMES="cxsparse"
+	)
+
+	# mandatory blas and lapack
+	trilinos_conf blas BLAS
+	trilinos_conf lapack LAPACK
+	use superlu && trilinos_conf superlu SuperLU
+	use metis && trilinos_conf metis METIS
+
+	# blacs library is included in scalapack these days
+	if use scalapack; then
+		trilinos_conf scalapack SCALAPACK
+		mycmakeargs+=(
+			-DBLACS_LIBRARY_NAMES="scalapack"
+			-DBLACS_INCLUDE_DIRS="${EPREFIX}/usr/include/blacs"
+		)
+	fi
+
+	#
+	# Make sure we use the compiler wrappers in order to build trilinos.
+	#
+	[ ! -z "${CC}"] && export OMPI_CC="${CC}" MPICH_CC="${CC}" && tc-export OMPI_CC MPICH_CC
+	[ ! -z "${CXX}"] && export OMPI_CXX="${CXX}" MPICH_CXX="${CXX}" && tc-export OMPI_CXX MPICH_CXX
+	export CC=mpicc CXX=mpicxx && tc-export CC CXX
+
+	# Trilinos needs a custom build type:
+	local CMAKE_BUILD_TYPE=Release
+
+	cmake_src_configure
+}
+
+src_install() {
+	cmake_src_install
+
+	# Clean up the mess:
+
+	# Let us move the bin directory out of the way to avoid potential
+	# clashes due to very generically named binaries such as
+	# »nvcc_wrapper«, etc.
+	mv "${ED}"/bin "${ED}/usr/$(get_libdir)"/trilinos || die "mv failed"
+
+	# Move the cmake directory to the right location:
+	mkdir -p "${ED}/usr/$(get_libdir)"/cmake
+	mv "${ED}/usr/$(get_libdir)"/trilinos/cmake/* "${ED}/usr/$(get_libdir)"/cmake || die "mv failed"
+	rmdir "${ED}/usr/$(get_libdir)/trilinos/cmake" || die "rmdir failed"
+
+	# Register $(get_libdir)/trilinos in LDPATH so that the dynamic linker
+	# has a chance to pick up the libraries, also add Trilinos' binaries ot
+	# the PATH environment variable.
+	cat >> "${T}"/99trilinos <<- EOF
+	LDPATH="${EPREFIX}/usr/$(get_libdir)/trilinos"
+	PATH="${EPREFIX}/usr/$(get_libdir)/trilinos/bin"
+	EOF
+	doenvd "${T}"/99trilinos
+}