LLVM-CONFIG(1)

💖 NAME 💖

okay bestie, welcome to LLVM-CONFIG(1) from the LLVM manual 💖. This page is literally llvm-config — Print LLVM compilation options, and it's giving “tiny tool, main character energy” because it tells you what flags and libs you need to build against LLVM. No cap.


✨ SYNOPSIS ✨

llvm-config option [components…]

🦋 DESCRIPTION 🦋

So llvm-config makes it easier to build applications that use LLVM. It can print the compiler flags, linker flags and object libraries needed to link against LLVM. That's the whole vibe: you ask, it prints, you slay your build. 💅


🌸 EXAMPLES 🌸

okay so the page gives this example — to link against the JIT, 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`

literally copy-paste core, iykyk 🫶


🎀 OPTIONS 🎀

  • –version — prints the version number of LLVM. iconic.
  • -help — prints a summary of llvm-config arguments. lowkey the “what does this thing even do” button.
  • –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. compiler-flags bestie ✨
  • –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. the full group chat, not just the main characters.
  • –libnames — similar to –libs, but prints the bare filenames of the libraries without -l or pathnames. Useful for linking against a not-yet-installed copy of LLVM.
  • –libfiles — similar to –libs, but print the full path to each library file. This is useful when creating makefile dependencies, to ensure that a tool is relinked if any library it uses changes. dependency safety realness 💀
  • –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, run llvm-config –components. In most cases, components correspond directly to LLVM libraries. Useful “virtual” components include:

  • all — includes all LLVM libraries. The default if no components are specified. the “just give me everything” option, periodt.
  • 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 will exit with 0. Otherwise, if an error occurs, it will exit with a non-zero value. so if you see a non-zero, bestie, something went sideways 🙈


👑 AUTHOR 👑

Maintained by the LLVM Team (https://llvm.org/). shoutout the maintainers 🫶


2003-2023, LLVM Project


that's the whole page, bestie 🧚 — LLVM version 13, dated 2023-07-14, and yes, this is the LLVM-CONFIG(1) manual page. slay. 💖

📦 where this page comes from