Skip to content

[Bug] Build Error: too many arguments to function 'const llvm::StringMap<bool, llvm::MallocAllocator> llvm::sys::getHostCPUFeatures()' #325

Description

@shyeonn

Expected behavior

Successful build tvm

Actual behavior

/mlc-llm/3rdparty/tvm/src/target/llvm/codegen_llvm.cc: In lambda function:
/mlc-llm/3rdparty/tvm/src/target/llvm/codegen_llvm.cc:2329:40: error: too many arguments to function 'const llvm::StringMap<bool, llvm::MallocAllocator> llvm::sys::getHostCPUFeatures()'
2329 | if (llvm::sys::getHostCPUFeatures(features)) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
In file included from /mlc-llm/3rdparty/tvm/src/target/llvm/codegen_llvm.cc:77:
/root/miniconda3/envs/tvm-build-venv/include/llvm/TargetParser/Host.h:55:42: note: declared here
55 | const StringMap<bool, MallocAllocator> getHostCPUFeatures();
| ^~~~~~~~~~~~~~~~~~
/mlc-llm/3rdparty/tvm/src/target/llvm/codegen_llvm.cc:2329:40: error: could not convert 'llvm::sys::getHostCPUFeatures()()' from 'const llvm::StringMap<bool, llvm::MallocAllocator>' to 'bool'
2329 | if (llvm::sys::getHostCPUFeatures(features)) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
| |
| const llvm::StringMap<bool, llvm::MallocAllocator>

Environment

When using LLVM version 19.1.0, occur the error

Solution

I changed LLVM version to 18, and the error disappeared.
I think installation docs have to specify use LLVM < =18 or fix this bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions