[SOLVED] Can’t build TVM with LLVM


I have tried many times to build TVM with LLVM but always failed.
I did follow the instructions to build,downloaded pre-built version of LLVM(8.0.0).
Then I modify build/config.cmake to add set(USE_LLVM ON).
But when I input this command: cmake -G “Visual Studio 15 2017 Win64” -DCMAKE_BUILD_TYPE=Release -DCMAKE_CONFIGURATION_TYPES=“Release” …
it says can’t find file llvm-config.

Could not find a package configuration file provided by “LLVM” with any of
the following names:


Add the installation prefix of “LLVM” to CMAKE_PREFIX_PATH or set
“LLVM_DIR” to a directory containing one of the above files. If “LLVM”
provides a separate development package or SDK, be sure it has been
Call Stack (most recent call first):
cmake/modules/LLVM.cmake:22 (find_llvm)
CMakeLists.txt:193 (include)

– Configuring incomplete, errors occurred!

I have no idea how to fix it. If someone knows about it please give me a reply,thank you!


Hey could you try set USE_LLVM to be the exact path to llvm-config?


Try USE_LLVM your_llvm_path instead of USE_LLVM ON


yeah,thank you very much!


Could you show me your llvm_path?
I set the comand like set(USE_LLVM “C:/Program Files/LLVM/bin”) , but it did not work


should be C:/Program Files/LLVM/bin/llvm-config


But I can’t find the “llvm-config” file in path C:/Program Files/LLVM/bin/llvm-config


I find words in the install toturial saying: “In order to build with LLVM in windows, you will need to build LLVM from source. You need to run build the nnvm by running the same script under the nnvm folder.”

Now I am confused.


You should build llvm from source on Windows. Then you should find llvm-config.


You build the LLVM from source in windows???


see https://github.com/dmlc/tvm/issues/611


I got it. Thanks a lot .