[Llvm-bgq-discuss] Linker error: undefined reference to `vtable for std::nested_exception'

Michael Schlottke m.schlottke at aia.rwth-aachen.de
Sat Jul 19 12:06:23 CDT 2014


Dear Hal,

Indeed, this seems to have been the culprit. Thank you very much for 
support. It seems like I can compile & link programs now with 
bgclang++11, and the executable also runs (at least on the frontend). 
Right now the 4.7.2 files are in a temporary location but I will 
relocate them on JUQUEEN to a more fitting place next week.

Y'all have a nice weekend

Michael

On Sa 19 Jul 2014 16:58:34 CEST, Hal Finkel wrote:
> Sandipan, et al.,
>
> There is a link to V1R2M1_base_4.7.2-files.tar.gz (with some explanatory text) on the wiki:
>
>    http://trac.alcf.anl.gov/projects/llvm-bgq/
>
>   -Hal
>
> ----- Original Message -----
>> From: "Hal Finkel" <hfinkel at anl.gov>
>> To: "Sandipan Mohanty" <s.mohanty at fz-juelich.de>
>> Cc: llvm-bgq-discuss at lists.alcf.anl.gov
>> Sent: Friday, July 18, 2014 5:57:03 PM
>> Subject: Re: [Llvm-bgq-discuss] Linker error: undefined reference to `vtable	for std::nested_exception'
>>
>> Sandipan,
>>
>> To solve the actual std::exception error you still need to pick up
>> the libstdc++ libs from the 4.7.2 toolchain. If you look in the
>> wrapper script, it looks for them in some particular places; make
>> sure that matches you system.
>>
>>   -Hal
>>
>> ----- Original Message -----
>>> From: "Sandipan Mohanty" <s.mohanty at fz-juelich.de>
>>> To: llvm-bgq-discuss at lists.alcf.anl.gov
>>> Sent: Friday, July 18, 2014 5:29:40 PM
>>> Subject: Re: [Llvm-bgq-discuss] Linker error: undefined reference
>>> to `vtable	for std::nested_exception'
>>>
>>> Hi Hal, Michael and Roy,
>>>      I changed the variable VLIBSTDCXX from 4.4.6 to 4.4.7 in the
>>>      bgclang
>>> wrapper in Jülich. Unfortunately, the error persists.
>>>
>>> /Sandipan
>>>
>>>
>>> On Friday 18 Jul 2014 17:06:28 Hal Finkel wrote:
>>>> Roy,
>>>>
>>>> Ah, that certainly explains things.
>>>>
>>>> Michael, if you edit the variables at the top of the bgclang
>>>> wrapper script,
>>>> you'll make things work again.
>>>>
>>>> I need to put together a new release soon anyway (upstream 3.5 is
>>>> almost
>>>> out...)
>>>>
>>>>   -Hal
>>>>
>>>> ----- Original Message -----
>>>>
>>>>> From: "Roy Musselman" <roymuss at us.ibm.com>
>>>>> To: "Hal Finkel" <hfinkel at anl.gov>
>>>>> Cc: llvm-bgq-discuss at lists.alcf.anl.gov,
>>>>> llvm-bgq-discuss-bounces at lists.alcf.anl.gov, "Michael
>>>>> Schlottke"
>>>>> <m.schlottke at fz-juelich.de>
>>>>> Sent: Friday, July 18, 2014 5:02:57 PM
>>>>> Subject: Re: [Llvm-bgq-discuss] Linker error: undefined
>>>>> reference
>>>>> to
>>>>> `vtable for std::nested_exception'
>>>>>
>>>>>
>>>>>
>>>>> Hi Hal & Michael,
>>>>>
>>>>> We installed V1R2M2 here at LLNL. Note that the subdirectory is
>>>>> 4.4.7
>>>>> for V1R2M2, not 4.4.6 as it was for V1R2M1.
>>>>>
>>>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>> Roy Musselman
>>>>> HPC Application Analyst at LLNL
>>>>> email: roymuss at us.ibm.com
>>>>> Cell: 507-358-8895, Home: 507-281-9565
>>>>>
>>>>> Inactive hide details for Hal Finkel ---07/18/2014 12:20:12
>>>>> PM---Michael, The relevant parts of the log are:Hal Finkel
>>>>> ---07/18/2014 12:20:12 PM---Michael, The relevant parts of the
>>>>> log
>>>>> are:
>>>>>
>>>>> From: Hal Finkel <hfinkel at anl.gov>
>>>>> To: Michael Schlottke <m.schlottke at fz-juelich.de>
>>>>> Cc: llvm-bgq-discuss at lists.alcf.anl.gov
>>>>> Date: 07/18/2014 12:20 PM
>>>>> Subject: Re: [Llvm-bgq-discuss] Linker error: undefined
>>>>> reference
>>>>> to
>>>>> `vtable for std::nested_exception'
>>>>> Sent by: llvm-bgq-discuss-bounces at lists.alcf.anl.gov
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Michael,
>>>>>
>>>>> The relevant parts of the log are:
>>>>>
>>>>> ignoring nonexistent directory
>>>>> "/bgsys/drivers/V1R2M2/ppc64/gnu-linux/powerpc64-bgq-linux/include/c++/4.4
>>>>> .6"
>>>>>
>>>>> ignoring nonexistent directory
>>>>> "/bgsys/drivers/V1R2M2/ppc64/gnu-linux/powerpc64-bgq-linux/include/c++/4.4
>>>>> .6/powerpc64-bgq-linux"
>>>>>
>>>>> Where did these files go on your system?
>>>>>
>>>>> -Hal
>>>>>
>>>>> ----- Original Message -----
>>>>>
>>>>>> From: "Michael Schlottke" <m.schlottke at fz-juelich.de>
>>>>>> To: llvm-bgq-discuss at lists.alcf.anl.gov, hfinkel at anl.gov
>>>>>> Sent: Friday, July 18, 2014 3:23:59 AM
>>>>>> Subject: Re: [Llvm-bgq-discuss] Linker error: undefined
>>>>>> reference
>>>>>> to `vtable for std::nested_exception'
>>>>>>
>>>>>> Hi Hal,
>>>>>>
>>>>>> Thanks for checking this out. I installed the last RPMs that
>>>>>> we
>>>>>> knew
>>>>>> worked before the toolchain upgrade (r201012-20140207), but
>>>>>> to
>>>>>> no
>>>>>> avail.
>>>>>> When trying to compile the same MWE program, we get a
>>>>>> compiler
>>>>>> (preprocessor?) error instead, but again it seems to be
>>>>>> centered
>>>>>> around
>>>>>> exceptions (I've attached the log). Maybe this sheds some
>>>>>> more
>>>>>> light
>>>>>> on
>>>>>> the issues we're having.
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Michael
>>>>>>
>>>>>> P.S.: As before, the error occurs only when using bgclang++11
>>>>>> or
>>>>>> when
>>>>>> manually adding -stdlib=libc++ to bgclang++. Otherwise it
>>>>>> compiles
>>>>>> &
>>>>>> runs just fine.
>>>>>>
>>>>>> On 17.07.2014 19:21, Hal Finkel wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> This error almost always occurs when you pick up the old
>>>>>>> libstdc++
>>>>>>> library instead of the one from the 4.7.2 toolchain. I'll
>>>>>>> look at
>>>>>>> your verbose logs later.
>>>>>>>
>>>>>>> -Hal
>>>>>>>
>>>>>>> ----- Original Message -----
>>>>>>>
>>>>>>>> From: "Sandipan Mohanty" <s.mohanty at fz-juelich.de>
>>>>>>>> To: llvm-bgq-discuss at lists.alcf.anl.gov
>>>>>>>> Sent: Thursday, July 17, 2014 11:53:07 AM
>>>>>>>> Subject: Re: [Llvm-bgq-discuss] Linker error: undefined
>>>>>>>> reference
>>>>>>>> to `vtable for std::nested_exception'
>>>>>>>>
>>>>>>>> Hi!
>>>>>>>>
>>>>>>>> The linker error Michael mentioned also appears for a
>>>>>>>> simple
>>>>>>>> hello world
>>>>>>>> program:
>>>>>>>>
>>>>>>>> #include <iostream>
>>>>>>>>
>>>>>>>> int main()
>>>>>>>> {
>>>>>>>> std::cout << "Hello, World!\n";
>>>>>>>> }
>>>>>>>>
>>>>>>>> Compiling it with bgclang++ is fine. Compiling with
>>>>>>>> bgclang++11,
>>>>>>>> which also
>>>>>>>> links with libc++, produces the linker error he mentioned
>>>>>>>> about
>>>>>>>> nested_exception. The nested_exception class members are
>>>>>>>> defined
>>>>>>>> inside the
>>>>>>>> exception.cpp file in the libc++ source. But there are
>>>>>>>> lots
>>>>>>>> of
>>>>>>>> macros
>>>>>>>> influencing what sections get compiled. Is the libc++ in
>>>>>>>> the
>>>>>>>> RPM
>>>>>>>> compiled with
>>>>>>>> libsupc++, libcxxrt or libcxxabi as the LIBCXX_CXX_ABI ?
>>>>>>>>
>>>>>>>> /Sandipan
>>>>>>>>
>>>>>>>> On Thursday 17 Jul 2014 11:30:35 Rob Latham wrote:
>>>>>>>>> See
>>>>>>>>> http://www.alcf.anl.gov/user-guides/bgclang-compiler#faq
>>>>>>>>> ,
>>>>>>>>> which
>>>>>>>>> I
>>>>>>>>> myself was just staring at last night:
>>>>>>>>>
>>>>>>>>> Linking code compiled with bgclang++ together with code
>>>>>>>>> compiled
>>>>>>>>> with
>>>>>>>>> bgclang++11 does not work, why?
>>>>>>>>>
>>>>>>>>> Code compiled using bgclang++ uses the same libstdc++
>>>>>>>>> standard
>>>>>>>>> template
>>>>>>>>> library (STL) implementation as the system-default GNU
>>>>>>>>> powerpc64-bgq-linux-g++ compiler. This provides
>>>>>>>>> compatibility
>>>>>>>>> with
>>>>>>>>> C++
>>>>>>>>> libraries, including some system libraries, compiled with
>>>>>>>>> the
>>>>>>>>> GNU
>>>>>>>>> toolchain. This STL implementation, however, cannot
>>>>>>>>> provide
>>>>>>>>> a
>>>>>>>>> conforming
>>>>>>>>> C++11 programming environment, and so bgclang++11 uses an
>>>>>>>>> up-to-date STL
>>>>>>>>> implementation derived from LLVM's libc++. Unfortunately,
>>>>>>>>> this
>>>>>>>>> STL
>>>>>>>>> implementation is incompatible with libstdc++, and so
>>>>>>>>> linking
>>>>>>>>> errors
>>>>>>>>> will result for functions that use STL objects as part of
>>>>>>>>> their
>>>>>>>>> signatures (i.e. parameter or return types).
>>>>>>>>>
>>>>>>>>> ==rob
>>>>>>>>>
>>>>>>>>> On 07/17/2014 08:48 AM, Michael Schlottke wrote:
>>>>>>>>>> Hi Hal,
>>>>>>>>>>
>>>>>>>>>> We tried to install the new version of clang on the BG/Q
>>>>>>>>>> @
>>>>>>>>>> FZ
>>>>>>>>>> Juelich
>>>>>>>>>> from your rpms, which worked like a breeze (thanks again
>>>>>>>>>> for
>>>>>>>>>> your
>>>>>>>>>> effors!). However, with the new installation we are not
>>>>>>>>>> able
>>>>>>>>>> to
>>>>>>>>>> link
>>>>>>>>>> even simple problems against libcxx, as all attempts end
>>>>>>>>>> with
>>>>>>>>>> the
>>>>>>>>>> following error:
>>>>>>>>>>
>>>>>>>>>> /bgsys/local/clang/r209570-20140527/libc++/lib/libc++.a(exception.c
>>>>>>>>>> pp.o):(
>>>>>>>>>> .toc+0x0): undefined reference to `vtable for
>>>>>>>>>> std::nested_exception'
>>>>>>>>>> clang: error: linker command failed with exit code 1
>>>>>>>>>> (use
>>>>>>>>>> -v
>>>>>>>>>> to
>>>>>>>>>> see
>>>>>>>>>> invocation)
>>>>>>>>>>
>>>>>>>>>> It happens as soon as we try to compile & link a dummy
>>>>>>>>>> program
>>>>>>>>>> that has
>>>>>>>>>> at least one std library include file. If we use
>>>>>>>>>> bgclang++,
>>>>>>>>>> the
>>>>>>>>>> error
>>>>>>>>>> does not occur, but it does when using either
>>>>>>>>>> -stdlib=libc++
>>>>>>>>>> or
>>>>>>>>>> bgclang++11.
>>>>>>>>>>
>>>>>>>>>> Do you have any idea what the source of the problem
>>>>>>>>>> could
>>>>>>>>>> be?
>>>>>>>>>> I
>>>>>>>>>> attached
>>>>>>>>>> a MWE and the output of running bgclang++11 with -v.
>>>>>>>>>>
>>>>>>>>>> Regards,
>>>>>>>>>>
>>>>>>>>>> Michael
>>>>>>>>>>
>>>>>>>>>> P.S.: We had a driver/toolchain upgrade on JUQUEEN and
>>>>>>>>>> thus
>>>>>>>>>> our
>>>>>>>>>> old
>>>>>>>>>> clang installations are not working anymore. Maybe this
>>>>>>>>>> could
>>>>>>>>>> be
>>>>>>>>>> related
>>>>>>>>>> to the problem?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> -------------------------------------------------------------------
>>>>>>>>>> -------
>>>>>>>>>> ----------------------
>>>>>>>>>> -------------------------------------------------------------------
>>>>>>>>>> ------
>>>>>>>>>> ----------------------- Forschungszentrum Juelich GmbH
>>>>>>>>>> 52425 Juelich
>>>>>>>>>> Sitz der Gesellschaft: Juelich
>>>>>>>>>> Eingetragen im Handelsregister des Amtsgerichts Dueren
>>>>>>>>>> Nr.
>>>>>>>>>> HR
>>>>>>>>>> B
>>>>>>>>>> 3498
>>>>>>>>>> Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen
>>>>>>>>>> Huthmacher
>>>>>>>>>> Geschaeftsfuehrung: Prof. Dr.-Ing. Wolfgang Marquardt
>>>>>>>>>> (Vorsitzender),
>>>>>>>>>> Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing.
>>>>>>>>>> Harald
>>>>>>>>>> Bolt,
>>>>>>>>>> Prof. Dr. Sebastian M. Schmidt
>>>>>>>>>> -------------------------------------------------------------------
>>>>>>>>>> -------
>>>>>>>>>> ----------------------
>>>>>>>>>> -------------------------------------------------------------------
>>>>>>>>>> ------
>>>>>>>>>> -----------------------
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> _______________________________________________
>>>>>>>>>> llvm-bgq-discuss mailing list
>>>>>>>>>> llvm-bgq-discuss at lists.alcf.anl.gov
>>>>>>>>>> https://lists.alcf.anl.gov/mailman/listinfo/llvm-bgq-discuss
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> llvm-bgq-discuss mailing list
>>>>>>>> llvm-bgq-discuss at lists.alcf.anl.gov
>>>>>>>> https://lists.alcf.anl.gov/mailman/listinfo/llvm-bgq-discuss
>>>>>>
>>>>>> ------------------------------------------------------------------------
>>>>>> ------------------------
>>>>>> -----------------------------------------------------------------------
>>>>>> ------------------------- Forschungszentrum Juelich GmbH
>>>>>> 52425 Juelich
>>>>>> Sitz der Gesellschaft: Juelich
>>>>>> Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR
>>>>>> B
>>>>>> 3498
>>>>>> Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen
>>>>>> Huthmacher
>>>>>> Geschaeftsfuehrung: Prof. Dr.-Ing. Wolfgang Marquardt
>>>>>> (Vorsitzender),
>>>>>> Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald
>>>>>> Bolt,
>>>>>> Prof. Dr. Sebastian M. Schmidt
>>>>>> ------------------------------------------------------------------------
>>>>>> ------------------------
>>>>>> -----------------------------------------------------------------------
>>>>>> ------------------------->
>>>>> --
>>>>> Hal Finkel
>>>>> Assistant Computational Scientist
>>>>> Leadership Computing Facility
>>>>> Argonne National Laboratory
>>>>> _______________________________________________
>>>>> llvm-bgq-discuss mailing list
>>>>> llvm-bgq-discuss at lists.alcf.anl.gov
>>>>> https://lists.alcf.anl.gov/mailman/listinfo/llvm-bgq-discuss
>>>
>>>
>>> ------------------------------------------------------------------------------------------------
>>> ------------------------------------------------------------------------------------------------
>>> Forschungszentrum Juelich GmbH
>>> 52425 Juelich
>>> Sitz der Gesellschaft: Juelich
>>> Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B
>>> 3498
>>> Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
>>> Geschaeftsfuehrung: Prof. Dr.-Ing. Wolfgang Marquardt
>>> (Vorsitzender),
>>> Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
>>> Prof. Dr. Sebastian M. Schmidt
>>> ------------------------------------------------------------------------------------------------
>>> ------------------------------------------------------------------------------------------------
>>>
>>>
>>> _______________________________________________
>>> llvm-bgq-discuss mailing list
>>> llvm-bgq-discuss at lists.alcf.anl.gov
>>> https://lists.alcf.anl.gov/mailman/listinfo/llvm-bgq-discuss
>>>
>>
>> --
>> Hal Finkel
>> Assistant Computational Scientist
>> Leadership Computing Facility
>> Argonne National Laboratory
>>
>


More information about the llvm-bgq-discuss mailing list