LLVM error "option ... registered more than once" while loading libtvm.so


Hi. I’ve faced LLVM error in tests after enabling llvm on my machine. Error goes from very early stage of loading libtvm.so library, the exact place is ctype.CDLL call located in python/tvm/_ffi/base.py, executed from any import tvm statement.

The error says

: CommandLine Error: Option 'disable-symbolication' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options

After some googling I’ve found the https://github.com/CastXML/CastXML/issues/102#issuecomment-372488956
discussion suggesting to replace ${LLVM_LIBS} with LLVM in cmake rules. It seems to work in my case. Could anyone who is more familiar with llvm please explain the problem and possibly review the solution?

Note: I’m using latest tvm (cmake-based build system) and llvm-5.0

OpenCL Runtime error

I am using llvm 5.0 and it work fine.
But with llvm4.0 I see some issue then moved to 5.0


Thank you for the reply. I’ve re-checked the issue and it seems that the problem is actual at least for my particular Linux distribution. Below is a patch witch seems to fix it. Thanks.

diff --git a/cmake/modules/LLVM.cmake b/cmake/modules/LLVM.cmake
index 3e896a60..1246efe2 100644
--- a/cmake/modules/LLVM.cmake
+++ b/cmake/modules/LLVM.cmake
@@ -10,7 +10,7 @@ if(NOT USE_LLVM STREQUAL "OFF")
   # Set flags that are only needed for LLVM target
   file(GLOB COMPILER_LLVM_SRCS src/codegen/llvm/*.cc)
   if(NOT MSVC)


Same problem on Manjaro Linux with LLVM 6.0


Marty1885, did my solution help in your case?


Yes it fixes the problem. Thank you! :smiley:


Sent the patch as a pull-request https://github.com/dmlc/tvm/pull/1461