summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernd Waibel <waebbl-gentoo@posteo.net>2021-10-04 20:56:43 +0200
committerJakov Smolić <jsmolic@gentoo.org>2021-10-04 21:33:18 +0200
commite5c0a08d3cecd7466fbda92233bbbd498e275505 (patch)
treee5728c127f8eb39e58987e052ac4b54cdca96163 /sci-libs/sundials/sundials-5.8.0.ebuild
parentx11-wm/icewm: Removed old (diff)
downloadgentoo-e5c0a08d3cecd7466fbda92233bbbd498e275505.tar.gz
gentoo-e5c0a08d3cecd7466fbda92233bbbd498e275505.tar.bz2
gentoo-e5c0a08d3cecd7466fbda92233bbbd498e275505.zip
sci-libs/sundials: add 5.8.0
Closes: https://bugs.gentoo.org/787341 Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net> Signed-off-by: Jakov Smolić <jsmolic@gentoo.org>
Diffstat (limited to 'sci-libs/sundials/sundials-5.8.0.ebuild')
-rw-r--r--sci-libs/sundials/sundials-5.8.0.ebuild114
1 files changed, 114 insertions, 0 deletions
diff --git a/sci-libs/sundials/sundials-5.8.0.ebuild b/sci-libs/sundials/sundials-5.8.0.ebuild
new file mode 100644
index 00000000000..894e7ef201c
--- /dev/null
+++ b/sci-libs/sundials/sundials-5.8.0.ebuild
@@ -0,0 +1,114 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+CMAKE_MAKEFILE_GENERATOR="emake"
+FORTRAN_NEEDED=fortran
+FORTRAN_STANDARD="77 90 2003"
+# if FFLAGS and FCFLAGS are set then should be equal
+
+inherit cmake flag-o-matic fortran-2 toolchain-funcs
+
+DESCRIPTION="Suite of nonlinear solvers"
+HOMEPAGE="https://computation.llnl.gov/projects/sundials"
+SRC_URI="https://github.com/LLNL/${PN}/releases/download/v${PV}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0/$(ver_cut 1)"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc examples fortran hypre lapack mpi openmp sparse +static-libs superlumt threads"
+REQUIRED_USE="
+ fortran? ( static-libs )
+ hypre? ( mpi )
+"
+
+BDEPEND="virtual/pkgconfig"
+RDEPEND="
+ lapack? ( virtual/lapack )
+ mpi? (
+ sci-libs/hypre:=[fortran?,mpi?]
+ virtual/mpi[fortran?]
+ )
+ sparse? ( sci-libs/klu )
+ superlumt? ( sci-libs/superlu_mt:= )
+"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-fix-license-install-path.patch
+)
+
+pkg_setup() {
+ if [[ ${MERGE_TYPE} != binary ]] && use openmp && [[ $(tc-getCC) == *gcc ]] && ! tc-has-openmp; then
+ ewarn "OpenMP is not available in your current selected gcc"
+ die "need openmp capable gcc"
+ fi
+}
+
+src_prepare() {
+ # bug #707240
+ append-cflags -fcommon
+ use threads && append-ldflags -pthread
+
+ cmake_src_prepare
+}
+
+src_configure() {
+ mycmakeargs+=(
+ -DBUILD_FORTRAN77_INTERFACE=$(usex fortran)
+ -DBUILD_FORTRAN_MODULE_INTERFACE=$(usex fortran)
+ -DBUILD_SHARED_LIBS=ON
+ -DBUILD_STATIC_LIBS=$(usex static-libs)
+ -DENABLE_HYPRE=$(usex hypre)
+ -DENABLE_KLU=$(usex sparse)
+ -DENABLE_LAPACK=$(usex lapack)
+ -DENABLE_MPI=$(usex mpi)
+ -DENABLE_OPENMP=$(usex openmp)
+ -DENABLE_PTHREAD=$(usex threads)
+ -DENABLE_SUPERLUMT=$(usex superlumt)
+ -DEXAMPLES_INSTALL=ON
+ -DEXAMPLES_INSTALL_PATH="/usr/share/doc/${PF}/examples"
+ -DSUPERLUMT_INCLUDE_DIR="${EPREFIX}/usr/include/superlu_mt"
+ -DSUPERLUMT_LIBRARY="-lsuperlu_mt"
+ -DUSE_GENERIC_MATH=ON
+ )
+ if use examples; then
+ mycmakeargs+=(
+ -DEXAMPLES_ENABLE_C=ON
+ -DEXAMPLES_ENABLE_CXX=ON
+ )
+ if use fortran; then
+ mycmakeargs+=(
+ -DEXAMPLES_ENABLE_F77=ON
+ -DEXAMPLES_ENABLE_F90=ON
+ -DEXAMPLES_ENABLE_F2003=ON
+ )
+ fi
+ fi
+
+ if use fortran; then
+ mycmakeargs+=(
+ -DFortran_INSTALL_MODDIR="${EPREFIX}/usr/$(get_libdir)/fortran"
+ )
+ fi
+
+ if use hypre; then
+ mycmakeargs+=(
+ -DHYPRE_INCLUDE_DIR="${EPREFIX}/usr/include/hypre"
+ -DHYPRE_LIBRARY="${EPREFIX}/usr/$(get_libdir)/libHYPRE.so"
+ )
+ fi
+
+ if use sparse; then
+ mycmakeargs+=(
+ -DKLU_LIBRARY="${EPREFIX}/usr/$(get_libdir)/libklu.so"
+ )
+ fi
+ cmake_src_configure
+}
+
+src_install() {
+ cmake_src_install
+ use doc && dodoc doc/*/*.pdf
+}