aboutsummaryrefslogtreecommitdiff
blob: ded21f0ea71dbfb15d42d51877f5fd043748906b (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
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=2

inherit eutils fortran multilib

DESCRIPTION="DFT electronic structure code using a wavelet basis set"
HOMEPAGE="http://inac.cea.fr/L_Sim/BigDFT"
SRC_URI="${HOMEPAGE}/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="cuda mpi"
RDEPEND="cuda? ( dev-util/nvidia-cuda-sdk )
	mpi? ( virtual/mpi )
	virtual/lapack
	virtual/blas"
DEPEND="${RDEPEND}
	>=sys-devel/autoconf-2.59"

FORTRAN="gfortran ifc mpif90"

src_prepare() {
	# Patch taken from sci-physics/abinit-5.7.3 bundled version
	epatch "${FILESDIR}"/${P}-0001.patch
}

src_configure() {
	# Build this as a library for sci-physics/abinit
	econf \
		--with-moduledir=/usr/$(get_libdir)/finclude \
		$(use_enable mpi) \
		$(use_enable cuda cuda-gpu) \
		$(use_with cuda cuda-path /opt/cuda) \
		$(use_with cuda lib-cutils /opt/cuda/lib) \
		FCFLAGS="${FCFLAGS:- ${FFLAGS:- -O2}}"
}

src_test() {
	emake check || die
}

src_install() {
	emake DESTDIR="${D}" install || die "emake install failed"

	dodoc README NEWS AUTHORS INSTALL ChangeLog || die "dodoc failed"
}