完整日志:
1CMake Warning (dev) at /root/miniconda3/share/cmake-4.1/Modules/FetchContent.cmake:1373 (message): 2 The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is 3 not set. The policy's OLD behavior will be used. When using a URL 4 download, the timestamps of extracted files should preferably be that of 5 the time of extraction, otherwise code that depends on the extracted 6 contents might not be rebuilt if the URL changes. The OLD behavior 7 preserves the timestamps from the archive instead, but this is usually not 8 what you want. Update your project to the NEW behavior or specify the 9 DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this 10 robustness issue. 11Call Stack (most recent call first): 12 cmake/gflags.cmake:1 (FetchContent_Declare) 13 cmake/openfst.cmake:2 (include) 14 CMakeLists.txt:44 (include) 15This warning is for project developers. Use -Wno-dev to suppress it. 16 17-- Populating gflags 18-- Configuring done (0.3s) 19-- Generating done (0.0s) 20-- Build files have been written to: /root/autodl-tmp/wenet/runtime/libtorch/fc_base/gflags-subbuild 21[100%] Built target gflags-populate 22CMake Error at fc_base/gflags-src/CMakeLists.txt:73 (cmake_minimum_required): 23 Compatibility with CMake < 3.5 has been removed from CMake. 24 25 Update the VERSION argument <min> value. Or, use the <min>...<max> syntax 26 to tell CMake that the project requires at least <min> but has been updated 27 to work with policies introduced by <max> or earlier. 28 29 Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway. 30 31 32-- Configuring incomplete, errors occurred! 33
在构建 wenet runtime 时报错,如上。
构建命令为:
1mkdir build && cd build && cmake .. && cmake --build . 2
构建命令指定版本即可解决:
1cmake -version 2# cmake version 4.1.2 3
1mkdir build && cd build && cmake -DCMAKE_POLICY_VERSION_MINIMUM=4.1.2 .. && cmake --build . 2
需要将原本的 build 目录删了
1... 2[ 91%] Linking CXX executable label_checker_main 3[ 91%] Built target label_checker_main 4[ 93%] Building CXX object bin/CMakeFiles/api_main.dir/api_main.cc.o 5[ 94%] Linking CXX executable api_main 6[ 94%] Built target api_main 7[ 95%] Building CXX object bin/CMakeFiles/websocket_client_main.dir/websocket_client_main.cc.o 8[ 97%] Linking CXX executable websocket_client_main 9[ 97%] Built target websocket_client_main 10[ 98%] Building CXX object bin/CMakeFiles/websocket_server_main.dir/websocket_server_main.cc.o 11[100%] Linking CXX executable websocket_server_main 12[100%] Built target websocket_server_main 13
《CMake Error at fc_base/gflags-src/CMakeLists.txt:73》 是转载文章,点击查看原文。
