Closed vchuravy closed 3 months ago
need to add a C++ JLL environment to support this.
maybe we can somehow reuse https://github.com/Gnimuc/ClangCompiler.jl/blob/master/src/platform/system.jl
@vchuravy what LLVM version are you working on?
I tried LLVM16 and it looks like Clang.jl can handle it well.
ok. now I can reproduce the failure in https://github.com/Gnimuc/MLIR.jl/commit/c7b693a7cb194ff55b1efb7211e96ad063d6c9cb
[ 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
patching #432 and #435 works well.
https://github.com/Gnimuc/MLIR.jl/commit/8df3d70b4a5b7fe94ae1f08f628e6079cd53408f
The problem seems to be on processing this file: https://github.com/llvm/llvm-project/blob/main/libcxx/include/__config
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