<div dir="ltr">FYI, this is with -lstdc++<br><br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 11, 2015 at 5:05 PM, 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"><br>
   Satish,<br>
<br>
    Please enhance<br>
<br>
  def checkFortranLinkingCxx(self):<br>
    '''Check that Fortran can be linked against C++'''<br>
    link = 0<br>
    cinc, cfunc, ffunc = self.manglerFuncs[self.fortranMangling]<br>
    cinc = 'extern "C" '+cinc+'\n'<br>
<br>
    cxxCode = 'void foo(void){'+self.mangleFortranFunction('d1chk')+'();}'<br>
    cxxobj  = os.path.join(self.tmpDir, 'cxxobj.o')<br>
    self.pushLanguage('Cxx')<br>
    if not self.checkCompile(cinc+cxxCode, None, cleanup = 0):<br>
<br>
>>>  try again here with additional library.<br>
<br>
      self.logPrint('Cannot compile Cxx function: '+cfunc, 3, 'compilers')<br>
      raise RuntimeError('Fortran could not successfully link C++ objects')<br>
    if not os.path.isfile(self.compilerObj):<br>
      self.logPrint('Cannot locate object file: '+os.path.abspath(self.compilerObj), 3, 'compilers')<br>
      raise RuntimeError('Fortran could not successfully link C++ objects')<br>
    os.rename(self.compilerObj, cxxobj)<br>
    self.popLanguage()<br>
<br>
so that if the basic link fails it automatically tries again here after adding the -lstdc++ library.<br>
<br>
   Thanks<br>
<br>
    Barry<br>
<br>
It is insane to expect users to know they have to add -lstdc++  themselves.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
> On Mar 11, 2015, at 5:10 PM, Satish Balay <<a href="mailto:balay@mcs.anl.gov">balay@mcs.anl.gov</a>> wrote:<br>
><br>
> A more suitable way to specify -lstdc++ would be via option LIBS<br>
> [this way  its used by clinker,cxxlinker,flinker - as required]<br>
><br>
> LIBS="-lstdc++"<br>
><br>
> Satish<br>
><br>
> On Wed, 11 Mar 2015, Eric Bavier wrote:<br>
><br>
>> It looks like you are building with the PGI compilers.  Try adding:<br>
>><br>
>> --CXX_LINKER_FLAGS="-Meh_frame -lstdc++"<br>
>><br>
>> to your petsc configure flags.<br>
>><br>
>> Hope that helps,<br>
>> `~Eric Bavier, Scientific Libraries, Cray Inc.<br>
>> ________________________________________<br>
>> From: <a href="mailto:petsc-dev-bounces@mcs.anl.gov">petsc-dev-bounces@mcs.anl.gov</a> [<a href="mailto:petsc-dev-bounces@mcs.anl.gov">petsc-dev-bounces@mcs.anl.gov</a>] on behalf of Satish Balay [<a href="mailto:balay@mcs.anl.gov">balay@mcs.anl.gov</a>]<br>
>> Sent: Wednesday, March 11, 2015 16:55<br>
>> To: Mark Adams<br>
>> Cc: For users of the development version of PETSc<br>
>> Subject: Re: [petsc-dev] Configure problem on Titan<br>
>><br>
>>>>>>>>>>><br>
>> Executing: ftn  -o /tmp/scratch/petsc-5_JlCR/config.compilers/conftest    -mp -fast  /tmp/scratch/petsc-5_JlCR/config.compilers/conftest.o /tmp/scratch/petsc-5_JlCR/config.compilers/cxxobj.o  /tmp/scratch/petsc-5_JlCR/config.compilers/confc.o  -ldl<br>
>> Possible ERROR while running linker: exit code 512<br>
>> stderr:<br>
>> /tmp/scratch/petsc-5_JlCR/config.compilers/cxxobj.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'<br>
>> /tmp/scratch/petsc-5_JlCR/config.compilers/confc.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'<br>
>> /usr/bin/ld: link errors found, deleting executable `/tmp/scratch/petsc-5_JlCR/config.compilers/conftest'<br>
>> <<<<<<<br>
>><br>
>> Perhaps the compilers are not setup correctly after the update?<br>
>><br>
>> If you don't need c++ - you can try building with --with-cxx=0 configure option..<br>
>><br>
>> satish<br>
>><br>
>> On Wed, 11 Mar 2015, Mark Adams wrote:<br>
>><br>
>>> I am getting this error on Titan.  They just had a big PM and it was<br>
>>> recommended that we rebuild everything<br>
>>><br>
>><br>
>><br>
><br>
<br>
</div></div></blockquote></div><br></div>