Closed cgeoga closed 5 months ago
Since the Clang plugins is not necessary for Julia and bandwidth use might be precious to the user we intentionally disable the ClangPlugin in our recipe.
You could use https://github.com/EnzymeAD/Enzyme.jl/blob/main/deps/build_local.jl to build a new version with the ClangPlugin enabled.
Caveat emptor. The LLVM build used here is only validated for Julia and we do not provide any guarantees or support for using it to build C/C++ code with it.
It does exist and is provided in spack,brew, etc packages.
Building Enzyme from source will build it by default if your llvm installation also built clang (but not if you don't have clang, since we need to build it against clang). If you explicitly request it to be built and Clang is not available build will fail.
In this case Julia just doesn't build it.
Amazing, thank you both.
Re: the caveat emptor, though, is this just a bad idea? Would I be better off just figuring out the LLVM+Clang source build -> Enzyme source build?
is this just a bad idea?
It's a medium bad idea, which you know is pretty good in the grand scheme of things.
There have recently been request for a Conda setup and there is Spack which we tend to recommend.
Overall I am hesitant with recommending it as a general solution.
Hah. I appreciate your candor. If Spack is your recommendation, I'll look into that and hold off on a docs PR somewhere until I have a handle on how to do that.
Thanks again for the help on this! I'm going to close the issue, but let me know if it should stay open and I'll reopen it.
I'll give a slightly differing viewpoint, I actually think the homebrew packages are easier (the homebrew team updates them within days every Enzyme release, whereas spack may have a longer delay to have a new version added).
Whereas spack may have longer delay to have a new version added
Yeah but that is up to us, since we are the Spack maintainers.
Homebrew is limiting in its OS support.
Indeed, relatedly we should figure out how to get our enzyme bot to automate it for us
I have some C code I want to differentiate, and it seems like one of the easier ways to use Enzyme to do that is to use the artifacts from
LLVM_full_jll.jl
andEnzyme_jll.jl
to set that up. I have set up a little bash function following the getting started docs for this that works on an Ubuntu LTS machine:But: The docs mention passing the clang plugin
ClangEnzyme-vXXX.so
, and indicate that it is preferable to do this instead of the more manual process above. But I can't find that*.so
file anywhere. When I build Enzyme from source with Julia's LLVM following the Enzyme.jl developer docs (using the official binary), I don't get aClangEnzyme-vXXX.so
anywhere. And I don't see it anywhere in the jll artifacts either. Does that tool still exist?Also: If there is some easier way to set up Enzyme for C code, I would love to hear it. I would rather not build LLVM from source---I can't even
git clone
that repository! It seems likeEnzyme.jl
's packaging has already kindly done all the hard work of managing versions and stuff. But maybe I'm missing a more elegant option.Once this is sorted out I'm very happy to make a PR to the docs explaining this stuff! Thanks so much in advance.