<div dir="ltr">Cool that works.<div><br></div><div>I was wondering is there an easy way to do this, however? Right now I am just copy and pasting the huge block of text that make generates, and then replacing the C compiler with the C++ compiler. </div>
<div><br></div><div>To the best of my understanding, the makefile rule to make an executable called "codeout" is</div><div><br></div><div>codeout: code.o</div><div>            ${CLINKER} blah blah $< $@ blah blah</div>
<div><br></div><div>I find that if I redefine CLINKER=<c++ compiler>, then the make step going from code.o to the executable works, but the step going from code.c to code.o still uses the original value of CLINKER.</div>
<div><br></div><div>best,</div><div>David</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jan 22, 2014 at 10:28 AM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
On Jan 22, 2014, at 9:17 AM, David Liu <<a href="mailto:daveliu@mit.edu">daveliu@mit.edu</a>> wrote:<br>
<br>
> Hi,<br>
><br>
> I’m trying to run a solver code I wrote in C++ on the Kraken supercomputer. Apparently Kraken already has a pre-built version of Petsc that is optimized for their Cray architecture. So I try compiling my code, and as expected, get an error message saying that “<iostream>” not found, which I’m guessing is because Petsc wasn’t configured with “-with-c-language=cxx”. Fair enough.<br>

<br>
</div>   You can still use the C++ compiler to compiler YOUR code even without PETSc being built with -with-c-language=cxx<br>
<div class="im"><br>
><br>
> However, at the end of the error message, it gives me the list of things it *was* configured with, and I see the flags “--with-cc=cc” and “--with-cxx=CC”. Does anyone know what that second flag means?<br>
<br>
</div>  That is the C++ compiler.<br>
<br>
   So in this case just use CC to compile your code. (note Cray auto-magically has the compiler know all about the MPI includes etc).<br>
<br>
   Barry<br>
<br>
<br>
<br>
><br>
> best,<br>
> David<br>
<br>
</blockquote></div><br></div>