Problem building TVM

I checked out the TVM repo yesterday and ran into a build error (branch main):

Scanning dependencies of target tvm_runtime
[ 38%] Linking CXX shared library libtvm_runtime.so
ld.lld: error: unknown argument '-force_load’
clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [CMakeFiles/tvm_runtime.dir/build.make:181: libtvm_runtime.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:1186: CMakeFiles/tvm_runtime.dir/all] Error 2

In my config.cmake I turned on USE_LLVM, USE_NNPACK, USE_MICRO, and USE_MICRO_STANDALONE_RUNTIME. I thought it might be LLVM version issue, but the same error occurs with LLVM 14.0.0 (prebuilt) and 15.0.0git (llvm-project). My cmake version is 3.16.3.

1 Like

Hi, I came cross the same crash. How did you solve it?

Could you please use older LLVM (like llvm 10.0 or 12.0) and try again?

Thanks for your kind reply, problem solved!

This crash may be caused by the wrong 3rd-libs version in 3rdparty directory. Due to the bad network connection of my PC, the command git clone --recursive failed to download 3rd-libs. Therefore, I redownloaded the failed 3rd-lib manually, which leads to the build failure.

Thanks again!