Skip to content
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

Compile mlir-jl-tblgen with Clang from LLVM_full_jll #58

Closed
wants to merge 1 commit into from
Closed

Compile mlir-jl-tblgen with Clang from LLVM_full_jll #58

wants to merge 1 commit into from

Conversation

mofeing
Copy link
Member

@mofeing mofeing commented Feb 9, 2024

I'm getting the following error in macOS:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/Users/mofeing/.julia/artifacts/43c5f915b23163ac6d25e7754f68cfc1ff50d375/include -Wall -fPIC -fno-rtti -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -std=gnu++17 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk -mmacosx-version-min=14.1   -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -MD -MT CMakeFiles/mlir-jl-tblgen.dir/jl-generators.cc.o -MF CMakeFiles/mlir-jl-tblgen.dir/jl-generators.cc.o.d -o CMakeFiles/mlir-jl-tblgen.dir/jl-generators.cc.o -c /Users/mofeing/Developer/MLIR.jl/deps/tblgen/jl-generators.cc

...

/Users/mofeing/Developer/MLIR.jl/deps/tblgen/jl-generators.cc:39:10: fatal error: 'mlir/TableGen/Class.h' file not found
#include "mlir/TableGen/Class.h"
         ^~~~~~~~~~~~~~~~~~~~~~~
2 warnings and 1 error generated.
make[2]: *** [CMakeFiles/mlir-jl-tblgen.dir/jl-generators.cc.o] Error 1
make[1]: *** [CMakeFiles/mlir-jl-tblgen.dir/all] Error 2
make: *** [all] Error 2

The reason is that it's using Apple Clang for compilation but Apple LLVM doesn't have MLIR.

This PR forces to compile with Clang from LLVM_full_jll.

@mofeing mofeing marked this pull request as ready for review February 9, 2024 10:40
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b065747) 3.24% compared to head (b37e1ad) 3.26%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff            @@
##            main     #58      +/-   ##
========================================
+ Coverage   3.24%   3.26%   +0.01%     
========================================
  Files        107     107              
  Lines      26059   26061       +2     
========================================
+ Hits         845     850       +5     
+ Misses     25214   25211       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vchuravy
Copy link
Collaborator

vchuravy commented Feb 9, 2024

The reason is that it's using Apple Clang for compilation but Apple LLVM doesn't have MLIR.

That seems like the wrong reason. We set up the include path so that the host compiler can find the headers. I use GCC to compile this locally

@mofeing
Copy link
Member Author

mofeing commented Feb 9, 2024

The problem was solved magically. I guess there was some corruption in my Manifest.toml file because I used Julia 1.7 before. It works well on Julia 1.10.

@mofeing mofeing closed this Feb 9, 2024
@mofeing mofeing deleted the fix-tblgen-build-on-macos branch February 9, 2024 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants