Just build the Fedora37 package of clang locally :)
Install mock, add your user to the mock group, go to the RPM source page, i.e., https://src.fedoraproject.org/rpms/clang , click on clang-15 for F37, get the clang-15.0.0-2.fc37.src.rpm , and tell mock to build it in a container for your target architecture (assuming that is x86_64):
mock --config /etc/mock/fedora-36-x86_64.cfg --rebuild clang-15.0.0-2.fc37.src.rpm
Make yourself a coffee or two, and install the resulting rpms from the target directory you'll see at the very end of a successful run. (Hint: use cd /path/to/the/binary/rpms; sudo dnf install ./rpm1.rpm ./rpm2.rpm … to install them, satisfying dependencies as needed. You will need to install clang, libllvm and so on from that directory at once, to let dnf satisfy the dependencies.)
how to properly install clang on Linux?
How to downgrade clang on fedora linux.
ubuntu - clang-tidy install - Unix & Linux Stack Exchange
Installing clang-format for use in VS Code
I'm new to clang. I am a GCC guy. I use Fedora. How should I install the latest version of clang and its dependencies on my system? What command should I run? Which packages should be installed in order to be able to build a basic C++ program which also has static linkage? Just run sudo dnf install clang? Anything else?
I have started to use fedora, and I need to use clang, but however the one installed through the terminal in too updated. It's version 14 and i need version 12.
Ideally I want version: 'clang-12.0.1-1.fc34'.
I have tried 'sudo dnf downgrade clang'. but this only changes it down to the base 14 version and won't downgrade any further.
Apologies if this is the wrong sub reddit. Is there a way of downgrading clang?
You can use your package manager to find out which package clang-tidy provides. For example on Fedora/CentOS:
dnf whatprovides '*/clang*tidy*'
On Debian/Ubuntu you can use an analogous apt-file search command.
However, on Fedora 23 clang-tidy just isn't packaged. No match is found.
There is even an open bug report: Missing clang-query and clang-tidy
For Ubuntu/Debian, the LLVM project maintains an llvm apt repostiory. This should be the easiest way to get the latest clang-tidy. After configuring that repository and doing an apt-file update and apt-file search should return the package that provides clang-tidy.
An alternative to building from source is to use the upstream llvm pre-built binaries - they are available for Fedora, CentOS etc. For example the one for Fedora 23 does contain clang-tidy:
clang+llvm-3.8.0-x86_64-fedora23/bin/clang-tidy
Fedora 29 includes clang-tidy in the main Fedora repository. You can install it via:
dnf install clang-tools-extra