Score:4

How to install Clang 16 on 22.04 LTS

sz flag

I have 22.04 LTS but I'd like to install a later Clang, version 16.

How can I install this?

(22.04 doesn't come with Clang 16 in the repos)

UPDATE

Whilst I appreciate the answer below, I found a much simpler way from here:

https://askubuntu.com/a/1415641/132414 https://apt.llvm.org/

To install a specific version of LLVM:
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh <version number>
Score:1
sy flag

Cland 16 has pre-build packages available to download at its github releases page.

In the case, you can select download the clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz package for modern pc and laptop.

It's a non-install package, just extract it in your file manager, right-click on the bin sub-folder and select 'Open in Terminal'. Then run any executable file to compile your programs, such as ./clang-16 -x c++ .....

For any errors like below:

error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory

Search the key file (libtinfo.so.5 in the case) in packages.ubuntu.com under "Search the contents of packages" section. Then install the corresponding package (libtinfo5 in the case).

And, if you use Clang 16 frequently, then you can add the 'bin' into PATH. So, you don't have to navigate to that folder every time running clang-16 executable. There are quite a few tutorials talking about it. Here's one that I made.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.