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

Binding generation for MLIR fails due to C++ being present #470

Closed
vchuravy opened this issue Feb 7, 2024 · 6 comments
Closed

Binding generation for MLIR fails due to C++ being present #470

vchuravy opened this issue Feb 7, 2024 · 6 comments

Comments

@vchuravy
Copy link
Collaborator

vchuravy commented Feb 7, 2024

I currently don't have time to push this forward but the binding generator in https://github.com/JuliaLabs/MLIR.jl currently runs on top off #435 If I recall the issue the MLIR headers contain some C++ code that make generation fail.

@mofeing could you isolate some examples of what is failing here and maybe @Gnimuc has an idea on how to fix this properly instead of my hobbled together approach in #435

@Gnimuc
Copy link
Member

Gnimuc commented Apr 6, 2024

need to add a C++ JLL environment to support this.

@Gnimuc
Copy link
Member

Gnimuc commented Apr 6, 2024

@Gnimuc
Copy link
Member

Gnimuc commented Apr 7, 2024

@vchuravy what LLVM version are you working on?

I tried LLVM16 and it looks like Clang.jl can handle it well.

Gnimuc/MLIR.jl@17cb4e6#diff-4eb27dac28b031df3cf7f13beb5184b4d51541faf3a375b9b7704f97f545d9cc

@Gnimuc
Copy link
Member

Gnimuc commented Apr 7, 2024

ok. now I can reproduce the failure in Gnimuc/MLIR.jl@c7b693a

[ Info: Processing header: /Users/gnimuc/.julia/artifacts/83a18f414eae212b19fdc137a4fcbd9982fc7ac4/include/mlir-c/BuiltinAttributes.h
 Clang.CLNamespace std
   Clang.CLNamespace __1
ERROR: LoadError: No support for code at /Users/gnimuc/.julia/artifacts/fbb170fa64a06b66dd9a16aaa21bf12848042d9a/aarch64-apple-darwin20/sys-root/usr/include/c++/v1/__config:817:1, please file an issue to Clang.jl.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] collect_top_level_nodes!(nodes::Vector{ExprNode}, cursor::Clang.CLNamespace, options::Dict{String, Any})
   @ Clang.Generators ~/.julia/dev/Clang/src/generator/top_level.jl:10
 [3] (::CollectTopLevelNode)(dag::ExprDAG, options::Dict{String, Any})
   @ Clang.Generators ~/.julia/dev/Clang/src/generator/passes.jl:0
 [4] build!(ctx::Context, stage::Clang.Generators.BuildStage)
   @ Clang.Generators ~/.julia/dev/Clang/src/generator/context.jl:176
 [5] top-level scope
   @ ~/.julia/dev/MLIR/bindings/make.jl:168
 [6] include(fname::String)
   @ Main ./sysimg.jl:38
 [7] top-level scope
   @ REPL[6]:1
in expression starting at /Users/gnimuc/.julia/dev/MLIR/bindings/make.jl:168

@Gnimuc
Copy link
Member

Gnimuc commented Apr 7, 2024

patching #432 and #435 works well.

Gnimuc/MLIR.jl@8df3d70

@mofeing
Copy link

mofeing commented Apr 7, 2024

The problem seems to be on processing this file: https://github.com/llvm/llvm-project/blob/main/libcxx/include/__config

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

No branches or pull requests

3 participants