From 2f38819a96eb7e2d7a8bcc05c0da2f7d2e25cfce Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 19 Nov 2009 20:05:06 +0000 Subject: [PATCH] Improve detection of MT requirement of MPI. Some MPI implementation report -lpthread in the compilation flags. Previously, we'd add -lpthread, but did not set threading=multi, as we really should. One manifestation of this issue is that when building with such an MPI, and requesting "threading=single threading=multi", we'd actually try to build two variants of everything, including "mpi.so" Python extension. And since Python extensions, at present, do not have their name adjusted for different variants, we'd get duplicate target name error. [SVN r57791] --- src/tools/mpi.jam | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/tools/mpi.jam b/src/tools/mpi.jam index bad0615b8..12c2993e9 100644 --- a/src/tools/mpi.jam +++ b/src/tools/mpi.jam @@ -163,7 +163,20 @@ rule cmdline_to_features ( cmdline : unknown-features ? ) local add = [ add_feature $(prefix) $(name) $(cmdline) ] ; if $(add) { - result += $(add[1]) ; + + if $(add[1]) = pthread + { + # Uhm. It's not really nice that this MPI implementation + # uses -lpthread as opposed to -pthread. We do want to + # set multi, instead of -lpthread. + result += "multi" ; + MPI_EXTRA_REQUIREMENTS += "multi" ; + } + else + { + result += $(add[1]) ; + } + cmdline = $(add[2]) ; matched = yes ; }