[PATCH] D74480: [MLIR][CUDA] Fix build file for mlir-cuda-runner
Stephan Herhut via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 12 05:45:47 PST 2020
herhut created this revision.
Herald added subscribers: llvm-commits, Joonsoo, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, burmako, jpienaar, rriddle, mehdi_amini, mgorny.
Herald added a reviewer: jdoerfert.
Herald added a project: LLVM.
herhut added a reviewer: ftynse.
herhut added a comment.
PTAL
This was broken recently when moving from dialect registration via
static initializers to explicit intialization.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D74480
Files:
mlir/tools/mlir-cuda-runner/CMakeLists.txt
Index: mlir/tools/mlir-cuda-runner/CMakeLists.txt
===================================================================
--- mlir/tools/mlir-cuda-runner/CMakeLists.txt
+++ mlir/tools/mlir-cuda-runner/CMakeLists.txt
@@ -35,31 +35,48 @@
${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 @@
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()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74480.244145.patch
Type: text/x-patch
Size: 1934 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200212/b407dd31/attachment.bin>
More information about the llvm-commits
mailing list