[Mlir-commits] [mlir] 864110b - [MLIR][CUDA] Fix build file for mlir-cuda-runner

Stephan Herhut llvmlistbot at llvm.org
Wed Feb 12 06:11:15 PST 2020


Author: Stephan Herhut
Date: 2020-02-12T15:10:51+01:00
New Revision: 864110b5b499f8fd6ae55d936ea9f6764569941a

URL: https://github.com/llvm/llvm-project/commit/864110b5b499f8fd6ae55d936ea9f6764569941a
DIFF: https://github.com/llvm/llvm-project/commit/864110b5b499f8fd6ae55d936ea9f6764569941a.diff

LOG: [MLIR][CUDA] Fix build file for mlir-cuda-runner

Summary:
This was broken recently when moving from dialect registration via
static initializers to explicit intialization.

Differential Revision: https://reviews.llvm.org/D74480

Added: 
    

Modified: 
    mlir/tools/mlir-cuda-runner/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/mlir/tools/mlir-cuda-runner/CMakeLists.txt b/mlir/tools/mlir-cuda-runner/CMakeLists.txt
index 294ff7f0f70a..c79d64afa80e 100644
--- a/mlir/tools/mlir-cuda-runner/CMakeLists.txt
+++ b/mlir/tools/mlir-cuda-runner/CMakeLists.txt
@@ -35,31 +35,48 @@ if(MLIR_CUDA_RUNNER_ENABLED)
     ${CUDA_RUNTIME_LIBRARY}
   )
 
-  set(FULL_LINK_LIBS
+  set(LIBS
+    LLVMCore
+    LLVMSupport
+    MLIRJitRunner
     MLIRAffineOps
-    MLIRLoopToStandard
+    MLIRAnalysis
+    MLIREDSC
+    MLIRExecutionEngine
+    MLIRFxpMathOps
     MLIRGPU
     MLIRGPUtoCUDATransforms
     MLIRGPUtoNVVMTransforms
+    MLIRIR
     MLIRLLVMIR
+    MLIRLinalgOps
+    MLIRLoopToStandard
+    MLIROpenMP
+    MLIRParser
+    MLIRQuantOps
+    MLIRROCDLIR
+    MLIRSPIRV
+    MLIRSPIRV
     MLIRStandardOps
     MLIRStandardToLLVM
+    MLIRSupport
     MLIRTargetLLVMIR
     MLIRTransforms
     MLIRTranslation
-  )
-  set(LIBS
-    MLIRIR
-    MLIRParser
-    MLIREDSC
-    MLIRAnalysis
-    MLIRExecutionEngine
-    MLIRJitRunner
-    MLIRSupport
-    LLVMCore
-    LLVMSupport
     ${CUDA_RUNTIME_LIBRARY}
   )
+
+  # Manually expand the target library, since our MLIR libraries
+  # aren't plugged into the LLVM dependency tracking. If we don't
+  # do this then we can't insert the CodeGen library after ourselves
+  llvm_expand_pseudo_components(TARGET_LIBS AllTargetsCodeGens)
+  # Prepend LLVM in front of every target, this is how the library
+  # are named with CMake
+  SET(targets_to_link)
+  FOREACH(t ${TARGET_LIBS})
+    LIST(APPEND targets_to_link "LLVM${t}")
+  ENDFOREACH(t)
+
   add_llvm_tool(mlir-cuda-runner
     mlir-cuda-runner.cpp
   )
@@ -68,7 +85,6 @@ if(MLIR_CUDA_RUNNER_ENABLED)
     PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}
   )
   llvm_update_compile_flags(mlir-cuda-runner)
-  whole_archive_link(mlir-cuda-runner ${FULL_LINK_LIBS})
-  target_link_libraries(mlir-cuda-runner PRIVATE ${FULL_LINK_LIBS} ${LIBS})
+  target_link_libraries(mlir-cuda-runner PRIVATE ${LIBS} ${targets_to_link})
 
 endif()


        


More information about the Mlir-commits mailing list