[petsc-dev] meaning of PETSC_USE_EXTERN_CXX?

Jed Brown jedbrown at mcs.anl.gov
Tue Mar 5 18:24:43 CST 2013


On Tue, Mar 5, 2013 at 6:02 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:

>    We have --with-clanguage=c or c++   (this is already weird, most
> packages don't strife to be built either with C or C++)
>                   --with-c-support=0,1             (compile with C++ but
> with C bindings so C application can use it)
>
>               User Code                PETSc compiled with
>           ------------------------          C                  C++
>                     C                           x                   x
>                     C++                       x                   x
>
>             Hope back into Satish's way back machine and ask the question
> "why do we have this c-support business"? Seems like it complicates
> life a lot?
>

I would just unconditionally use extern "C" when compiling PETSc with a C++
compiler. We don't use overloading (PetscPolymorphic* was removed last
spring) so I don't think there is any functional reason to mangle symbols.
AFAICT, the only functional reason for building PETSc with a C++ compiler
is to use C++ complex (and perhaps because the C++ compiler catches
different errors than the C compiler).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20130305/4aabc4f4/attachment.html>


More information about the petsc-dev mailing list