<div dir="ltr">On Tue, Mar 5, 2013 at 6:55 PM, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote"><div class="im">On Tue, Mar 5, 2013 at 5:49 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br>

</div><div class="im"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div>From the below I am assuming that PETSC_USE_EXTERN_CXX is equivalent to --with-c-support   Is this correct?<br>

</div></blockquote><div><br></div></div><div>Yes,</div><div><br></div><div><div>config/PETSc/utilities/languages.py-    '''Check c-support c++-support and other misc tests'''</div><div>
config/PETSc/utilities/languages.py-    if self.clanguage == 'Cxx' and self.framework.argDB['with-c-support']:</div><div>config/PETSc/utilities/languages.py-      self.cSupport = 1</div><div>config/PETSc/utilities/languages.py:      self.addDefine('USE_EXTERN_CXX', '1')</div>

<div>config/PETSc/utilities/languages.py-      self.framework.logPrint('Turning off C++ name mangling')</div><div>config/PETSc/utilities/languages.py-    else:</div><div>config/PETSc/utilities/languages.py-      self.cSupport = 0</div>

<div><br></div><div><br></div><div>Matt, what is this about?</div></div></div></div></div></blockquote><div><br></div><div style>I think this is Satish (blame gets confused by the move). Don't we wrap the entire interface in EXTERN_C</div>
<div style>so that C++ people who include the header do not mangle PETSc functions?</div><div style><br></div><div style>   Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div>config/PETSc/utilities/languages.py-  def configureExternC(self):</div><div>config/PETSc/utilities/languages.py-    '''Protect C bindings from C++ mangling'''</div>

<div>config/PETSc/utilities/languages.py-    if self.clanguage == 'C':</div><div>config/PETSc/utilities/languages.py:      self.addDefine('USE_EXTERN_CXX',' ')</div><div>config/PETSc/utilities/languages.py-    return</div>

<div>config/PETSc/utilities/languages.py-</div><div>config/PETSc/utilities/languages.py-  def configureFortranLanguage(self):</div><div> <br></div></div><div class="im"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div>
<br>
   And I assume that --with-c-support means that PETSc is compiled with C++ but does not use name mangling   Is this correct?<br></div></blockquote><div><br></div></div><div>Yes</div><div class="im"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div>
<br>
   If the above two are correct does the name PETSC_USE_EXTERN_CXX actually correlate to what it means? Could it be changed to something meaningful?<br></div></blockquote><div><br></div></div><div>--with-extern-c-interface (or --with-c-interface) and PETSC_USE_EXTERN_C_INTERFACE?</div>
<div class="im">
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div>
<br>
    Please explain,<br>
<br>
     Barry<br>
<br>
<br>
#if defined(PETSC_CLANGUAGE_CXX) && !defined(PETSC_USE_EXTERN_CXX) && !defined(__cplusplus)<br>
#error "PETSc configured with --with-clanguage=c++ and NOT --with-c-support - it can be used only with a C++ compiler"<br>
#endif</div></blockquote></div></div><br><br></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>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>