[petsc-users] "--with-cxx=CC" option for ./configure?

David Liu daveliu at mit.edu
Wed Jan 22 16:17:52 CST 2014


Cool that works.

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.

To the best of my understanding, the makefile rule to make an executable
called "codeout" is

codeout: code.o
            ${CLINKER} blah blah $< $@ blah blah

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.

best,
David




On Wed, Jan 22, 2014 at 10:28 AM, Barry Smith <bsmith at mcs.anl.gov> wrote:

>
> On Jan 22, 2014, at 9:17 AM, David Liu <daveliu at mit.edu> wrote:
>
> > Hi,
> >
> > 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.
>
>    You can still use the C++ compiler to compiler YOUR code even without
> PETSc being built with -with-c-language=cxx
>
> >
> > 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?
>
>   That is the C++ compiler.
>
>    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).
>
>    Barry
>
>
>
> >
> > best,
> > David
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140122/74d8b69c/attachment.html>


More information about the petsc-users mailing list