1 |
commit: 346d974b25441804e803c0cbb4c57935a3a203c3 |
2 |
Author: Justin Bronder <jbronder <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jul 2 02:14:17 2013 +0000 |
4 |
Commit: Justin Bronder <jsbronder <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jul 2 02:14:17 2013 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=346d974b |
7 |
|
8 |
Do not override malloc when in a sandbox environment. Resolves #462602. |
9 |
|
10 |
Package-Manager: portage-2.1.12.2 |
11 |
|
12 |
--- |
13 |
sys-cluster/openmpi/ChangeLog | 8 +- |
14 |
...le-malloc-override-inside-of-Gentoo-sandb.patch | 42 ++++++ |
15 |
sys-cluster/openmpi/openmpi-1.6.4-r1.ebuild | 162 +++++++++++++++++++++ |
16 |
3 files changed, 211 insertions(+), 1 deletion(-) |
17 |
|
18 |
diff --git a/sys-cluster/openmpi/ChangeLog b/sys-cluster/openmpi/ChangeLog |
19 |
index 6957971..f457326 100644 |
20 |
--- a/sys-cluster/openmpi/ChangeLog |
21 |
+++ b/sys-cluster/openmpi/ChangeLog |
22 |
@@ -2,6 +2,13 @@ |
23 |
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 |
24 |
# $Header: $ |
25 |
|
26 |
+*openmpi-1.6.4-r1 (02 Jul 2013) |
27 |
+ |
28 |
+ 02 Jul 2013; Justin Bronder <jsbronder@g.o> |
29 |
+ +files/hooks-disable-malloc-override-inside-of-Gentoo-sandb.patch, |
30 |
+ +openmpi-1.6.4-r1.ebuild: |
31 |
+ Do not override malloc when in a sandbox environment. Resolves #462602. |
32 |
+ |
33 |
*openmpi-1.6.4 (09 Apr 2013) |
34 |
|
35 |
09 Apr 2013; Justin Bronder <jsbronder@g.o> -openmpi-1.6.3.ebuild, |
36 |
@@ -137,4 +144,3 @@ |
37 |
|
38 |
20 Jan 2009; Alexey Shvetsov <alexxy@g.o> +openmpi-1.3.ebuild: |
39 |
Version bump |
40 |
- |
41 |
|
42 |
diff --git a/sys-cluster/openmpi/files/hooks-disable-malloc-override-inside-of-Gentoo-sandb.patch b/sys-cluster/openmpi/files/hooks-disable-malloc-override-inside-of-Gentoo-sandb.patch |
43 |
new file mode 100644 |
44 |
index 0000000..5683c81 |
45 |
--- /dev/null |
46 |
+++ b/sys-cluster/openmpi/files/hooks-disable-malloc-override-inside-of-Gentoo-sandb.patch |
47 |
@@ -0,0 +1,42 @@ |
48 |
+From 094de74dc5e518a931c495692143ea3282553674 Mon Sep 17 00:00:00 2001 |
49 |
+From: Justin Bronder <jsbronder@×××××.com> |
50 |
+Date: Mon, 1 Jul 2013 20:37:17 -0400 |
51 |
+Subject: [PATCH] hooks: disable malloc override inside of Gentoo sandbox |
52 |
+ |
53 |
+As described in the comments in the source, Gentoo's own version of |
54 |
+fakeroot, sandbox, also runs into hangs when malloc is overridden. |
55 |
+Sandbox environments can easily be detected by looking for SANDBOX_PID |
56 |
+in the environment. When detected, employ the same fix used for |
57 |
+fakeroot. |
58 |
+ |
59 |
+See https://bugs.gentoo.org/show_bug.cgi?id=462602 |
60 |
+--- |
61 |
+ opal/mca/memory/linux/hooks.c | 11 +++++++++-- |
62 |
+ 1 file changed, 9 insertions(+), 2 deletions(-) |
63 |
+ |
64 |
+diff --git a/opal/mca/memory/linux/hooks.c b/opal/mca/memory/linux/hooks.c |
65 |
+index 6a1646f..ce91e76 100644 |
66 |
+--- a/opal/mca/memory/linux/hooks.c |
67 |
++++ b/opal/mca/memory/linux/hooks.c |
68 |
+@@ -747,9 +747,16 @@ static void opal_memory_linux_malloc_init_hook(void) |
69 |
+ "fakeroot" build environment that allocates memory during |
70 |
+ stat() (see http://bugs.debian.org/531522). It may not be |
71 |
+ necessary any more since we're using access(), not stat(). But |
72 |
+- we'll leave the check, anyway. */ |
73 |
++ we'll leave the check, anyway. |
74 |
++ |
75 |
++ This is also an issue when using Gentoo's version of 'fakeroot', |
76 |
++ sandbox v2.5. Sandbox environments can also be detected fairly |
77 |
++ easily by looking for SANDBOX_PID. |
78 |
++ */ |
79 |
++ |
80 |
+ if (getenv("FAKEROOTKEY") != NULL || |
81 |
+- getenv("FAKED_MODE") != NULL) { |
82 |
++ getenv("FAKED_MODE") != NULL || |
83 |
++ getenv("SANDBOX_PID") != NULL ) { |
84 |
+ return; |
85 |
+ } |
86 |
+ |
87 |
+-- |
88 |
+1.8.1.5 |
89 |
+ |
90 |
|
91 |
diff --git a/sys-cluster/openmpi/openmpi-1.6.4-r1.ebuild b/sys-cluster/openmpi/openmpi-1.6.4-r1.ebuild |
92 |
new file mode 100644 |
93 |
index 0000000..1016b42 |
94 |
--- /dev/null |
95 |
+++ b/sys-cluster/openmpi/openmpi-1.6.4-r1.ebuild |
96 |
@@ -0,0 +1,162 @@ |
97 |
+# Copyright 1999-2013 Gentoo Foundation |
98 |
+# Distributed under the terms of the GNU General Public License v2 |
99 |
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/openmpi/openmpi-1.2.4.ebuild,v 1.2 2007/12/13 22:39:53 jsbronder Exp $ |
100 |
+ |
101 |
+EAPI=5 |
102 |
+ |
103 |
+FORTRAN_NEEDED=fortran |
104 |
+ |
105 |
+inherit eutils flag-o-matic fortran-2 multilib mpi toolchain-funcs versionator |
106 |
+ |
107 |
+MY_P=${P/-mpi} |
108 |
+S=${WORKDIR}/${MY_P} |
109 |
+ |
110 |
+IUSE_OPENMPI_FABRICS=" |
111 |
+ openmpi_fabrics_dapl |
112 |
+ openmpi_fabrics_ofed |
113 |
+ openmpi_fabrics_knem |
114 |
+ openmpi_fabrics_open-mx |
115 |
+ openmpi_fabrics_psm |
116 |
+ openmpi_fabrics_sctp" |
117 |
+ |
118 |
+IUSE_OPENMPI_RM=" |
119 |
+ openmpi_rm_pbs |
120 |
+ openmpi_rm_slurm" |
121 |
+ |
122 |
+IUSE_OPENMPI_OFED_FEATURES=" |
123 |
+ openmpi_ofed_features_control-hdr-padding |
124 |
+ openmpi_ofed_features_connectx-xrc |
125 |
+ openmpi_ofed_features_rdmacm |
126 |
+ openmpi_ofed_features_dynamic-sl |
127 |
+ openmpi_ofed_features_failover" |
128 |
+ |
129 |
+DESCRIPTION="A high-performance message passing library (MPI)" |
130 |
+HOMEPAGE="http://www.open-mpi.org" |
131 |
+SRC_URI="http://www.open-mpi.org/software/ompi/v$(get_version_component_range 1-2)/downloads/${MY_P}.tar.bz2" |
132 |
+LICENSE="BSD" |
133 |
+SLOT="0" |
134 |
+KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux" |
135 |
+IUSE="+cxx elibc_FreeBSD fortran heterogeneous ipv6 mpi-threads romio threads vt |
136 |
+ ${IUSE_OPENMPI_FABRICS} ${IUSE_OPENMPI_RM} ${IUSE_OPENMPI_OFED_FEATURES}" |
137 |
+ |
138 |
+REQUIRED_USE="openmpi_rm_slurm? ( !openmpi_rm_pbs ) |
139 |
+ openmpi_rm_pbs? ( !openmpi_rm_slurm ) |
140 |
+ openmpi_fabrics_psm? ( openmpi_fabrics_ofed ) |
141 |
+ openmpi_ofed_features_control-hdr-padding? ( openmpi_fabrics_ofed ) |
142 |
+ openmpi_ofed_features_connectx-xrc? ( openmpi_fabrics_ofed ) |
143 |
+ openmpi_ofed_features_rdmacm? ( openmpi_fabrics_ofed ) |
144 |
+ openmpi_ofed_features_dynamic-sl? ( openmpi_fabrics_ofed ) |
145 |
+ openmpi_ofed_features_failover? ( openmpi_fabrics_ofed )" |
146 |
+ |
147 |
+MPI_UNCLASSED_DEP_STR=" |
148 |
+ vt? ( |
149 |
+ !dev-libs/libotf |
150 |
+ !app-text/lcdf-typetools |
151 |
+ )" |
152 |
+ |
153 |
+RDEPEND=" |
154 |
+ >=sys-apps/hwloc-1.3 |
155 |
+ elibc_FreeBSD? ( dev-libs/libexecinfo ) |
156 |
+ openmpi_fabrics_dapl? ( sys-infiniband/dapl ) |
157 |
+ openmpi_fabrics_ofed? ( sys-infiniband/ofed ) |
158 |
+ openmpi_fabrics_knem? ( sys-cluster/knem ) |
159 |
+ openmpi_fabrics_open-mx? ( sys-cluster/open-mx ) |
160 |
+ openmpi_fabrics_psm? ( sys-infiniband/infinipath-psm ) |
161 |
+ openmpi_fabrics_sctp? ( net-misc/lksctp-tools ) |
162 |
+ openmpi_rm_pbs? ( sys-cluster/torque ) |
163 |
+ openmpi_rm_slurm? ( sys-cluster/slurm ) |
164 |
+ openmpi_ofed_features_rdmacm? ( sys-infiniband/librdmacm ) |
165 |
+ $(mpi_imp_deplist)" |
166 |
+DEPEND="${RDEPEND}" |
167 |
+ |
168 |
+pkg_setup() { |
169 |
+ fortran-2_pkg_setup |
170 |
+ MPI_ESELECT_FILE="eselect.mpi.openmpi" |
171 |
+ |
172 |
+ if use mpi-threads; then |
173 |
+ echo |
174 |
+ ewarn "WARNING: use of MPI_THREAD_MULTIPLE is still disabled by" |
175 |
+ ewarn "default and officially unsupported by upstream." |
176 |
+ ewarn "You may stop now and set USE=-mpi-threads" |
177 |
+ echo |
178 |
+ fi |
179 |
+ |
180 |
+ echo |
181 |
+ elog "OpenMPI has an overwhelming count of configuration options." |
182 |
+ elog "Don't forget the EXTRA_ECONF environment variable can let you" |
183 |
+ elog "specify configure options if you find them necessary." |
184 |
+ echo |
185 |
+} |
186 |
+ |
187 |
+src_prepare() { |
188 |
+ # Necessary for scalibility, see |
189 |
+ # http://www.open-mpi.org/community/lists/users/2008/09/6514.php |
190 |
+ if use threads; then |
191 |
+ echo 'oob_tcp_listen_mode = listen_thread' \ |
192 |
+ >> opal/etc/openmpi-mca-params.conf |
193 |
+ fi |
194 |
+ |
195 |
+ # 462602 |
196 |
+ epatch "${FILESDIR}"/hooks-disable-malloc-override-inside-of-Gentoo-sandb.patch |
197 |
+} |
198 |
+ |
199 |
+src_configure() { |
200 |
+ local myconf=( |
201 |
+ --sysconfdir="${EPREFIX}/etc/${PN}" |
202 |
+ --enable-pretty-print-stacktrace |
203 |
+ --enable-orterun-prefix-by-default |
204 |
+ --with-hwloc="${EPREFIX}/usr" |
205 |
+ ) |
206 |
+ |
207 |
+ if use mpi-threads; then |
208 |
+ myconf+=(--enable-mpi-threads |
209 |
+ --enable-opal-multi-threads) |
210 |
+ fi |
211 |
+ |
212 |
+ if use fortran; then |
213 |
+ if [[ $(tc-getFC) =~ g77 ]]; then |
214 |
+ myconf+=(--disable-mpi-f90) |
215 |
+ elif [[ $(tc-getFC) =~ if ]]; then |
216 |
+ # Enabled here as gfortran compile times are huge with this enabled. |
217 |
+ myconf+=(--with-mpi-f90-size=medium) |
218 |
+ fi |
219 |
+ else |
220 |
+ myconf+=(--disable-mpi-f90 --disable-mpi-f77) |
221 |
+ fi |
222 |
+ |
223 |
+ ! use vt && myconf+=(--enable-contrib-no-build=vt) |
224 |
+ |
225 |
+ econf $(mpi_econf_args) "${myconf[@]}" \ |
226 |
+ $(use_enable cxx mpi-cxx) \ |
227 |
+ $(use_enable romio io-romio) \ |
228 |
+ $(use_enable heterogeneous) \ |
229 |
+ $(use_enable ipv6) \ |
230 |
+ $(use_with openmpi_fabrics_dapl udapl "${EPREFIX}"/usr) \ |
231 |
+ $(use_with openmpi_fabrics_ofed openib "${EPREFIX}"/usr) \ |
232 |
+ $(use_with openmpi_fabrics_knem knem "${EPREFIX}"/usr) \ |
233 |
+ $(use_with openmpi_fabrics_open-mx mx "${EPREFIX}"/usr) \ |
234 |
+ $(use_with openmpi_fabrics_psm psm "${EPREFIX}"/usr) \ |
235 |
+ $(use_enable openmpi_ofed_features_control-hdr-padding openib-control-hdr-padding) \ |
236 |
+ $(use_enable openmpi_ofed_features_connectx-xrc openib-connectx-xrc) \ |
237 |
+ $(use_enable openmpi_ofed_features_rdmacm openib-rdmacm) \ |
238 |
+ $(use_enable openmpi_ofed_features_dynamic-sl openib-dynamic-sl) \ |
239 |
+ $(use_enable openmpi_ofed_features_failover btl-openib-failover) \ |
240 |
+ $(use_with openmpi_fabrics_sctp sctp) \ |
241 |
+ $(use_with openmpi_rm_pbs tm) \ |
242 |
+ $(use_with openmpi_rm_slurm slurm) |
243 |
+} |
244 |
+ |
245 |
+src_install () { |
246 |
+ emake DESTDIR="${D}" install || die "make install failed" |
247 |
+ # From USE=vt see #359917 |
248 |
+ rm "${ED}"/$(mpi_root)/usr/share/libtool &> /dev/null |
249 |
+ mpi_dodoc README AUTHORS NEWS VERSION || die |
250 |
+ mpi_imp_add_eselect |
251 |
+} |
252 |
+ |
253 |
+src_test() { |
254 |
+ # Doesn't work with the default src_test as the dry run (-n) fails. |
255 |
+ |
256 |
+ # Do not override malloc during build. Works around #462602 |
257 |
+ emake -j1 check || die "emake check failed" |
258 |
+} |