<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Dec 31, 2017 at 3:14 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>> writes:<br>
<br>
> On Sun, Dec 31, 2017 at 2:35 PM, Jed Brown <<a href="mailto:jed@jedbrown.org">jed@jedbrown.org</a>> wrote:<br>
><br>
>> Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>> writes:<br>
>><br>
>> > On Sun, Dec 31, 2017 at 1:55 PM, Jed Brown <<a href="mailto:jed@jedbrown.org">jed@jedbrown.org</a>> wrote:<br>
>> ><br>
>> >> These look like linker errors and that build uses<br>
>> >> --with-cxxlib-autodetect=0.  We either need a rule to *link* C++ using<br>
>> >> CXX (i.e., mpicxx) or add LIBS=-lstdc++.<br>
>> >><br>
>> ><br>
>> > I thought we were doing this (linking C++ mains with CXX).<br>
>><br>
>> After compiling to the object file (ex3.o) we don't know what language<br>
>> main was written in, and this doesn't solve the actual problem that C++<br>
>> linking is required if any object (not just main) depends on C++.<br>
>><br>
><br>
> My thinking here was the following:<br>
><br>
>   1) No C++ is allowed in PETSc, unless --with-clanguage=cxx, in which case<br>
> the linker is C++<br>
>   2) If C++ is in an external library, then that configure requires the C++<br>
> library<br>
>   3) The executable itself could be C++, in which case I proposed using the<br>
> C++ linker explicitly<br>
><br>
> About not knowing which objects come with C++ main: I thought we did. Don't<br>
> they go into a separate set?<br>
<br>
Right, we do have that information for tests.  Note that a single test<br>
executable can depend on multiple source files, and the one containing<br>
main might not be C++ while another is.  I don't know if there are any<br>
such instances in PETSc.<br></blockquote><div><br></div><div>True. I think we just have to have a policy against that.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I can change the build rules for tests with C++ sources later today.<br>
</blockquote></div><br>Cool.</div><div class="gmail_extra"><br></div><div class="gmail_extra">  Thanks,</div><div class="gmail_extra"><br></div><div class="gmail_extra">    Matt<br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.caam.rice.edu/~mk51/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div>
</div></div>