You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
113 lines
2.7 KiB
113 lines
2.7 KiB
4 years ago
|
# Copyright 1999-2021 Gentoo Authors
|
||
8 years ago
|
# Distributed under the terms of the GNU General Public License v2
|
||
|
|
||
4 years ago
|
EAPI=7
|
||
8 years ago
|
|
||
|
FORTRAN_NEEDED=fortran
|
||
|
|
||
4 years ago
|
inherit fortran-2 toolchain-funcs flag-o-matic
|
||
8 years ago
|
|
||
|
DESCRIPTION="Parallel matrix preconditioners library"
|
||
7 years ago
|
HOMEPAGE="https://computation.llnl.gov/projects/hypre-scalable-linear-solvers-multigrid-methods"
|
||
3 years ago
|
SRC_URI="https://github.com/hypre-space/hypre/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
||
8 years ago
|
|
||
|
LICENSE="LGPL-2.1"
|
||
|
SLOT="0/${PV}"
|
||
3 years ago
|
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
|
||
5 years ago
|
IUSE="debug examples fortran int64 openmp mpi"
|
||
8 years ago
|
|
||
4 years ago
|
BDEPEND="virtual/pkgconfig"
|
||
8 years ago
|
RDEPEND="
|
||
|
sci-libs/superlu:=
|
||
|
virtual/blas
|
||
|
virtual/lapack
|
||
3 years ago
|
mpi? ( virtual/mpi )
|
||
|
"
|
||
4 years ago
|
DEPEND="${RDEPEND}"
|
||
8 years ago
|
|
||
|
DOCS=( CHANGELOG COPYRIGHT README )
|
||
|
|
||
|
pkg_pretend() {
|
||
3 years ago
|
if [[ ${MERGE_TYPE} != binary ]] && use openmp && [[ $(tc-getCC) == *gcc* ]] ; then
|
||
|
tc-check-openmp
|
||
|
fi
|
||
8 years ago
|
}
|
||
|
|
||
|
pkg_setup() {
|
||
3 years ago
|
if [[ ${MERGE_TYPE} != binary ]] && use openmp && [[ $(tc-getCC) == *gcc* ]] && ! tc-has-openmp ; then
|
||
8 years ago
|
ewarn "You are using a non capable gcc compiler ( < 4.2 ? )"
|
||
|
die "Need an OpenMP capable compiler"
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
src_prepare() {
|
||
|
default
|
||
3 years ago
|
|
||
8 years ago
|
# link with system superlu and propagate LDFLAGS
|
||
|
sed -e "s:@LIBS@:@LIBS@ $($(tc-getPKG_CONFIG) --libs superlu):" \
|
||
|
-e 's:_SHARED@:_SHARED@ $(LDFLAGS):g' \
|
||
|
-i src/config/Makefile.config.in || die
|
||
3 years ago
|
|
||
8 years ago
|
sed -e '/HYPRE_ARCH/s: = :=:g' \
|
||
|
-i src/configure || die
|
||
3 years ago
|
|
||
8 years ago
|
# link with system blas and lapack
|
||
|
sed -e '/^BLASFILES/d' \
|
||
|
-e '/^LAPACKFILES/d' \
|
||
|
-i src/lib/Makefile || die
|
||
|
}
|
||
|
|
||
|
src_configure() {
|
||
|
tc-export CC CXX
|
||
|
append-flags -Dhypre_dgesvd=dgesvd_
|
||
3 years ago
|
|
||
|
if use openmp && [[ $(tc-getCC) == *gcc* ]] ; then
|
||
8 years ago
|
append-flags -fopenmp && append-ldflags -fopenmp
|
||
3 years ago
|
fi
|
||
|
|
||
|
if use mpi ; then
|
||
|
CC=mpicc
|
||
|
FC=mpif77
|
||
|
CXX=mpicxx
|
||
|
fi
|
||
8 years ago
|
|
||
4 years ago
|
cd src || die
|
||
8 years ago
|
|
||
|
# without-superlu: means do not use bundled one
|
||
|
econf \
|
||
|
--enable-shared \
|
||
|
--with-blas-libs="$($(tc-getPKG_CONFIG) --libs-only-l blas | sed -e 's/-l//g')" \
|
||
|
--with-blas-lib-dirs="$($(tc-getPKG_CONFIG) --libs-only-L blas | sed -e 's/-L//g')" \
|
||
|
--with-lapack-libs="$($(tc-getPKG_CONFIG) --libs-only-l lapack | sed -e 's/-l//g')" \
|
||
|
--with-lapack-lib-dirs="$($(tc-getPKG_CONFIG) --libs-only-L lapack | sed -e 's/-L//g')" \
|
||
|
--with-timing \
|
||
|
--without-superlu \
|
||
|
$(use_enable debug) \
|
||
|
$(use_enable openmp hopscotch) \
|
||
|
$(use_enable int64 bigint) \
|
||
|
$(use_enable fortran) \
|
||
|
$(use_with openmp) \
|
||
|
$(use_with mpi MPI)
|
||
|
}
|
||
|
|
||
|
src_compile() {
|
||
|
emake -C src
|
||
|
}
|
||
|
|
||
|
src_test() {
|
||
|
LD_LIBRARY_PATH="${S}/src/lib:${LD_LIBRARY_PATH}" \
|
||
3 years ago
|
PATH="${S}/src/test:${PATH}" \
|
||
|
emake -C src check
|
||
8 years ago
|
}
|
||
|
|
||
|
src_install() {
|
||
|
emake -C src install \
|
||
3 years ago
|
HYPRE_INSTALL_DIR="${ED}" \
|
||
|
HYPRE_LIB_INSTALL="${ED}/usr/$(get_libdir)" \
|
||
|
HYPRE_INC_INSTALL="${ED}/usr/include/hypre"
|
||
4 years ago
|
|
||
8 years ago
|
if use examples; then
|
||
5 years ago
|
dodoc -r src/examples
|
||
8 years ago
|
fi
|
||
|
}
|