Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-9487

NodeManager native build shouldn't link against librt on macOS

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.2.0, 3.3.0
    • 3.3.0, 3.2.1
    • nodemanager
    • None
    • Darwin 18.5.0 Darwin Kernel Version 18.5.0: Mon Mar 11 20:40:32 PDT 2019; root:xnu-4903.251.3~3/RELEASE_X86_64 x86_64
      Apple LLVM version 10.0.1 (clang-1001.0.46.3)

    Description

      I'm compiling hadoop/trunk native on a Mac. Found that when compiling NodeManager it is trying to link against librt on Darwin as well - and it failed for sure. Diff for a quick fix:

      diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/CMakeLists.txt b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/CMakeLists.txt
      index f0f005d53b5..9c3f0135aaf 100644
      --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/CMakeLists.txt
      +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/CMakeLists.txt
      @@ -190,5 +190,10 @@ add_executable(test-oom-listener
               main/native/oom-listener/impl/oom_listener.h
               main/native/oom-listener/test/oom_listener_test_main.cc
       )
      -target_link_libraries(test-oom-listener gtest rt)
      +if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
      +    # macOS does not have rt
      +    target_link_libraries(test-oom-listener gtest)
      +else()
      +    target_link_libraries(test-oom-listener gtest rt)
      +endif()
       output_directory(test-oom-listener test)
      

      This line of code is added in YARN-8437, so this affects 3.2.0+.

      Attachments

        1. YARN-9487.001.patch
          0.9 kB
          Siyao Meng

        Issue Links

          Activity

            People

              smeng Siyao Meng
              smeng Siyao Meng
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: