/[gentoo-x86]/sys-cluster/mpe2/mpe2-1.0.6_p1.ebuild
Gentoo

Contents of /sys-cluster/mpe2/mpe2-1.0.6_p1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (show annotations) (download)
Tue Oct 16 18:46:07 2012 UTC (2 years, 1 month ago) by jlec
Branch: MAIN
Changes since 1.9: +6 -9 lines
sys-cluster/mpe2: Remove virtual/fortran and always call fortran-2_pkg_setup as intend by the updated fortran-2.eclass

(Portage version: 2.2.0_alpha138/cvs/Linux x86_64, signed Manifest commit with key 70EB7916)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-cluster/mpe2/mpe2-1.0.6_p1.ebuild,v 1.9 2012/10/14 19:35:01 jlec Exp $
4
5 EAPI=2
6
7 FORTRAN_NEEDED=fortran
8
9 inherit eutils fortran-2 java-utils-2 toolchain-funcs
10
11 MY_P=${P/_/}
12 DESCRIPTION="MPI development tools"
13 HOMEPAGE="http://www-unix.mcs.anl.gov/perfvis/download/index.htm"
14 SRC_URI="ftp://ftp.mcs.anl.gov/pub/mpi/${PN%2}/${MY_P}.tar.gz"
15
16 LICENSE="as-is"
17 SLOT="0"
18 KEYWORDS="amd64 x86"
19 IUSE="minimal fortran threads debug"
20
21 COMMON_DEPEND="!minimal? ( x11-libs/libXtst
22 x11-libs/libXi )
23 || ( sys-cluster/openmpi[fortran?,threads?]
24 sys-cluster/mpich2[fortran?,threads?] )"
25
26 DEPEND="!minimal? ( >=virtual/jdk-1.4 )
27 ${COMMON_DEPEND}"
28
29 RDEPEND="
30 !minimal? ( >=virtual/jre-1.4 )
31 ${COMMON_DEPEND}"
32
33 S="${WORKDIR}"/${MY_P}
34 MPE_IMP=""
35
36 # README:
37 # This ebuild is created to handle building with both mpich2 and openmpi.
38 # However, without empi (in the science overlay), and some further
39 # conversion to use mpi.eclass, we can only handle one implementation
40 # at a time. I still believe it's better to have the ebuild setup
41 # correctly in preperation.
42
43 pkg_setup() {
44 fortran-2_pkg_setup
45 local i
46
47 if has_version sys-cluster/openmpi; then
48 MPE_IMP=openmpi
49 elif has_version sys-cluster/mpich2; then
50 MPE_IMP=mpich2
51 else
52 die "Unknown MPI implementation"
53 fi
54
55 export JFLAGS="${JFLAGS} $(java-pkg_javac-args)"
56
57 if [[ "${MPE_IMP}" == openmpi ]] && [ -z "${MPE2_FORCE_OPENMPI_TEST}" ]; then
58 echo ""
59 elog "Currently src_test fails on collchk with openmpi, hence"
60 elog "testing is disabled by default. If you would like to"
61 elog "force testing, please add MPE_FORCE_OPENMPI_TEST=1"
62 elog "to your environment."
63 echo ""
64 fi
65
66 einfo "Building with support for: sys-cluster/${MPE_IMP}"
67 }
68
69 src_prepare() {
70 # Don't assume path contains ./
71 sed -i 's,\($MPERUN\) $pgm,\1 ./$pgm,' sbin/mpetestexeclog.in
72 }
73
74 src_configure() {
75 local c="--with-mpicc=/usr/bin/mpicc"
76
77 if use fortran; then
78 c="${c} --with-mpif77=/usr/bin/mpif77"
79 else
80 c="${c} --disable-f77"
81 fi
82
83 if use minimal; then
84 c="${c} --enable-slog2=no --disable-rlog --disable-sample"
85 else
86 c="${c} --with-java2=$(java-config --jdk-home) --enable-slog2=build"
87 fi
88
89 if [[ "${MPE_IMP}" == openmpi ]]; then
90 c="${c} --disable-rlog --disable-sample"
91 fi
92
93 econf ${c} \
94 --sysconfdir=/etc/${PN} \
95 --datadir=/usr/share/${PN} \
96 --with-htmldir=/usr/share/${PN} \
97 --with-docdir=/usr/share/${PN} \
98 --enable-collchk \
99 --enable-wrappers \
100 $(use_enable !minimal graphics) \
101 $(use_enable threads threadlogging) \
102 $(use_enable debug g)
103 }
104
105 src_test() {
106 local rc
107
108 cd "${S}"
109 if [[ "${MPE_IMP}" == mpich2 ]]; then
110 echo "MPD_SECRETWORD=junk" > "${T}"/mpd.conf
111 chmod 600 "${T}"/mpd.conf
112 export MPD_CONF_FILE="${T}/mpd.conf"
113 "${ROOT}"usr/bin/mpd -d --pidfile="${T}"/mpd.pid
114 elif [[ "${MPE_IMP}" == openmpi* ]] && [ -z "${MPE2_FORCE_OPENMPI_TEST}" ]; then
115 echo
116 elog "Skipping tests for openmpi"
117 echo
118 return 0
119 fi
120
121 # No parallel make:
122 # http://trac.mcs.anl.gov/projects/mpich2/ticket/1095#comment:1
123 emake -j1 \
124 CC="${S}"/bin/mpecc \
125 FC="${S}"/bin/mpefc \
126 MPERUN="${ROOT}/usr/bin/mpiexec -n 4" \
127 CLOG2TOSLOG2="${S}/src/slog2sdk/bin/clog2TOslog2" \
128 check;
129 rc=${?}
130 if [[ "${MPE_IMP}" == mpich2 ]]; then
131 "${ROOT}"usr/bin/mpdallexit || kill $(<"${T}"/mpd.pid)
132 fi
133
134 return ${rc}
135 }
136
137 src_install() {
138 # No parallel make:
139 # http://trac.mcs.anl.gov/projects/mpich2/ticket/1095#comment:1
140 emake -j1 DESTDIR="${D}" install || die
141 rm -f "${D}"/usr/sbin/mpeuninstall || die
142 }

  ViewVC Help
Powered by ViewVC 1.1.20