Siyao Meng created YARN-9487:
--------------------------------

             Summary: NodeManager shouldn't link against librt on macOS
                 Key: YARN-9487
                 URL: https://issues.apache.org/jira/browse/YARN-9487
             Project: Hadoop YARN
          Issue Type: Bug
          Components: nodemanager
    Affects Versions: 3.2.0, 3.3.0
            Reporter: Siyao Meng


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:
{code}
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)
{code}

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

Will upload the patch after I'm added to YARN contributor list.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to