Skip to content

Add missing imports #138550

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

Closed

Conversation

FilipLaurentiu
Copy link

@FilipLaurentiu FilipLaurentiu commented May 5, 2025

Build fail without these imports

Copy link

github-actions bot commented May 5, 2025

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@llvmbot
Copy link
Member

llvmbot commented May 5, 2025

@llvm/pr-subscribers-mlir-spirv
@llvm/pr-subscribers-mlir

@llvm/pr-subscribers-mlir-affine

Author: Filip Laurentiu (FilipLaurentiu)

Changes

Build fail without these imports


Full diff: https://github.com/llvm/llvm-project/pull/138550.diff

3 Files Affected:

  • (modified) mlir/include/mlir/Dialect/Affine/IR/ValueBoundsOpInterfaceImpl.h (+1)
  • (modified) mlir/include/mlir/Target/SPIRV/Deserialization.h (+1)
  • (modified) mlir/include/mlir/Target/SPIRV/Serialization.h (+1)
diff --git a/mlir/include/mlir/Dialect/Affine/IR/ValueBoundsOpInterfaceImpl.h b/mlir/include/mlir/Dialect/Affine/IR/ValueBoundsOpInterfaceImpl.h
index 451c466fa0c95..642e99d963ef6 100644
--- a/mlir/include/mlir/Dialect/Affine/IR/ValueBoundsOpInterfaceImpl.h
+++ b/mlir/include/mlir/Dialect/Affine/IR/ValueBoundsOpInterfaceImpl.h
@@ -10,6 +10,7 @@
 #define MLIR_DIALECT_AFFINE_IR_VALUEBOUNDSOPINTERFACEIMPL_H
 
 #include "mlir/Support/LLVM.h"
