LLVM-CONFIG(1)
π LLVM-CONFIG π
okay bestie, sit down, hydrate, because this is the llvm-config page from the LLVM manual (yes, section 1, the good section) and it's literally your new best friend for building stuff against LLVM. π«Ά
β¨ NAME β¨
llvm-config β it prints LLVM compilation options for you. that's the whole job. it's giving personal assistant but for compiler flags. π
πΈ SYNOPSIS πΈ
llvm-config option [components...]
π¦ DESCRIPTION π¦
so here's the vibe: llvm-config makes building applications that use LLVM so much easier, no cap. it can print out the compiler flags, the linker flags, and the object libraries you need to link against LLVM. that's it. that's the whole girl. π
π EXAMPLES π
say you wanna link against the JIT (iconic choice btw), you'd do:
g++ `llvm-config --cxxflags` -o HowToUseJIT.o -c HowToUseJIT.cpp
g++ `llvm-config --ldflags` -o HowToUseJIT HowToUseJIT.o \
`llvm-config --libs engine bcreader scalaropts`
look at that backtick action. we love a command substitution moment. β¨
π OPTIONS π
one bullet per flag, as the universe intended:
--versionβ prints the version number of LLVM. the "who even am i" flag. πͺ-helpβ prints a summary of llvm-config arguments. your lil cheat sheet. π--prefixβ prints the installation prefix for LLVM.--src-rootβ prints the source root from which LLVM was built.--obj-rootβ prints the object root used to build LLVM.--bindirβ prints the installation directory for LLVM binaries.--includedirβ prints the installation directory for LLVM headers.--libdirβ prints the installation directory for LLVM libraries.--cxxflagsβ prints the C++ compiler flags needed to use LLVM headers. these are the "please find my includes" flags. π§--ldflagsβ prints the flags needed to link against LLVM libraries.--libsβ prints all the libraries needed to link against the specified LLVM components, including any dependencies. she's thorough. she does the homework. π--libnamesβ similar to--libs, but prints the bare filenames of the libraries, without-lor pathnames. super useful for linking against a not-yet-installed copy of LLVM. π--libfilesβ similar to--libs, but prints the full path to each library file. this is the one you want when making makefile dependencies, so a tool gets relinked if any library it uses changes. highkey essential. π₯--componentsβ prints all valid component names.--targets-builtβ prints the component names for all targets supported by this copy of LLVM.--build-modeβ prints the build mode used when LLVM was built (e.g. Debug or Release). π
π§ COMPONENTS π§
to print a list of all available components, just run llvm-config --components. easy.
in most cases, components correspond directly to LLVM libraries. but there are some useful "virtual" components too, and they're lowkey the main characters:
allβ includes all LLVM libraries. this is the default if you don't specify any components. (she does everything, no notes. π )backendβ includes either a native backend or the C backend.engineβ includes either a native JIT or the bitcode interpreter.
β EXIT STATUS β
if llvm-config succeeds, it exits with 0. π
otherwise, if an error occurs, it exits with a non-zero value. π
heads up bestie: a non-zero exit means something went wrong β check it in your scripts, fr fr.
π AUTHOR π
maintained by the LLVM Team (https://llvm.org/). they're the parents of this whole situation. π«Ά
π COPYRIGHT π
2003-2024, LLVM Project
and that's the page!! ok bye, this was LLVM llvm-config, manual page version 12, dated 2024-07-18 β slay, periodt, go compile something gorgeous. πβ¨ππ¦πΈπ
π¦ where this page comes from
- fedora 43: llvm12-devel 12.0.1-12.fc41 Β· NCSA
- fedora 43: llvm12-devel 12.0.1-12.fc41 Β· NCSA
- fedora 44: llvm12-devel 12.0.1-12.fc41 Β· NCSA
- fedora 44: llvm12-devel 12.0.1-12.fc41 Β· NCSA
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms