-
Notifications
You must be signed in to change notification settings - Fork 41
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
[Issue]: rocMLIR compilation issue #1500
Comments
It's seems file it's not generated. namespace mlir { } // namespace mlir how I can trigger generation of this file ? |
One thing I can say is that |
The same problem,
and the same result. |
I found how to generate the file, but does not know what cause the problem. I cat the build.ninja file and grep for both files MHALTypes.h.inc and RocMLIRPasses.h.inc when the project compile is around 30% and manual start the process from another console: mlir-tblgen -gen-pass-decls -name RocMLIRConversion ... But now come the second problem, after I do cmake --build . --target package
|
... yes, I'm clarifying here that our build system is designed under the assumption that we will be uses a static library when other ROCm components depend on us - a shared library build is intended specifically for internal testing. If you want |
To be clear, the combination of CMake flags given above is not one we test or support. If you have changes we can make to our build steps that would allow that combination of flags to work, they won't be rejected unless they break the static library usecase. I'm leaving this issue open to allow further discussion on the matter but am making no commitment to doing the work of fixing it |
I don't think the problem are in CMake flags. With official way that I get from project readme have the same effect. I even try to compile it with single thread and result is the same. Generation of these files it's not triggered. I watch the directories and these files RocMLIRPasses.h.inc, RocMLIRPasses.h.inc.d, MHALTypes.h.inc, MHALTypes.h.inc.d it's not generated but as I write above if I generate them too early something is delete them. My ninja version is 1.12.1 cmake version 3.29.3 |
This fixes it for me. diff -aur a/mlir/lib/Dialect/Rock/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Rock/Transforms/CMakeLists.txt
--- a/mlir/lib/Dialect/Rock/Transforms/CMakeLists.txt 2023-06-09 08:18:16.000000000 +0800
+++ b/mlir/lib/Dialect/Rock/Transforms/CMakeLists.txt 2024-05-26 16:26:56.644359564 +0800
@@ -23,6 +23,8 @@
DEPENDS
MLIRRockOpsIncGen
MLIRRockPassIncGen
+ MLIRConversionPassIncGen
+ RocMLIRConversionPassIncGen
LINK_LIBS PUBLIC
MLIRAffineTransforms |
Thanks, this patch fix the compilation issue. |
@aquad Can you submit that as a PR please? (I'd like to make sure your name's on it so we're not just stealing your patch) |
Problem Description
Hi ppl,
Im trying to compile version 6.1.0 with these configuration options
cmake
-Wno-dev
-G Ninja
-D CMAKE_CXX_FLAGS="${CXXFLAGS} -fcf-protection=none"
-D CMAKE_INSTALL_PREFIX=/usr
-D CMAKE_BUILD_TYPE=Release
-D CMAKE_C_COMPILER=/opt/rocm/llvm/bin/clang
-D CMAKE_CXX_COMPILER=/opt/rocm/llvm/bin/clang++
-D BUILD_FAT_LIBROCKCOMPILER=ON
-D BUILD_SHARED_LIBS=ON
-D ROCM_TEST_CHIPSET=gfx900
..
ninja
and I got error:
[3/299] Building CXX object mlir/lib/Dialect/Rock/Transforms/CMakeFiles/obj.MLIRRockTransforms.dir/ViewToTransform.cpp.o
FAILED: mlir/lib/Dialect/Rock/Transforms/CMakeFiles/obj.MLIRRockTransforms.dir/ViewToTransform.cpp.o
/opt/rocm/llvm/bin/clang++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_LIBCPP_ENABLE_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/mnt/arhiv/rocm/rocm-build/build/rocmlir/mlir/lib/Dialect/Rock/Transforms -I/mnt/arhiv/rocm/release/rocMLIR-rocm-6.1.0/mlir/lib/Dialect/Rock/Transforms -I/mnt/arhiv/rocm/release/rocMLIR-rocm-6.1.0/external/llvm-project/llvm/include -I/mnt/arhiv/rocm/rocm-build/build/rocmlir/external/llvm-project/llvm/include -I/mnt/arhiv/rocm/release/rocMLIR-rocm-6.1.0/external/llvm-project/mlir/include -I/mnt/arhiv/rocm/rocm-build/build/rocmlir/external/llvm-project/llvm/tools/mlir/include -I/mnt/arhiv/rocm/release/rocMLIR-rocm-6.1.0/external/mlir-hal/mlir/include -I/mnt/arhiv/rocm/rocm-build/build/rocmlir/external/mlir-hal/include -I/mnt/arhiv/rocm/release/rocMLIR-rocm-6.1.0/external/mlir-hal/include -I/mnt/arhiv/rocm/release/rocMLIR-rocm-6.1.0/mlir/include -I/mnt/arhiv/rocm/rocm-build/build/rocmlir/mlir/include -fcf-protection=none -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Werror=global-constructors -O3 -DNDEBUG -std=gnu++17 -fPIC -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_LIBCPP_ENABLE_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_LIBCPP_ENABLE_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT mlir/lib/Dialect/Rock/Transforms/CMakeFiles/obj.MLIRRockTransforms.dir/ViewToTransform.cpp.o -MF mlir/lib/Dialect/Rock/Transforms/CMakeFiles/obj.MLIRRockTransforms.dir/ViewToTransform.cpp.o.d -o mlir/lib/Dialect/Rock/Transforms/CMakeFiles/obj.MLIRRockTransforms.dir/ViewToTransform.cpp.o -c /mnt/arhiv/rocm/release/rocMLIR-rocm-6.1.0/mlir/lib/Dialect/Rock/Transforms/ViewToTransform.cpp
In file included from /mnt/arhiv/rocm/release/rocMLIR-rocm-6.1.0/mlir/lib/Dialect/Rock/Transforms/ViewToTransform.cpp:14:
/mnt/arhiv/rocm/release/rocMLIR-rocm-6.1.0/mlir/include/mlir/Conversion/TosaToRock/TosaToRock.h:21:10: fatal error: 'mlir/Conversion/RocMLIRPasses.h.inc' file not found
21 | #include "mlir/Conversion/RocMLIRPasses.h.inc"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
[20/299] Building CXX object external/llvm-project/llvm/tools/mlir/lib/Dialect/Linalg/Transforms/CMakeFiles/obj.MLIRLinalgTransforms.dir/ElementwiseOpFusion.cpp.o
ninja: build stopped: subcommand failed.
[2948/3182] Building CXX object mlir/lib/Dialect/Rock/Transforms/CMakeFiles/obj.MLIRRockTransforms.dir/CheckResidency.cpp.o
FAILED: mlir/lib/Dialect/Rock/Transforms/CMakeFiles/obj.MLIRRockTransforms.dir/CheckResidency.cpp.o
/opt/rocm/llvm/bin/clang++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_LIBCPP_ENABLE_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/mnt/arhiv/rocm/rocm-build/build/rocmlir/mlir/lib/Dialect/Rock/Transforms -I/mnt/arhiv/rocm/release/rocMLIR-rocm-6.1.0/mlir/lib/Dialect/Rock/Transforms -I/mnt/arhiv/rocm/release/rocMLIR-rocm-6.1.0/external/llvm-project/llvm/include -I/mnt/arhiv/rocm/rocm-build/build/rocmlir/external/llvm-project/llvm/include -I/mnt/arhiv/rocm/release/rocMLIR-rocm-6.1.0/external/llvm-project/mlir/include -I/mnt/arhiv/rocm/rocm-build/build/rocmlir/external/llvm-project/llvm/tools/mlir/include -I/mnt/arhiv/rocm/release/rocMLIR-rocm-6.1.0/external/mlir-hal/mlir/include -I/mnt/arhiv/rocm/rocm-build/build/rocmlir/external/mlir-hal/include -I/mnt/arhiv/rocm/release/rocMLIR-rocm-6.1.0/external/mlir-hal/include -I/mnt/arhiv/rocm/release/rocMLIR-rocm-6.1.0/mlir/include -I/mnt/arhiv/rocm/rocm-build/build/rocmlir/mlir/include -fcf-protection=none -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Werror=global-constructors -O3 -DNDEBUG -std=gnu++17 -fPIC -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_LIBCPP_ENABLE_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_LIBCPP_ENABLE_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT mlir/lib/Dialect/Rock/Transforms/CMakeFiles/obj.MLIRRockTransforms.dir/CheckResidency.cpp.o -MF mlir/lib/Dialect/Rock/Transforms/CMakeFiles/obj.MLIRRockTransforms.dir/CheckResidency.cpp.o.d -o mlir/lib/Dialect/Rock/Transforms/CMakeFiles/obj.MLIRRockTransforms.dir/CheckResidency.cpp.o -c /mnt/arhiv/rocm/release/rocMLIR-rocm-6.1.0/mlir/lib/Dialect/Rock/Transforms/CheckResidency.cpp
In file included from /mnt/arhiv/rocm/release/rocMLIR-rocm-6.1.0/mlir/lib/Dialect/Rock/Transforms/CheckResidency.cpp:16:
In file included from /mnt/arhiv/rocm/release/rocMLIR-rocm-6.1.0/external/mlir-hal/include/mlir/Dialect/MHAL/IR/MHAL.h:27:
/mnt/arhiv/rocm/release/rocMLIR-rocm-6.1.0/external/mlir-hal/include/mlir/Dialect/MHAL/IR/MHALTypes.h:22:10: fatal error: 'mlir/Dialect/MHAL/IR/MHALTypes.h.inc' file not found
22 | #include "mlir/Dialect/MHAL/IR/MHALTypes.h.inc"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Any help please ?
Operating System
Slackware 15.0
CPU
AMD Ryzen 7 3800X 8-Core Processor
GPU
AMD Radeon RX 7900 XTX
ROCm Version
ROCm 6.1.0
ROCm Component
rocMLIR
Steps to Reproduce
No response
(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: