LLVM-CONFIG(1)

πŸ’– NAME πŸ’–

llvm-config β€” it prints LLVM compilation options, and honestly? It's the little helper that makes linking against LLVM not a whole nightmare. Welcome to the LLVM-CONFIG(1) era, bestie. 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

llvm-config option [components…]

✨ DESCRIPTION ✨

okay so, llvm-config exists to make building applications that use LLVM so much easier. Like, it's giving personal assistant energy. πŸ’…

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 job. And it ate. πŸ”₯


🌈 EXAMPLES 🌈

Say you wanna link against the JIT. Bestie, here's the move:

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 those backticks doing their little shell substitution dance. Iconic. ✨


πŸŽ€ OPTIONS πŸŽ€

okay so here's the full menu, no skips, no skimming, we're listing everything:

  • --version β€” prints the version number of LLVM.
  • -help β€” prints a lil summary of the llvm-config arguments, for when you forgot what you were doing (real).
  • --prefix β€” prints the installation prefix for LLVM.
  • --src-root β€” prints the source root that LLVM was built from.
  • --obj-root β€” prints the object root that was 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 you need to use LLVM headers.
  • --ldflags β€” prints the flags you need to link against LLVM libraries.
  • --libs β€” prints all the libraries you need to link against the LLVM components you specified, dependencies included. It does the whole dependency tree for you, no cap. πŸ‘‘
  • --libnames β€” basically --libs's sibling, but it prints the bare filenames of the libraries, with no -l and no pathnames. Perfect when you're linking against a not-yet-installed copy of LLVM.
  • --libfiles β€” again like --libs, but it prints the full path to each library file. This one's your bestie when you're writing makefile dependencies, because it makes sure a tool gets relinked if any library it uses changes. Obsessed. πŸ’–
  • --components β€” prints all valid component names.
  • --targets-built β€” prints the component names for every target this copy of LLVM supports.
  • --build-mode β€” prints the build mode that was used when LLVM was built (like Debug or Release).

🧚 COMPONENTS 🧚

Wanna see every available component? Just run llvm-config --components and let it spill. In most cases, components line up directly with LLVM libraries.

But there are also some useful β€œvirtual” components, and these ones are lowkey the main characters:

  • all β€” includes all LLVM libraries. This is the default if you don't specify any components at all.
  • 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. Slay.

Otherwise, if an error happens, it exits with a non-zero value. Not slay. 😭


🌸 AUTHOR 🌸

Maintained by the LLVM Team (https://llvm.org/). They're the parents fr fr.


2003-2025, LLVM Project


okay that's the whole page, bestie πŸŽ€ that was the LLVM-CONFIG(1) manual, page 14, dated 2025-05-22, straight from LLVM. go forth and link things. periodt. πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from