Using the `opt` from Julia's LLVM?

Hi all—

This may be a bit of a weird one, but I’m looking for a way to use the opt from Julia’s LLVM on some *.ll files. The “why” is that I am compiling Enzyme with Julia’s LLVM following the dev docs here, which is much more pleasant than building LLVM from source and then building Enzyme against that. But as the usage docs here suggest, you need to use the same LLVM you built Enzyme with (and I can confirm things crash when you don’t, at least for my specific machine/distro/whatever).

I have to imagine I’m missing something obvious that I should be finding with grep/rg or find/fd in ~/.julia/, but unfortunately the three characters opt come up a fair amount everywhere and I haven’t been able to find the right opt needle in the haystack. If anybody has any pointers here I would greatly appreciate it.

If what I’m asking for isn’t possible, I would be very curious to hear about other people who build Enzyme against Julia’s LLVM and then differentiate C code with that Enzyme build.

Thanks in advance!

There is a jll that provides the opt. You can either use LLVM_jll or LLVM_full_jll.

Those both should have opt available from.


Hi Valentin—thanks so much! I have this working and will submit a PR to the docs relevant docs to spell out the process for the next folks who want to try it.