-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[MLIR][Standalone] test Standalone against installed distribution #157944
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
514f557
989e06f
8ba23b7
b52185e
41b3bc7
321bc5d
0b46d9e
6970e86
c26e15a
a8b9c7d
d8cd431
74c8480
c982907
1b69ff6
d153c85
0181241
8f0f30d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,8 @@ if (MLIR_INCLUDE_INTEGRATION_TESTS) | |
|
||
endif() | ||
|
||
set(MLIR_STANDALONE_INSTALL_TEST_PREFIX "${MLIR_BINARY_DIR}/mlir-standalone-test-install") | ||
|
||
llvm_canonicalize_cmake_booleans( | ||
LLVM_BUILD_EXAMPLES | ||
LLVM_HAS_NVPTX_TARGET | ||
|
@@ -125,7 +127,6 @@ set(MLIR_TEST_DEPENDS | |
if(NOT MLIR_STANDALONE_BUILD) | ||
list(APPEND MLIR_TEST_DEPENDS FileCheck count not split-file yaml2obj) | ||
endif() | ||
|
||
set(MLIR_TEST_DEPENDS ${MLIR_TEST_DEPENDS} | ||
mlir-capi-pdl-test | ||
mlir-pdll-lsp-server | ||
|
@@ -199,6 +200,8 @@ if(LLVM_BUILD_EXAMPLES) | |
transform-opt-ch4 | ||
mlir-minimal-opt | ||
mlir-transform-opt | ||
mlir-cat | ||
mlir-minimal-opt-canonicalize | ||
) | ||
if(MLIR_ENABLE_EXECUTION_ENGINE) | ||
list(APPEND MLIR_TEST_DEPENDS | ||
|
@@ -240,6 +243,62 @@ add_custom_target(check-mlir-build-only | |
) | ||
set_target_properties(check-mlir-build-only PROPERTIES FOLDER "MLIR/Tests") | ||
|
||
get_property(LLVM_EXPORTS GLOBAL PROPERTY LLVM_EXPORTS) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unused? |
||
get_property(MLIR_EXPORTS GLOBAL PROPERTY MLIR_EXPORTS) | ||
add_custom_target( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be very clearly document here (the "why" and the "how") |
||
install-mlir-standalone-test-prefix | ||
DEPENDS ${MLIR_TEST_DEPENDS} ${MLIR_EXPORTS} FileCheck count not | ||
COMMAND ${CMAKE_COMMAND} -E make_directory "${MLIR_STANDALONE_INSTALL_TEST_PREFIX}" | ||
COMMAND "${CMAKE_COMMAND}" | ||
-DCMAKE_INSTALL_PREFIX="${MLIR_STANDALONE_INSTALL_TEST_PREFIX}" | ||
-P "${MLIR_BINARY_DIR}/cmake_install.cmake" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would think this command to be already pretty encompassing in itself, why are the other ones all needed below? ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you check the failing tests you will see the the union of |
||
COMMAND "${CMAKE_COMMAND}" | ||
-DCMAKE_INSTALL_COMPONENT=mlir-headers | ||
-DCMAKE_INSTALL_PREFIX="${MLIR_STANDALONE_INSTALL_TEST_PREFIX}" | ||
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake" | ||
COMMAND "${CMAKE_COMMAND}" | ||
-DCMAKE_INSTALL_COMPONENT=mlir-libraries | ||
-DCMAKE_INSTALL_PREFIX="${MLIR_STANDALONE_INSTALL_TEST_PREFIX}" | ||
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake" | ||
COMMAND "${CMAKE_COMMAND}" | ||
-DCMAKE_INSTALL_COMPONENT=mlir-cmake-exports | ||
-DCMAKE_INSTALL_PREFIX="${MLIR_STANDALONE_INSTALL_TEST_PREFIX}" | ||
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake" | ||
COMMAND "${CMAKE_COMMAND}" | ||
-DCMAKE_INSTALL_COMPONENT=mlir-tblgen | ||
-DCMAKE_INSTALL_PREFIX="${MLIR_STANDALONE_INSTALL_TEST_PREFIX}" | ||
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake" | ||
COMMAND "${CMAKE_COMMAND}" | ||
-DCMAKE_INSTALL_COMPONENT=mlir-pdll | ||
-DCMAKE_INSTALL_PREFIX="${MLIR_STANDALONE_INSTALL_TEST_PREFIX}" | ||
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake" | ||
COMMAND "${CMAKE_COMMAND}" | ||
-DCMAKE_INSTALL_COMPONENT=mlir-linalg-ods-yaml-gen | ||
-DCMAKE_INSTALL_PREFIX="${MLIR_STANDALONE_INSTALL_TEST_PREFIX}" | ||
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake" | ||
COMMAND "${CMAKE_COMMAND}" | ||
-DCMAKE_INSTALL_COMPONENT=mlir-opt | ||
-DCMAKE_INSTALL_PREFIX="${MLIR_STANDALONE_INSTALL_TEST_PREFIX}" | ||
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake" | ||
COMMAND "${CMAKE_COMMAND}" | ||
-DCMAKE_INSTALL_COMPONENT=mlir-python-sources | ||
-DCMAKE_INSTALL_PREFIX="${MLIR_STANDALONE_INSTALL_TEST_PREFIX}" | ||
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake" | ||
COMMAND "${CMAKE_COMMAND}" | ||
-DCMAKE_INSTALL_COMPONENT=FileCheck | ||
-DCMAKE_INSTALL_PREFIX="${MLIR_STANDALONE_INSTALL_TEST_PREFIX}" | ||
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake" | ||
COMMAND "${CMAKE_COMMAND}" | ||
-DCMAKE_INSTALL_COMPONENT=count | ||
-DCMAKE_INSTALL_PREFIX="${MLIR_STANDALONE_INSTALL_TEST_PREFIX}" | ||
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake" | ||
COMMAND "${CMAKE_COMMAND}" | ||
-DCMAKE_INSTALL_COMPONENT=not | ||
-DCMAKE_INSTALL_PREFIX="${MLIR_STANDALONE_INSTALL_TEST_PREFIX}" | ||
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake" | ||
) | ||
list(APPEND MLIR_TEST_DEPENDS install-mlir-standalone-test-prefix) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suspect we only need this if testing the examples is enabled (that is |
||
|
||
add_lit_testsuite(check-mlir "Running the MLIR regression tests" | ||
${CMAKE_CURRENT_BINARY_DIR} | ||
DEPENDS ${MLIR_TEST_DEPENDS} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# RUN: echo "test install" | tee %t | ||
# CHECK: test install | ||
|
||
# RUN: "%cmake_exe" "%mlir_src_root/examples/standalone" -G "%cmake_generator" \ | ||
# RUN: -DCMAKE_CXX_COMPILER=%host_cxx -DCMAKE_C_COMPILER=%host_cc \ | ||
# RUN: -DLLVM_ENABLE_LIBCXX=%enable_libcxx \ | ||
# RUN: -DLLVM_EXTERNAL_LIT="%llvm_obj_root/bin/llvm-lit" \ | ||
# RUN: -DMLIR_DIR="%standalone_install_test_prefix/lib/cmake/mlir" \ | ||
# RUN: -DLLVM_DIR="%standalone_install_test_prefix/lib/cmake/llvm" \ | ||
# RUN: -DLLVM_USE_LINKER=%llvm_use_linker \ | ||
# RUN: -DPython3_EXECUTABLE=%python \ | ||
# RUN: -DPython_EXECUTABLE=%python | tee -a %t | ||
|
||
# RUN: "%cmake_exe" --build . --target check-standalone -j | tee -a %t | ||
|
||
# RUN: FileCheck --input-file=%t %s | ||
|
||
# CHECK: Passed | ||
# CHECK-NOT: Failed | ||
# UNSUPPORTED: target={{.*(android).*}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still necessary with your new approach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's true it's not but it actually revealed (indirectly) a failure mode - because the
monolithic
script is touched, all the projects are added, and the "layering issues" are revealed.