[petsc-dev] meaning of PETSC_USE_EXTERN_CXX?

Matthew Knepley knepley at gmail.com
Tue Mar 5 18:39:53 CST 2013


On Tue, Mar 5, 2013 at 7:35 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:

>
> On Tue, Mar 5, 2013 at 6:28 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
>
>>    Ok, and this will still support all four cases above. How do we do
>> that? And would it simplify the mess we have now?
>>
>
> We just take the PETSC_USE_EXTERN_CXX branch everywhere so that if
> defined(__cplusplus), we always use extern "C" (independent of how PETSc
> was configured). This also gets rid of PETSC_EXTERN_C and PETSC_INTERN_C,
> leaving only PETSC_EXTERN and PETSC_INTERN.
>

Is this doable if we still want to support C++ complex?

   Matt


> > 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
>>
>>    Yes, if a C++ programmer is using PETSc and complex numbers this is a
>> legitimate case
>>
>> > (and perhaps because the C++ compiler catches different errors than the
>> C compiler).
>>
>>   Yes, this is a legitimate use of our testing PETSc regularly with C++.
>>
>
>
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20130305/d2b465cb/attachment.html>


More information about the petsc-dev mailing list