25 lines
1.3 KiB
Markdown
25 lines
1.3 KiB
Markdown
---
|
|
title: "Clang"
|
|
category: "Languages and runtimes"
|
|
tagline: "The LLVM compiler for C, C++ and Objective-C, alongside Arch's standard build tools."
|
|
source: "pacman"
|
|
package: "clang"
|
|
command: "clang"
|
|
website: "https://clang.llvm.org/"
|
|
code: "https://github.com/llvm/llvm-project"
|
|
---
|
|
|
|
## What it is
|
|
|
|
Clang is a compiler for C, C++ and Objective-C, part of the LLVM project. It turns source code into programs, with clear error messages and fast compiles, and comes with tools such as `clang-format` for formatting code and `clang-tidy` for finding bugs. It's the default compiler on macOS and is used to build Chrome and Firefox.
|
|
|
|
## Why it's here
|
|
|
|
- **Readable errors.** Its messages point to the exact spot and often suggest the fix.
|
|
- **Needed for builds.** Some software compiles only with Clang, or needs its libraries.
|
|
- **Code tools.** Formatting and static analysis for C and C++ projects.
|
|
|
|
## On CoreDesktop
|
|
|
|
Clang is installed from pacman. CoreDesktop includes it, with [CMake](/software/cmake/), because Hermes Agent's Matrix support builds a library that needs `clang++`. CoreDesktop also installs `base-devel`, Arch's group of build tools: GCC, make, pkgconf and the rest of what's needed to compile software and build AUR packages. `update` keeps them all current with the rest of the pacman packages.
|