Tibor Kiss created HDFS-10355:
---------------------------------

             Summary: Fix thread_local related build issue on Mac OS X
                 Key: HDFS-10355
                 URL: https://issues.apache.org/jira/browse/HDFS-10355
             Project: Hadoop HDFS
          Issue Type: Sub-task
          Components: hdfs-client
         Environment: OS: Mac OS X 10.11
clang: Apple LLVM version 7.0.2 (clang-700.1.81)
            Reporter: Tibor Kiss


The native hdfs library uses C++11 features heavily.
One of such feature is thread_local storage class which is supported in GCC, 
Visual Studio and the community version of clang compiler, but not by Apple's 
clang (which is default on OS X boxes). 
See further details here: http://stackoverflow.com/a/29929949

Even though not many Hadoop cluster runs on OS X developers still use this 
platform for development.

The problem can be solved multiple ways:
 a) Stick to gcc/g++ or community based clang on OS X. Developers will need 
extra steps to build Hadoop.
 b) Workaround thread_local with a helper class.
 c) Get rid of all the globals marked with thread_local. Interface change will 
be erquired.
 d) Disable multi threading support in the native client on OS X and document 
this limitation. 

Compile error related to thread_local:
{noformat}
     [exec] 
/Users/tiborkiss/workspace/apache-hadoop/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/bindings/c/hdfs.cc:66:1:
 error: thread-local storage is not supported for the current target
     [exec] thread_local std::string errstr;
     [exec] ^
     [exec] 1 warning and 1 error generated.
     [exec] make[2]: *** 
[main/native/libhdfspp/lib/bindings/c/CMakeFiles/bindings_c_obj.dir/hdfs.cc.o] 
Error 1
     [exec] make[1]: *** 
[main/native/libhdfspp/lib/bindings/c/CMakeFiles/bindings_c_obj.dir/all] Error 2
     [exec] make: *** [all] Error 2
{noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-dev-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-dev-h...@hadoop.apache.org

Reply via email to