<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Feb 10, 2018 at 1:48 PM, Jed Brown <span dir="ltr"><<a href="mailto:jed@jedbrown.org" target="_blank">jed@jedbrown.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">Éric Chamberland <<a href="mailto:Eric.Chamberland@giref.ulaval.ca">Eric.Chamberland@giref.<wbr>ulaval.ca</a>> writes:<br>
<br>
> ok, let put our in-house code away, simply try this simple example:<br>
><br>
> ----------<br>
><br>
> #include <mpi.h><br>
><br>
> int main() {<br>
> /*empty!! let's see the .o */<br>
><br>
> return 1;<br>
><br>
> }<br>
> ---------<br>
><br>
> then:<br>
><br>
> g++ -c test.cc -I/opt/openmpi-1.10.2/include -o test.o<br>
><br>
> nm -C test.o | grep "MPI::" | grep " U "<br>
><br>
>                   U MPI::Win::Free()<br>
>                   U MPI::Comm::Comm()<br>
>                   U MPI::Datatype::Free()<br>
><br>
> so: as soon you are compiling a c++ file with this openmpi 1.10.2 (even<br>
> if you use gcc -c test.cc -I/opt/openmpi-1.10.2/include -o test.o in my<br>
> example) it *requires* you to link with mpi_cxx lib...<br>
<br>
</span>That's sad, but is this not avoided by defining OMPI_SKIP_MPICXX before<br>
including mpi.h?  (There is also MPICH_SKIP_MPICXX if you want.)  This<br>
is done by default in petscsys.h, but you might not include it in that<br>
file or don't include it before mpi.h is included.<br>
</blockquote></div><br>Indeed, everybody should compiler MPI codes with "-DMPICH_SKIP_MPICXX=1 -DOMPI_SKIP_MPICXX=1" now.</div><div class="gmail_extra"><br></div><div class="gmail_extra">I'll ask MPICH and Open-MPI to switch the default to exclude C++ bindings.</div><div class="gmail_extra"><br>Jeff<br clear="all"><div><br></div>-- <br><div class="gmail_signature">Jeff Hammond<br><a href="mailto:jeff.science@gmail.com" target="_blank">jeff.science@gmail.com</a><br><a href="http://jeffhammond.github.io/" target="_blank">http://jeffhammond.github.io/</a></div>
</div></div>