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.