llvm-config-16(1)

Print LLVM compilation options

Section 1 llvm-16 bookworm source

Description

LLVM-CONFIG

NAME

llvm-config - Print LLVM compilation options

SYNOPSIS

llvm-config option [componentsâ¦]

DESCRIPTION

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.

EXAMPLES

To link against the JIT:

g++ `llvm-config --cxxflags` -o HowToUseJIT.o -c HowToUseJIT.cpp
g++ `llvm-config --ldflags` -o HowToUseJIT HowToUseJIT.o \
`llvm-config --libs engine bcreader scalaropts`

OPTIONS

âassertion-mode

Print the assertion mode used when LLVM was built (ON or OFF).

âbindir

Print the installation directory for LLVM binaries.

âbuild-mode

Print the build mode used when LLVM was built (e.g. Debug or Release).

âbuild-system

Print the build system used to build LLVM (e.g. cmake or gn).

âcflags

Print the C compiler flags needed to use LLVM headers.

âcmakedir

Print the installation directory for LLVM CMake modules.

âcomponents

Print all valid component names.

âcppflags

Print the C preprocessor flags needed to use LLVM headers.

âcxxflags

Print the C++ compiler flags needed to use LLVM headers.

âhas-rtti

Print whether or not LLVM was built with rtti (YES or NO).

âhelp

Print a summary of llvm-config arguments.

âhost-target

Print the target triple used to configure LLVM.

âignore-libllvm

Ignore libLLVM and link component libraries instead.

âincludedir

Print the installation directory for LLVM headers.

âldflags

Print the flags needed to link against LLVM libraries.

âlibdir

Print the installation directory for LLVM libraries.

â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.

â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.

âlibs

Print all the libraries needed to link against the specified LLVM components, including any dependencies.

âlink-shared

Link the components as shared libraries.

âlink-static

Link the component libraries statically.

âobj-root

Print the object root used to build LLVM.

âprefix

Print the installation prefix for LLVM.

âshared-mode

Print how the provided components can be collectively linked (shared or static).

âsystem-libs

Print all the system libraries needed to link against the specified LLVM components, including any dependencies.

âtargets-built

Print the component names for all targets supported by this copy of LLVM.

âversion

Print the version number of LLVM.

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.

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.

AUTHOR

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

COPYRIGHT

2003-2023, LLVM Project