Cannot build TVM on Ubuntu

I’m trying to build TVM from source following the official document. https://tvm.apache.org/docs/install/from_source.html

However, I failed many times because of USE_LLVM. I found this question which is similar to mine, but people said use USE_LLVM path/to/your/llvm-config.

I did this but still failed.

Error log.

-- Hide private symbols...
-- Forbidding undefined symbols in shared library, using -Wl,--no-undefined on platform Linux
-- Build with RPC support...
-- Build with Graph Executor support...
-- Build with profiler...
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
-- VTA build with VTA_HW_PATH=/home/ubuntu/workspace/tvm/3rdparty/vta-hw
-- Build VTA runtime with target: sim
-- Use llvm-config=./llvm/bin/llvm-config --link-static
./llvm/bin/llvm-config: 5: Syntax error: Unterminated quoted string
CMake Error at cmake/utils/FindLLVM.cmake:76 (message):
  Fatal error executing: ./llvm/bin/llvm-config --link-static --libfiles
Call Stack (most recent call first):
  cmake/modules/LLVM.cmake:31 (find_llvm)
  CMakeLists.txt:429 (include)


-- Configuring incomplete, errors occurred!
See also "/home/ubuntu/workspace/tvm/build/CMakeFiles/CMakeOutput.log".


As for my build/config.cmake, I just added the two lines below:

set(USE_LLVM "./llvm/bin/llvm-config --link-static")
set(HIDE_PRIVATE_SYMBOLS ON)

llvm-config is located here.

Inked無題_LI

So the value I set to USE_LLVM was ok wasn’t it?

Could anyone help me fix this problem?

Hi @sho, just a simple suggestion. Can you try pointing llvm-config with the full absolute path, rather than a relative path, and see what happens?

Thanks for answering my question.

The syntax error disappered, but I still got the CMake Error in cmake/utils/FindLLVM.cmake.

Interesting. Can you provide the the llvm-config version and also the TVM revision you are using?

To get the llvm-config version:

llvm-config --version

To get TVM revision:

git rev-parse HEAD

Thank you for your answer!

When I tried this, I found that it’s extension is .exe, which is not for linux. Sorry for my simple mistake, but I downloaded the llvm for ubuntu and finally it worked.

I was downloading llvm for windows somehow maybe?

No worries @sho. I’m happy the problem is solved now!

I agree with you and I think it is likely you got the Windows version of LLVM, which was not expected to work in this case. If you have any further issues, let us know :+1:.

Can you rename this topic and put a “[SOLVED]” prefix?

Ok, thank you for your support! Could you tell me how to rename my post? I cannot find where to click to rename the title…