Skip to content

[BUILD] Improve CMake to allow specify llvm-config #1200

Closed

Description

@sergei-grechanik

Hello, I'm trying to build tvm with LLVM support. I use LLVM 6.0 from Ubuntu 18.04. However, after
building tvm and importing it in python I get the following:

$ export LD_LIBRARY_PATH=/path-to-tvm-build-dir/:$LD_LIBRARY_PATH
$ export PYTHONPATH=/path-to-tvm-src-dir/python:${PYTHONPATH}
$ python -c 'import tvm'
: CommandLine Error: Option 'help-list' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options

After googling for a little while I found out that this problem comes from linking against llvm libs
twice. And indeed, while building tvm's .so files, it links against a bunch of libLLVMBlahBlah.a
files and also against libLLVM-6.0.so.1. Manually removing the latter seems to fix the problem. A quick and dirty workaround is to put list(REMOVE_ITEM LLVM_LIBS LLVM) after
llvm_map_components_to_libnames(LLVM_LIBS all) in CMakeLists.txt. (Actually, there is already a
line removing LTO from the same list, not sure what it is, may be another workaround?)

Honestly, I'm not sure what would be a proper workaround, may be calling the llvm-config
executable.

Activity

  1. tqchen commented on May 31, 2018

    @tqchen
    Member

    Hmm, it seems that the CMake module for find LLVM is not functioning properly. Maybe we will need a customized version of CMake that calls llvm-config and also allows optional specification of llvm-config

  2. tqchen commented on May 31, 2018

    @tqchen
    Member

    We did that in Makefile version of build

  3. changed the title [-]LLVM ERROR: inconsistency in registered CommandLine options[/-] [+][BUILD] Improve CMake to allow specify llvm-config[/+] on May 31, 2018
  4. tqchen commented on Jun 11, 2018

    @tqchen
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions