Linux

  1. Extract the tar.xz format file into the final destination. In this guide the ~\community\clang path is used. Also suggested to rename the long folder name to indicate only the version, in this case v19.1.6.

    1. Use the following command to extract the downloaded file where the tar.xz file is located.

      tar xf LLVM-19.1.6-Linux-X64.tar.xz -C ~/community/clang/
    2. Use the following command to rename the directory at location ~/community/clang

       mv LLVM-19.1.6-Linux-X64/ v19.1.6/
  2. Add directory which included the clang-tidy to the $PATH environment variable.

    This step is needed in order to be able to use only the clang-tidy command. Without this the full path of the tool shall be used, like ~/community/clang/v19.1.6/bin/clang-tidy.

    Use the following command to append the necessary path to the $PATH environment variable.

    export PATH=~/community/clang/v19.1.6/bin/:$PATH
  3. Check the installation by using the command below.

    clang-tidy --version

    The following message should be displayed.

    LLVM (http://llvm.org/):
      LLVM version 19.1.6
      Optimized build.