mlc-ai / mlc-llm

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

[Bug] Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) #2541

Closed panghongtao closed 3 weeks ago

panghongtao commented 1 month ago

🐛 Bug

execute mlc_llm package

my win10 System cmake --version is 3.29.4

set ANDROID_NDK D:/Users/W9057210.ADC/AppData/Local/Android/Sdk/ndk/25.2.9519653 set TVM_NDK_CC %ANDROID_NDK%/toolchains/llvm/prebuilt/windows-x86_64/bin/aarch64-linux-android24-clang

Tis NDK version 25.2

Is this a path or a version error?

To Reproduce

[2024-06-07 17:22:48] INFO prepare_libs.py:90: Entering "E:\project\mlc-llm\android\MLCChat\build" for MLC LLM and tvm4j build. [2024-06-07 17:22:48] INFO prepare_libs.py:94: Set TVM_SOURCE_DIR to "E:/project/mlc-llm/3rdparty/tvm" [2024-06-07 17:22:48] INFO prepare_libs.py:22: Running cmake [2024-06-07 17:22:48] INFO prepare_libs.py:48: Using ninja in windows, make sure you installed ninja in conda -- Hide private symbols -- TVM_SOURCE_DIR: E:/project/mlc-llm/3rdparty/tvm -- Hide private symbols... -- Forbidding undefined symbols in shared library, using -Wl,--no-undefined on platform Android -- Building for Android -- Didn't find the path to CCACHE, disabling ccache -- Performing Test SUPPORT_CXX17 -- Performing Test SUPPORT_CXX17 - Success -- VTA build with VTA_HW_PATH=E:/project/mlc-llm/3rdparty/tvm/3rdparty/vta-hw -- Build VTA runtime with target: sim -- Enabled runtime search for OpenCL library location -- Couldn't build OpenCL-Gtests -- Android Vulkan_INCLUDE_DIRS=D:/Users/W9057210.ADC/AppData/Local/Android/Sdk/ndk/25.2.9519653/sources/third_party/vulkan/src/include -- Skip finding SPIRV in Android, make sure you only build tvm runtime. -- Build with contrib.random -- Build with contrib.sort -- Build with contrib.hybriddump -- Git found: C:/ProgramData/anaconda3/Library/bin/git.exe -- Found TVM_GIT_COMMIT_HASH=f5f048bbd71513f087799f987019e3931f68a6d9 -- Found TVM_GIT_COMMIT_TIME=2024-06-03 09:18:53 -0400 -- Building with TVM Map... -- Build with thread support... -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- Check if compiler accepts -pthread -- Check if compiler accepts -pthread - yes -- Found Threads: TRUE -- CLANG_VERSION 14.0 -- Setting enhanced clang warning flags -- Performing Test FILE_PREFIX_MAP_SUPPORTED -- Performing Test FILE_PREFIX_MAP_SUPPORTED - Success -- Build without FlashInfer -- system-nameAndroid CMake Deprecation Warning at E:/project/mlc-llm/3rdparty/tokenizers-cpp/msgpack/CMakeLists.txt:1 (CMAKE_MINIMUM_REQUIRED): Compatibility with CMake < 3.5 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) CMake Deprecation Warning at E:/project/mlc-llm/3rdparty/tokenizers-cpp/sentencepiece/CMakeLists.txt:15 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

-- VERSION: 0.2.00 -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - not found CMake Warning at E:/project/mlc-llm/CMakeLists.txt:107 (message): Cannot find libflash_attn. The model must not have been built with --use-flash-attn-mqa option.

-- TVM_SOURCE_DIR: E:/project/mlc-llm/android/mlc4j/../../3rdparty/tvm CMake Error at C:/ProgramData/anaconda3/Library/share/cmake-3.29/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find Java (missing: Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE Java_JAVAH_EXECUTABLE Java_JAVADOC_EXECUTABLE) (found version "1.8.0.331") Call Stack (most recent call first): C:/ProgramData/anaconda3/Library/share/cmake-3.29/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE) C:/ProgramData/anaconda3/Library/share/cmake-3.29/Modules/FindJava.cmake:326 (find_package_handle_standard_args) CMakeLists.txt:18 (find_package)

-- Configuring incomplete, errors occurred! Traceback (most recent call last): File "E:\project\mlc-llm\android\mlc4j\prepare_libs.py", line 117, in main(parsed.mlc_llm_source_dir) File "E:\project\mlc-llm\android\mlc4j\prepare_libs.py", line 99, in main run_cmake(mlc_llm_source_dir / "android" / "mlc4j") File "E:\project\mlc-llm\android\mlc4j\prepare_libs.py", line 50, in run_cmake subprocess.run(cmd, check=True, env=os.environ) File "C:\ProgramData\anaconda3\Lib\subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['cmake', 'E:\project\mlc-llm\android\mlc4j', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_TOOLCHAIN_FILE=D:\Users\W9057210.ADC\AppData\Local\Android\Sdk\ndk\25.2.9519653\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_OPENCL_ENABLE_HOST_PTR=ON', '-DUSE_CUSTOM_LOGGING=ON', '-G', 'Ninja']' returned non-zero exit status 1. Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "C:\ProgramData\anaconda3\Scripts\mlc_llm.exe__main__.py", line 7, in File "C:\ProgramData\anaconda3\Lib\site-packages\mlc_llm__main__.py", line 53, in main cli.main(sys.argv[2:]) File "C:\ProgramData\anaconda3\Lib\site-packages\mlc_llm\cli\package.py", line 64, in main package( File "C:\ProgramData\anaconda3\Lib\site-packages\mlc_llm\interface\package.py", line 361, in package build_android_binding(mlc_llm_source_dir, output) File "C:\ProgramData\anaconda3\Lib\site-packages\mlc_llm\interface\package.py", line 275, in build_android_binding subprocess.run([sys.executable, mlc4j_path / "prepare_libs.py"], check=True, env=os.environ) File "C:\ProgramData\anaconda3\Lib\subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['C:\ProgramData\anaconda3\python.exe', WindowsPath('E:/project/mlc-llm/android/mlc4j/prepare_libs.py')]' returned non-zero exit status 1.

Expected behavior

tqchen commented 1 month ago

It complains about cannot find Java. Please follow the instructions in the Android sdk doc windows to set Java home correctly and make sure Java path to be in a folder that do not contain space

tqchen commented 1 month ago

https://llm.mlc.ai/docs/deploy/android.html#additional-guides-for-windows-users

panghongtao commented 3 weeks ago

https://llm.mlc.ai/docs/deploy/android.html#additional-guides-for-windows-users

I have found the reason for this problem. I changed the JDK address when this error occurred. But this error still occurs. You need to delete the android/MLCChat/build folder. Reuse the mlc_llm package. Because changing the JDK path does not update the information in the android/MLCChat/build build folder. so delete this folder reuse mlc_llm package is ok

MasterJH5574 commented 3 weeks ago

Glad that it works out finally. We will consider adding a package “clean” option and update the docs in the future.