[Llvm-bgq-discuss] Does bgclang++11 implement thread_local
Patrick E Gartung
gartung at fnal.gov
Thu Jul 14 20:53:17 CDT 2016
Hi Hal,
Can you add libc++abi to the bgclang build? It is supposed to provide thread local for clang.
http://libcxxabi.llvm.org/
As you can see from the link line I also tried to use libsupc++ for this.
Patrick
On 7/14/16, 8:28 PM, "Hal Finkel" <hfinkel at anl.gov> wrote:
>Hi Patrick,
>
>Thanks for the report. I suspect this is another case where bgclang++11 needs to supplement the base system libraries; I'll need to see whether that is possible. thread_local should work on plain data types; I suspect this problem is tied to the need to call a destructor on this variable when the thread terminates.
>
> -Hal
>
>----- Original Message -----
>> From: "Patrick E Gartung" <gartung at fnal.gov>
>> To: llvm-bgq-discuss at lists.alcf.anl.gov
>> Sent: Tuesday, July 12, 2016 11:25:54 PM
>> Subject: [Llvm-bgq-discuss] Does bgclang++11 implement thread_local
>>
>> Hi
>>
>> I am trying to link code that uses thread_local and I get this error:
>>
>> /soft/compilers/bgclang/nightly/wbin/bgclang++11 -g -fPIC
>> -fno-vectorize -fno-slp-vectorize -std=c++11 -std=c++14 -dynamic
>> -lsupc++ CMakeFiles/TBBDemo.dir/main.cpp.o -o
>> ../BuildProducts/bin/TBBDemo -rdynamic
>> ../BuildProducts/lib64/libTBBFrameworkCore.a
>> ../BuildProducts/lib64/libTBBTestModules.so
>> ../BuildProducts/lib64/libTBBFrameworkCore.a
>> /home/gartung/tbb44_20160526oss/build/linux_bg_clang_cc4.4.7_libc2.12_kernel2.6.32_release/libtbbmalloc.a
>> /home/gartung/tbb44_20160526oss/build/linux_bg_clang_cc4.4.7_libc2.12_kernel2.6.32_release/libtbb.a
>> -Wl,-rpath,/home/gartung/build/BuildProducts/lib64:
>> ../BuildProducts/lib64/libTBBFrameworkCore.a(ModuleThreadStack.cpp.o):
>> In function `demo::ModuleThreadStack::privateStack()':
>> /home/gartung/toy-mt-framework/TBBProcessingDemo/TBBFrameworkCore/ModuleThreadStack.cpp:21:
>> undefined reference to `__cxa_thread_atexit’
>>
>> This is line 21 of ModuleThreadStack.cpp
>>
>> thread_local std::vector<TransitionModuleID> s_stack;
>>
>> Does bgclang++11 implement thread_local?
>>
>> Patrick Gartung
>> _______________________________________________
>> 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