-
Notifications
You must be signed in to change notification settings - Fork 11.7k
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
BUG: build_native_tool does not pass on CMAKE_CXX_STANDARD #60574
Comments
@llvm/issue-subscribers-mlir |
I don't quite get how this happens, the CMakeLists.txt will by default do |
TBH, I don't know myself, but I have the suspicion that it was masked by the fact that on new enough clang (and GCC) the default is already C++17. For various unhappy reasons we're still on clang 14 on osx. |
Ah, from what I can tell, this isn't actually happening in |
You're invoking CMake pointing directly at MLIR? |
Yes.
Can confirm it works with the following patch: diff --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
index f00c819b25..4594b8830e 100644
--- a/mlir/CMakeLists.txt
+++ b/mlir/CMakeLists.txt
@@ -22,6 +22,7 @@ endif()
# Must go below project(..)
include(GNUInstallDirs)
+set(CMAKE_CXX_STANDARD 17)
if(MLIR_STANDALONE_BUILD)
find_package(LLVM CONFIG REQUIRED) |
Thanks for the quick handling! |
Could we get a backport to /cherry-pick 0096d17 |
Failed to cherry-pick: 0096d17 https://github.com/llvm/llvm-project/actions/runs/4120730621 Please manually backport the fix and push it to your github fork. Once this is done, please add a comment like this:
|
/branch h-vetinari/llvm-project/mlir_cxx |
/pull-request llvm/llvm-project-release-prs#284 |
Could we reopen this please until the backport is merged? |
This is only useful when building the project in a "standalone" way: that is by invoking cmake pointing at mlir/ to build against an already built LLVM. Fixes #60574
Trying to build mlir 16.0.0-rc1 in conda-forge, I'm running into the issue that MLIR now requires C++17 to build, but specifying
CMAKE_CXX_STANDARD
to the build does not get respected in cross-compilation.From what I can tell, this happens when invoking
build_native_tool
, which then fails on any compiler that doesn't yet default to C++17.The text was updated successfully, but these errors were encountered: