www-client/vivaldi: Old.
[gentoo.git] / sys-cluster / mpich / mpich-3.2.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6
7 FORTRAN_NEEDED=fortran
8
9 inherit fortran-2
10
11 MY_PV=${PV/_/}
12 DESCRIPTION="A high performance and portable MPI implementation"
13 HOMEPAGE="http://www.mpich.org/"
14 SRC_URI="http://www.mpich.org/static/downloads/${PV}/${P}.tar.gz"
15
16 SLOT="0"
17 LICENSE="mpich"
18 KEYWORDS="~amd64 ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
19 IUSE="+cxx doc fortran mpi-threads romio threads"
20
21 COMMON_DEPEND="
22         dev-libs/libaio
23         >=sys-apps/hwloc-1.9
24         romio? ( net-fs/nfs-utils )"
25
26 DEPEND="${COMMON_DEPEND}
27         dev-lang/perl
28         sys-devel/libtool"
29
30 RDEPEND="${COMMON_DEPEND}
31         !sys-cluster/mpich2
32         !sys-cluster/openmpi"
33
34 S="${WORKDIR}"/${PN}-${MY_PV}
35
36 pkg_setup() {
37         FORTRAN_STANDARD="77 90"
38         fortran-2_pkg_setup
39
40         if use mpi-threads && ! use threads; then
41                 ewarn "mpi-threads requires threads, assuming that's what you want"
42         fi
43 }
44
45 src_prepare() {
46         # Using MPICHLIB_LDFLAGS doesn't seem to fully work.
47         sed -i 's| *@WRAPPER_LDFLAGS@ *||' \
48                 src/packaging/pkgconfig/mpich.pc.in \
49                 src/env/*.in \
50                 || die
51 }
52
53 src_configure() {
54         local c="--enable-shared"
55         local hydra_c="--with-hwloc-prefix=/usr"
56
57         # The configure statements can be somewhat confusing, as they
58         # don't all show up in the top level configure, however, they
59         # are picked up in the children directories.  Hence the separate
60         # local vars.
61
62         if use mpi-threads; then
63                 # MPI-THREAD requries threading.
64                 c="${c} --with-thread-package=pthreads"
65                 c="${c} --enable-threads=runtime"
66         else
67                 if use threads ; then
68                         c="${c} --with-thread-package=pthreads"
69                 else
70                         c="${c} --with-thread-package=none"
71                 fi
72                 c="${c} --enable-threads=single"
73         fi
74
75         c="${c} --sysconfdir=${EPREFIX}/etc/${PN}"
76         c="${c} --docdir=${EPREFIX}/usr/share/doc/${PF}"
77
78         export MPICHLIB_CFLAGS=${CFLAGS}
79         export MPICHLIB_CPPFLAGS=${CPPFLAGS}
80         export MPICHLIB_CXXFLAGS=${CXXFLAGS}
81         export MPICHLIB_FFLAGS=${FFLAGS}
82         export MPICHLIB_FCFLAGS=${FCFLAGS}
83         export MPICHLIB_LDFLAGS=${LDFLAGS}
84         unset CFLAGS CPPFLAGS CXXFLAGS FFLAGS FCFLAGS LDFLAGS
85
86         econf ${c} \
87                 --with-pm=hydra \
88                 --disable-fast \
89                 --enable-versioning \
90                 ${hydra_c}
91                 $(use_enable romio) \
92                 $(use_enable cxx) \
93                 $(use_enable fortran f77) \
94                 $(use_enable fortran fc)
95 }
96
97 src_test() {
98         emake -j1 check
99 }
100
101 src_install() {
102         default
103
104         dodir /usr/share/doc/${PF}
105         dodoc README{,.envvar} CHANGES RELEASE_NOTES
106         newdoc src/pm/hydra/README README.hydra
107         if use romio; then
108                 newdoc src/mpi/romio/README README.romio
109         fi
110
111         if ! use doc; then
112                 rm -rf "${D}"usr/share/doc/${PF}/www*
113         fi
114 }