aboutsummaryrefslogtreecommitdiff
blob: 2c8144ac042a48c0f3bc55c232d4b45dd75428dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit flag-o-matic fortran-2 toolchain-funcs

DESCRIPTION="Jacobi-Davidson type method for the generalized standard eigenvalue problem"
HOMEPAGE="https://www.win.tue.nl/~hochsten/jd"
SRC_URI="https://www.win.tue.nl/~hochsten/jd/${PN}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/${PN}"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64"
IUSE="doc test"

# virtual/lapack does not pull in [deprecated] so we have to deal with this mess like this until it does
DEPEND="
	virtual/blas
	virtual/lapack
	|| ( sci-libs/openblas !sci-libs/lapack[-deprecated(-)] )
"
RDEPEND="${DEPEND}"
BDEPEND="doc? ( dev-texlive/texlive-latex )"

PATCHES=( "${FILESDIR}/makefile.patch" )
RESTRICT="!test? ( test )"

src_prepare() {
	append-fflags "$($(tc-getPKG_CONFIG) --libs blas) $($(tc-getPKG_CONFIG) --libs lapack)"
	default
}

src_compile() {
	if use doc; then
		pdflatex manual.tex || die
	fi

	cd "jdlib" || die
	emake
	ln -s libjdqz.so.0 libjdqz.so || die
}

src_test() {
	pushd "jdtest" || die
	emake
	popd || die
	LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:./jdlib" ./jdtest/example || die
}

src_install() {
	dolib.so jdlib/libjdqz.so
	dolib.so jdlib/libjdqz.so.0

	use doc && dodoc manual.pdf
}