Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-14032 [libhdfs++] Phase 2 improvements
  3. HDFS-10355

Fix thread_local related build issue on Mac OS X

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • hdfs-client
    • None
    • OS: Mac OS X 10.11
      clang: Apple LLVM version 7.0.2 (clang-700.1.81)

    Description

      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:

           [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] /Users/tiborkiss/workspace/apache-hadoop/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/bindings/c/hdfs.cc:87:1: error: thread-local storage is not supported for the current target
           [exec] thread_local std::experimental::optional<fs_event_callback> fsEventCallback;
           [exec] ^
           [exec] /Users/tiborkiss/workspace/apache-hadoop/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/bindings/c/hdfs.cc:88:1: error: thread-local storage is not supported for the current target
           [exec] thread_local std::experimental::optional<file_event_callback> fileEventCallback;
           [exec] ^
           [exec] 1 warning and 3 errors generated.
      

      Attachments

        1. HDFS-10355.HDFS-8707.000.patch
          18 kB
          James Clampffer

        Activity

          People

            James C James Clampffer
            tibor.kiss@gmail.com Tibor Kiss
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: