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

Troubles parsing a C++ project with Clang.jl v0.18.0 and julia v1.11 (llvm 16) #482

Open
giordano opened this issue Apr 9, 2024 · 6 comments

Comments

@giordano
Copy link
Contributor

giordano commented Apr 9, 2024

I'm having troubles parsing a C++ project with Clang.jl v0.18.0 and julia v1.11 (which uses llvm16). To be clear, my current parsing script works fine with same version of Clang.jl but using julia v1.7-v1.10 (llvm from 12 to 15). This may be related to #470.

My parsing script is at https://github.com/JuliaIPU/IPUToolkit.jl/blob/dca1f4d514a4f8184967da10b5b2b7e6919d8789/deps/generate_wrapper.jl (@Gnimuc contributed to it before 🙂), getting the files to parse is a bit complicated, but there's a docker container you can use (graphcore/poplar:3.3.0-ubuntu-20.04-20230703), but it's possible the parsing script just has to be updated (although, again, it's working fine with other versions of julia/llvm).

For reference, I'm attaching below the diff of a couple of files generated by the parsing script
gen_inherit.cpp.patch.txt
gen_inline.cpp.patch.txt

@Gnimuc
Copy link
Member

Gnimuc commented Apr 9, 2024

Julia 1.11 uses llvm16 and there are some breaking changes introduced in llvm16/clang16(see #465).

As IPUToolkit.jl maintains its own C++ parsing script, we should upgrade the script to be compatible with clang16.

@giordano
Copy link
Contributor Author

giordano commented Apr 9, 2024

I had a look at the 0.18 changelog (I was very glad to see it!) but the only breaking change mentioned didn't look relevant, that's why I opened the issue 🙂

@Gnimuc
Copy link
Member

Gnimuc commented Apr 9, 2024

Those breaking changes are from clang internals. We(mainly contributed by @JamesWrigley) only write changelogs for Clang.jl.

It may take a little longer to fix issues related to clang internal changes, you may need to pin Clang.jl to v0.17.x before it gets fixed.

@giordano
Copy link
Contributor Author

giordano commented Apr 9, 2024

you may need to pin Clang.jl to v0.17.x before it gets fixed.

Do I need to do that? Clang.jl v0.18 seems to work fine with Julia v1.9-1.10 (llvm 14-15), only problem is Julia v1.11 (llvm 16).

@Gnimuc
Copy link
Member

Gnimuc commented Apr 10, 2024

You're right. It's safe until Julia v1.1 is released. But if you're only using Clang.jl for generating bindings, it should be ok to remove it as a dependency.

@giordano
Copy link
Contributor Author

But if you're only using Clang.jl for generating bindings, it should be ok to remove it as a dependency.

I wish I could do that, bu the problem is that I have no other way to generate the bindings to start with 🙂

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

No branches or pull requests

2 participants