apache / tvm

Open deep learning compiler stack for cpu, gpu and specialized accelerators
https://tvm.apache.org/
Apache License 2.0
11.78k stars 3.47k forks source link

[Bug] Default installation has LLVM errors #17492

Open MehdiTantaoui-99 opened 2 weeks ago

MehdiTantaoui-99 commented 2 weeks ago

I installed tvm like instructed here: https://tvm.apache.org/docs/install/from_source.html

Once I run the test :

python -c "import tvm; print(tvm.__file__)"

Expected behavior

/home/ubuntu/tvm/python/tvm/__init__.py

Actual behavior

[13:07:34] /home/ubuntu/tvm/src/target/llvm/llvm_instance.cc:226: Error: Using LLVM 19.1.2 with `-mcpu=apple-latest` is not valid in `-mtriple=arm64-apple-macos`, using default `-mcpu=generic`
[13:07:34] /home/ubuntu/tvm/src/target/llvm/llvm_instance.cc:226: Error: Using LLVM 19.1.2 with `-mcpu=apple-latest` is not valid in `-mtriple=arm64-apple-macos`, using default `-mcpu=generic`
[13:07:34] /home/ubuntu/tvm/src/target/llvm/llvm_instance.cc:226: Error: Using LLVM 19.1.2 with `-mcpu=apple-latest` is not valid in `-mtriple=arm64-apple-macos`, using default `-mcpu=generic`
/home/ubuntu/tvm/python/tvm/__init__.py

Environment

PRETTY_NAME="Ubuntu 22.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.5 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

Steps to reproduce

Follow step on : https://tvm.apache.org/docs/install/from_source.html

youngwayfarer commented 2 weeks ago

I've met the same problem as well. Have you resolved it?

MehdiTantaoui-99 commented 2 weeks ago

I found a solution. You have to setup the LLVM config before compiling the library:

cd tvm/build/
vi config.cmake

Set set(USE_LLVM llvm-config) in the config.cmake file. Then run:

cmake ..
make -j$(nproc)

This solved the issue for me.

youngwayfarer commented 2 weeks ago

I found a solution. You have to setup the LLVM config before compiling the library:

cd tvm/build/
vi config.cmake

Set set(USE_LLVM llvm-config) in the config.cmake file. Then run:

cmake ..
make -j$(nproc)

This solved the issue for me.

Thanks!!! I'll try.

youngwayfarer commented 2 weeks ago

I found a solution. You have to setup the LLVM config before compiling the library:

cd tvm/build/
vi config.cmake

Set set(USE_LLVM llvm-config) in the config.cmake file. Then run:

cmake ..
make -j$(nproc)

This solved the issue for me.

I'm sorry, but I have a few more questions. According to https://tvm.apache.org/docs/install/from_source.html, I need to execute the "echo "set(USE_LLVM \"llvm-config --ignore-libllvm --link-static\")" >> config.cmake" command,. Do you mean changing this command to "echo "set(USE_LLVM llvm-config)" >> config.cmake"? I have done this, but the problems above remain.