mlc-ai / mlc-llm

Universal LLM Deployment Engine with ML Compilation
https://llm.mlc.ai/
Apache License 2.0
19.19k stars 1.58k forks source link

[Question] CMake Error at /mnt/f/mlc-llm/CMakeLists.txt:65 (add_subdirectory) #2209

Closed Moon-Ahn closed 6 months ago

Moon-Ahn commented 6 months ago

❓ General Questions

-- Configuring incomplete, errors occurred!
(mlc) root@DESKTOP-K53JBNI:/mnt/f/mlc-llm/android/library# git submodule update --init --recursive
(mlc) root@DESKTOP-K53JBNI:/mnt/f/mlc-llm/android/library# ./prepare_libs.sh
+ rustup target add aarch64-linux-android
info: component 'rust-std' for target 'aarch64-linux-android' is up to date
+ mkdir -p build/model_lib
+ python3 prepare_model_lib.py
Creating lib from ['/mnt/f/mlc-llm/dist/prebuilt_libs/phi_2_q4f16_1/phi_2_ko_v1_q4f16_1-android.tar', '/mnt/f/mlc-llm/dist/prebuilt_libs/mistral_q4f16_1/mistral_q4f16_1-android.tar']..
Validating the library build/model_lib/libmodel_android.a...
List of available model libs packaged: ['phi_q4f16_1', 'mistral_q4f16_1'], if we have '-' in the model_lib string, it will be turned into '_'
Validation pass
+ cd build
+ touch config.cmake
+ '[' /mnt/f/mlc-llm/3rdparty/tvm/include/tvm/runtime -ne 0 ']'
./prepare_libs.sh: line 12: [: /mnt/f/mlc-llm/3rdparty/tvm/include/tvm/runtime: integer expression expected
+ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/mnt/f/Android_sdk/ndk/android-ndk-r25c/build/cmake/android.toolchain.cmake -DCMAKE_INSTALL_PREFIX=. -DCMAKE_CXX_FLAGS=-O3 -DANDROID_ABI=arm64-v8a -DANDROID_NATIVE_API_LEVEL=android-24 -DANDROID_PLATFORM=android-24 -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON -DANDROID_STL=c++_static -DUSE_HEXAGON_SDK=OFF -DMLC_LLM_INSTALL_STATIC_LIB=ON -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON -DUSE_OPENCL=ON -DUSE_CUSTOM_LOGGING=ON
-- Hide private symbols
-- TVM_HOME: /mnt/f/mlc-llm/3rdparty/tvm/include/tvm/runtime
CMake Error at /mnt/f/mlc-llm/CMakeLists.txt:65 (add_subdirectory):
  The source directory

    /mnt/f/mlc-llm/3rdparty/tvm/include/tvm/runtime

  does not contain a CMakeLists.txt file.

-- system-nameAndroid
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- VERSION: 0.2.00
CMake Error at /mnt/f/mlc-llm/CMakeLists.txt:72 (tvm_file_glob):
  Unknown CMake command "tvm_file_glob".

The error above occurs after updating the git of mlc-llm.

However, I have no idea how to resolve this. Please provide me with a solution and ideas.

Moon-Ahn commented 6 months ago

I found a problem.

https://llm.mlc.ai/docs/deploy/android.html#

The link requested 'export TVM_HOME=... #TVM Unityruntime', but this is not how it should be set.

It should be set to 'TVM_HOME = mlc-llm\3rdparty\tvm'. I would appreciate it if you could revise it. @MasterJH5574

MasterJH5574 commented 6 months ago

Thank you @Moon-Ahn for reporting.

The link requested 'export TVM_HOME=... #TVM Unityruntime', but this is not how it should be set.

I'm still trying to understand what you described. Could you point me the exact position where the documentation page does this export?

Moon-Ahn commented 6 months ago

@MasterJH5574

https://llm.mlc.ai/docs/deploy/android.html#

TVM_HOME so that its headers are available under $TVM_HOME/include/tvm/runtime.

export TVM_HOME=...     # TVM Unity runtime

From the two settings, I think the user can be confused.

In fact, in my previous version of mlc-llm, I set it to 'TVM_HOME = mlc-llm/3rdparty/tvm/include/tvm/runtime' and it worked fine.

I got an error after updating the mlc-llm version, and I fixed the issue by changing the configuration to 'TVM_HOME = mlc-llm_path/3rdparty/tvm/'.

If the information I gave you is incorrect, please ignore it. Thank you.