intel / mlir-extensions

Intel® Extension for MLIR. A staging ground for MLIR dialects and tools for Intel devices using the MLIR toolchain.
Other
126 stars 45 forks source link

Build failure on main branch. #663

Open Menooker opened 1 year ago

Menooker commented 1 year ago

Seems a C++ problem:

/home/username/mlir-extensions/lib/Conversion/XeGPUToSPIRV/XeGPUToSPIRV.cpp: In function ‘void {anonymous}::lookupOrInsertIntrinsic(mlir::ConversionPatternRewriter&, mlir::Operation*, std::string, mlir::FunctionType)’:
/home/username/mlir-extensions/lib/Conversion/XeGPUToSPIRV/XeGPUToSPIRV.cpp:112:54: error: cannot convert ‘mlir::StringAttr’ to ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’}
  112 |                                                      nameAttr, linkageTypeAttr);
      |                                                      ^~~~~~~~
      |                                                      |
      |                                                      mlir::StringAttr
In file included from /home/username/llvm/llvm/../mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.h:22,
                 from /home/username/llvm/llvm/../mlir/include/mlir/Dialect/SPIRV/IR/SPIRVOps.h:17,
                 from /home/username/mlir-extensions/include/imex/Conversion/XeGPUToSPIRV/XeGPUToSPIRV.h:18,
                 from /home/username/mlir-extensions/lib/Conversion/XeGPUToSPIRV/XeGPUToSPIRV.cpp:15:
/home/username/llvm/build/tools/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.h.inc:433:78: note:   initializing argument 2 of ‘static mlir::spirv::LinkageAttributesAttr mlir::spirv::LinkageAttributesAttr::get(mlir::MLIRContext*, std::string, mlir::spirv::LinkageTypeAttr)’
  433 |   static LinkageAttributesAttr get(::mlir::MLIRContext *context, std::string linkage_name, mlir::spirv::LinkageTypeAttr linkage_type);
      |                                                                  ~~~~~~~~~~~~^~~~~~~~~~~~
ninja: build stopped: subcommand failed.
Menooker commented 1 year ago

Using "option 1" in the Readme:

(base) username@machine:~/llvm/build$ /usr/bin/c++ --version
c++ (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

(base) username@machine:~/llvm/build$ cat ../../mlir-extensions/build_tools/llvm_version.txt
d20190e68413634b87f0f9426312a0e9d8456d18
(base) username@machine:~/llvm/build$ git log
commit d20190e68413634b87f0f9426312a0e9d8456d18 (HEAD)
Author: Fangrui Song <i@maskray.me>
Date:   Fri Sep 29 10:13:06 2023 -0700

    [test] Change llc -march=aarch64|arm64 to -mtriple=aarch64|arm64

    Similar to commit 806761a7629df268c8aed49657aeccffa6bca449 to avoid issues due
    to object file format differences. These tests are currently benign.

(base) username@machine:~/llvm/build$ /home/shared/bin/cmake-3.27/bin/cmake ../llvm -G Ninja  -DLLVM_ENABLE_PROJECTS=mlir    -DLLVM_BUILD_EXAMPLES=ON    -DLLVM_TARGETS_TO_BUILD="X86"    -DCMAKE_BUILD_TYPE=Release    -DLLVM_ENABLE_ASSERTIONS=ON    -DLLVM_EXTERNAL_PROJECTS="Imex" -DLLVM_EXTERNAL_IMEX_SOURCE_DIR=../../mlir-extensions
(base) username@machine:~/llvm/build$ /home/shared/bin/cmake-3.27/bin/cmake --build . --target check-imex
etiotto commented 1 year ago

I have found the same issue:


FAILED: tools/Imex/lib/Conversion/XeGPUToSPIRV/CMakeFiles/obj.XeGPUToSPIRV.dir/XeGPUToSPIRV.cpp.o 
/usr/bin/g++ -DBUILD_EXAMPLES -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D_LIBCPP_ENABLE_HARDENED_MODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/iusers/etiotto/imex/llvm-project/build/tools/Imex/lib/Conversion/XeGPUToSPIRV -I/iusers/etiotto/imex/mlir-extensions/lib/Conversion/XeGPUToSPIRV -I/iusers/etiotto/imex/llvm-project/build/include -I/iusers/etiotto/imex/llvm-project/llvm/include -I/iusers/etiotto/imex/llvm-project/llvm/../mlir/include -I/iusers/etiotto/imex/llvm-project/build/tools/mlir/include -I/iusers/etiotto/imex/mlir-extensions/include -I/iusers/etiotto/imex/llvm-project/build/tools/Imex/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG   -DBUILD_EXAMPLES -D_GNU_SOURCE -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_LIBCPP_ENABLE_HARDENED_MODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/Imex/lib/Conversion/XeGPUToSPIRV/CMakeFiles/obj.XeGPUToSPIRV.dir/XeGPUToSPIRV.cpp.o -MF tools/Imex/lib/Conversion/XeGPUToSPIRV/CMakeFiles/obj.XeGPUToSPIRV.dir/XeGPUToSPIRV.cpp.o.d -o tools/Imex/lib/Conversion/XeGPUToSPIRV/CMakeFiles/obj.XeGPUToSPIRV.dir/XeGPUToSPIRV.cpp.o -c /iusers/etiotto/imex/mlir-extensions/lib/Conversion/XeGPUToSPIRV/XeGPUToSPIRV.cpp
/iusers/etiotto/imex/mlir-extensions/lib/Conversion/XeGPUToSPIRV/XeGPUToSPIRV.cpp: In function ‘void {anonymous}::lookupOrInsertIntrinsic(mlir::ConversionPatternRewriter&, mlir::Operation*, std::string, mlir::FunctionType)’:
/iusers/etiotto/imex/mlir-extensions/lib/Conversion/XeGPUToSPIRV/XeGPUToSPIRV.cpp:112:54: error: cannot convert ‘mlir::StringAttr’ to ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’}
  112 |                                                      nameAttr, linkageTypeAttr);
      |                                                      ^~~~~~~~
      |                                                      |
      |                                                      mlir::StringAttr
etiotto commented 1 year ago

Fixed by PR #667.

nbpatel commented 1 year ago

@etiotto You need to apply the patches under build_tools/patches from imex in your llvm project and rebuild llvm and imex