Hi @vfdff
The minimum required version currently is set to 6.0 .
LLVM is a fast changing library and TVM is trying to keep pace with it’s frequent API changes, and tries to mantain a backword compatibility from the latest available one down to older 6.0 (currently).
TVM currently uses LLVM versions 10 & 17 in it’s CI build systems.
It is encouraged to use latest LLVM , like they currently are 19 or 20, e.g. on personal side I use 20.
If you have multiple concurrent LLVM installations on your system, make sure none of their headers is within the main system path (like i.e. /usr/include/llvm/, but on something more private to each other) then you can just pick the desired version for TVM compilation by e.g. -DUSE_LLVM=llvm-config-19
I give an example of a multi LLVM installation:
$ rpm -qa | grep llvm | grep devel
llvm21-devel-21.0.0-20250506.0.gitc6c2e210.fc43.x86_64
llvm18-devel-18.1.8-6.fc42.x86_64
llvm17-devel-17.0.6-9.fc41.x86_64
llvm-devel-20.1.3-1.fc43.x86_64
$ dirname `rpm -ql llvm21-devel | grep include | head -1`
/usr/lib64/llvm21/include/
$ dirname `rpm -ql llvm18-devel | grep include | head -1`
/usr/lib64/llvm18/include/
$ dirname `rpm -ql llvm17-devel | grep include | head -1`
/usr/lib64/llvm17/include/
$ dirname `rpm -ql llvm-devel | grep include | head -1`
/usr/include <-- WILL interfere
The llvm-devel
package is not good here, it will interfere with the others and should be removed (e.g. rpm -e llvm-devel
) or replaced from this generic edition to a privatized variant.
As you can see headers are /usr/lib64/llvm{XX}/include/
which is has no system wide availability , thus the -DUSE_LLVM=llvm-config-XX
will select and work properly without interfering with other versions.
Example here is on a Fedora system, same should be followed either by manual compiling own versions of LLVMs (but with proper flags for changing the default header paths), or other mainstream distribution packages.