+#include <cstdint>
 
 namespace mlir {
 class DialectRegistry;
diff --git a/mlir/include/mlir/Target/SPIRV/Deserialization.h b/mlir/include/mlir/Target/SPIRV/Deserialization.h
index e39258beeaac8..a346a7fd1e5f7 100644
--- a/mlir/include/mlir/Target/SPIRV/Deserialization.h
+++ b/mlir/include/mlir/Target/SPIRV/Deserialization.h
@@ -15,6 +15,7 @@
 
 #include "mlir/IR/OwningOpRef.h"
 #include "mlir/Support/LLVM.h"
+#include <cstdint>
 
 namespace mlir {
 class MLIRContext;
diff --git a/mlir/include/mlir/Target/SPIRV/Serialization.h b/mlir/include/mlir/Target/SPIRV/Serialization.h
index 613f0a423f9f8..225777e25d607 100644
--- a/mlir/include/mlir/Target/SPIRV/Serialization.h
+++ b/mlir/include/mlir/Target/SPIRV/Serialization.h
@@ -14,6 +14,7 @@
 #define MLIR_TARGET_SPIRV_SERIALIZATION_H
 
 #include "mlir/Support/LLVM.h"
+#include <cstdint>
 
 namespace mlir {
 class MLIRContext;

Copy link
Member

@matthias-springer matthias-springer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what's the process for pushing to a release branch.

@@ -10,6 +10,7 @@
#define MLIR_DIALECT_AFFINE_IR_VALUEBOUNDSOPINTERFACEIMPL_H

#include "mlir/Support/LLVM.h"
#include <cstdint>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this import needed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[1747/5390] Building CXX object tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/ValueBoundsOpInterfaceImpl.cpp.o
FAILED: tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/ValueBoundsOpInterfaceImpl.cpp.o
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /usr/bin/c++ -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/filip/Work/llvm-project/build/tools/mlir/lib/Dialect/Affine/IR -I/home/filip/Work/llvm-project/mlir/lib/Dialect/Affine/IR -I/home/filip/Work/llvm-project/build/include -I/home/filip/Work/llvm-project/llvm/include -I/home/filip/Work/llvm-project/mlir/include -I/home/filip/Work/llvm-project/build/tools/mlir/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 -Wundef -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -MD -MT tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/ValueBoundsOpInterfaceImpl.cpp.o -MF tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/ValueBoundsOpInterfaceImpl.cpp.o.d -o tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/ValueBoundsOpInterfaceImpl.cpp.o -c /home/filip/Work/llvm-project/mlir/lib/Dialect/Affine/IR/ValueBoundsOpInterfaceImpl.cpp
In file included from /home/filip/Work/llvm-project/mlir/lib/Dialect/Affine/IR/ValueBoundsOpInterfaceImpl.cpp:9:
/home/filip/Work/llvm-project/mlir/include/mlir/Dialect/Affine/IR/ValueBoundsOpInterfaceImpl.h:31:11: error: ‘int64_t’ was not declared in this scope
   31 | FailureOr<int64_t> fullyComposeAndComputeConstantDelta(Value value1,
      |           ^~~~~~~
/home/filip/Work/llvm-project/mlir/include/mlir/Dialect/Affine/IR/ValueBoundsOpInterfaceImpl.h:13:1: note: ‘int64_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
   12 | #include "mlir/Support/LLVM.h"
  +++ |+#include <cstdint>
   13 |
/home/filip/Work/llvm-project/mlir/include/mlir/Dialect/Affine/IR/ValueBoundsOpInterfaceImpl.h:31:18: error: template argument 1 is invalid
   31 | FailureOr<int64_t> fullyComposeAndComputeConstantDelta(Value value1,
      |                  ^
/home/filip/Work/llvm-project/mlir/lib/Dialect/Affine/IR/ValueBoundsOpInterfaceImpl.cpp:107:77: error: ‘llvm::FailureOr<long int> mlir::affine::fullyComposeAndComputeConstantDelta(mlir::Value, mlir::Value)’ should have been declared inside ‘mlir::affine’
  107 | mlir::affine::fullyComposeAndComputeConstantDelta(Value value1, Value value2) {
      |                                                                             ^
/home/filip/Work/llvm-project/mlir/lib/Dialect/Affine/IR/ValueBoundsOpInterfaceImpl.cpp:107:1: error: ambiguating new declaration of ‘llvm::FailureOr<long int> mlir::affine::fullyComposeAndComputeConstantDelta(mlir::Value, mlir::Value)’
  107 | mlir::affine::fullyComposeAndComputeConstantDelta(Value value1, Value value2) {
      | ^~~~
/home/filip/Work/llvm-project/mlir/include/mlir/D

It seems that without the imports I get this error when I try to build. Adding the import, as it is suggested fix the problem

@joker-eph
Copy link
Collaborator

In general, I believe we cherry-pick fixes commits from main instead of rewriting patches directly to the release branch.

@FilipLaurentiu
Copy link
Author

In general, I believe we cherry-pick fixes commits from main instead of rewriting patches directly to the release branch.

Maybe I am wrong, but this is not possible in this situation, it's an old release (19.x) and the main branch is now at a different version (20). It should be a hotfix, but do it the way you see fit 👍 .

@FilipLaurentiu
Copy link
Author

Any updates ?

@jschueller
Copy link
Contributor

jschueller commented May 22, 2025

looks like you would want for #110932 to be backported to 19.x instead
/cc @cjdb

also 101109f and a6bb8a7
/cc @nikic

@nikic
Copy link
Contributor

nikic commented May 22, 2025

The LLVM 19 release is no longer supported. You'll have to apply this as a local patch if you want to build and old LLVM 19 with a new libstdc++.

@nikic nikic closed this May 22, 2025
@FilipLaurentiu
Copy link
Author

The LLVM 19 release is no longer supported. You'll have to apply this as a local patch if you want to build and old LLVM 19 with a new libstdc++.

Some projects still use LLVM 19. I am not an LLVM developer, not even a C++ developer, but I am working on a project that depends on MLIR, unfortunately building this from scratch is anything but easy.

Documentation doesn't help much, and if you found a fix, you should suggest a workaround

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants