dex-lang icon indicating copy to clipboard operation
dex-lang copied to clipboard

Building Dex on Fedora 36 (clang++-14)

Open darrenjw opened this issue 3 years ago • 4 comments

Fedora 36 contains a package which provides clang++-14, but no longer includes one that provides clang++-12. Is it easy/possible to build Dex on Fedora, or more generally, with clang++-14?

darrenjw avatar Sep 10 '22 17:09 darrenjw

clang++-14 might work, but it's likely it won't. The main reason for this is that we use clang to generate some LLVM IR that we later read in the compiler. If the clang version is newer than whatever LLVM you used to build Dex (pretty much always 12), then it might fail if the IR has been extended since then.

I actually have a branch where I'm adding support for LLVM 15. It's freshly released, so it might take a few weeks before packages appear in most popular repositories, but it should give you the cutting edge support (in that case you might even be able to use clang++-14, not just clang++-15).

apaszke avatar Sep 12 '22 09:09 apaszke

Thanks. I tried hacking the makefile to allow building with clang++-14. It did build an executable, but it crashed at runtime. In the end I built clang-12 from the official release sources. This was simpler than I expected, but very slow. That works fine, but it's good to know that newer clang support is on the way.

darrenjw avatar Sep 12 '22 09:09 darrenjw

Yes, I would expect it to crash at runtime. The only rule that depends on the clang version is the one for src/lib/dexrt.bc. You might even be able to copy that file from another computer where you do have an older clang version, but that might be an overkill given that you've already built clang form source 😅

apaszke avatar Sep 12 '22 09:09 apaszke

Just adding to this. I tried building/installing dex with clang++-14 (by modifying the makefile) as well as I am on Ubuntu 22.04 which doesn't come with clang++-12 either and it failed when building the llvm-hs-12.0.0 package. Will just download the old clang++-12 but I would +1 enabling newer clang versions. Clang 16 is newest as of this posting.

codereport avatar Jul 21 '23 15:07 codereport