[Kst] Compiling problem on Mac "Thread-local storage"

Peter Kümmel syntheticpp at gmx.net
Fri Jan 3 22:13:52 UTC 2014


On 03.01.2014 22:11, Barth Netterfield wrote:
> On January 2, 2014 2:52:35 PM Nicholas Chapman wrote:
>> Hi, just now I did a "git pull" to get the latest KST, then attempted
>> to build it.  I get the following error message:
>>
>> In file included from
>> /Users/chapman/data1/Applications/kst/src/datasources/ascii/asciisource.cpp:
>> 22:
>> /Users/chapman/data1/Applications/kst/src/datasources/ascii/kst_atof.h:63:
>> error: thread-local storage not supported for this target
>> make[2]: ***
>> [src/datasources/CMakeFiles/kst2_datasource_ascii.dir/Users/chapman/data1/A
>> pplications/kst/src/datasources/ascii/asciisource.cpp.o] Error 1
>> make[1]: *** [src/datasources/CMakeFiles/kst2_datasource_ascii.dir/all]
>> Error 2 make: *** [all] Error 2
>> 14:47:25: The process "/usr/bin/make" exited with code 2.
>> Error while building/deploying project Kst (kit: Desktop)
>>
>> It looks like it is complaining about line 63 of
>> kst/src/datasources/ascii/kst_atof.h:
>> static KST_THREAD_LOCAL double _previousValue;
>
> Ooohh..  Yikes.
>
> It looks like __thread isn't supported in clang on Mac - at least for your
> compiler version.  (but it is on linux?)
>
> Maybe try with gcc, which apparently 'fakes' it so it works?

I thought this was a gcc error message. ;)

>
> Peter - can you suggest a mac/clang fix?
>
>

I assume more recent clang versions support TLS (isn't TLS part of C++11?)
On systems without TLS support in gcc and clang I would just disable the
"last value" feature for NaN values in ascii data, only there TLS is needed.

Ideally cmake checks if TLS is available.

Peter



More information about the Kst mailing list