summaryrefslogtreecommitdiff
blob: 8cb020349575789efd614f197698e6f16b58e520 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-cluster/openmpi/openmpi-1.1.2.ebuild,v 1.7 2007/07/14 22:18:04 mr_bones_ Exp $

inherit eutils multilib flag-o-matic toolchain-funcs fortran

MY_P=${P/-mpi}
S=${WORKDIR}/${MY_P}

DESCRIPTION="A high-performance message passing library (MPI)"
HOMEPAGE="http://www.open-mpi.org"
SRC_URI="http://www.open-mpi.org/software/ompi/v1.1/downloads/${MY_P}.tar.bz2"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="pbs fortran threads"
RDEPEND="virtual/libc
		pbs? ( virtual/pbs )
		!sys-cluster/mpich
		!sys-cluster/lam-mpi
		!sys-cluster/mpich2"
DEPEND="${RDEPEND}"

FORTRAN="ifc gfortran g77"

pkg_setup() {
	if use threads; then
		ewarn
		ewarn "WARNING: use of threads is highly experimental."
		ewarn "You may stop now and set USE=-threads"
		ewarn
		epause 5
	fi
	use fortran && fortran_pkg_setup
}

src_compile() {

	einfo
	einfo "OpenMPI has an overwhelming count of configuration options."
	einfo "Don't forget the EXTRA_ECONF environment variable can let you"
	einfo "specify configure options."
	einfo

	local myconf="--sysconfdir=/etc/${PN}"
	myconf="${myconf} --enable-pretty-print-stacktrace"

	if use threads; then
		myconf="${myconf} --enable-mpi-threads"
		myconf="${myconf} --with-progress-threads"
		myconf="${myconf} --with-threads=posix"
	fi

	if use fortran; then
		myconf="${myconf} $(use_enable fortran mpi-f77)"
		[ "${FORTRANC}" = "g77" ] && \
			myconf="${myconf} --disable-mpi-f90" || \
			myconf="${myconf} --enable-mpi-f90"
	fi

	use pbs && myconf="${myconf} $(use_with pbs tm /usr/$(get_libdir)/pbs)"
	append-ldflags -Wl,-z,-noexecstack

	econf ${myconf} || die "econf failed"
	emake  || die "emake failed"
}

src_install () {

	make DESTDIR="${D}" install || die "make install failed"

	dodoc README AUTHORS NEWS VERSION
}