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
Answer from maxschlepzig on Stack ExchangeYou 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
c++ - How to install and use just Clang-Format on Fedora 27? - Stack Overflow
how to properly install clang on Linux?
software installation - How to install the latest stable Clang on Fedora? - 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?
» pip install clang-tidy
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?
I don't think there is a really easy way to do this today, here are some details:
- clang comes installed on macOS and is the default compiler, but it does not come installed with clang-format or clang-tidy (or possibly any of the extra tools).
- It's really easy to use brew to install clang-format if you want it:
brew install clang-format - There is no clang-tidy brew formula.
As a result it seems like the best way to get clang-tidy on macOS is to simply install all of llvm and then make symlinks for the tools you want to use.
brew install llvm
ln -s "$(brew --prefix llvm)/bin/clang-format" "/usr/local/bin/clang-format"
ln -s "$(brew --prefix llvm)/bin/clang-tidy" "/usr/local/bin/clang-tidy"
ln -s "$(brew --prefix llvm)/bin/clang-apply-replacements" "/usr/local/bin/clang-apply-replacements"
Alternatively, you could download the prebuilt binaries and create the same symlinks. It's not a good idea to add all of llvm to your PATH because of conflicts with the default clang compiler.
- Run
brew install llvm - Export the
clang-tidybin to yourPATH. If you havezsh, addexport PATH="/opt/homebrew/opt/llvm/bin:$PATH"to your.zshrcfile. - Restart your terminal.