6
编译器
onnxruntime编译问题
2025-09-16 20:18:16
176
直接拉取git上的onnxruntime,使用下面操作进行编译失败 `git clone https://github.com/microsoft/onnxruntime cd onnxruntime git checkout v1.15.0 git submodule update --init --recursive` 编译命令 ./build.sh --config Release --parallel 32 --build_wheel --use_rocm --rocm_home "/opt/dtk-25.04.1" --skip-keras-test --skip_tests 错误日志 2025-09-16 19:52:07,082 tools_python_utils [INFO] - flatbuffers module is not installed. parse_config will not be available get hyhal driver version error! open comgr lib:libamd_comgr.so error load comgr library error load library error 2025-09-16 19:52:09,097 build [DEBUG] - Command line arguments: --build_dir /home/test/onnxruntime/build/Linux --config Release --parallel 32 --build_wheel --use_rocm --rocm_home /opt/dtk-25.04.1 --skip-keras-test --skip_tests 2025-09-16 19:52:09,103 build [DEBUG] - Defaulting to running update, build [and test for native builds]. rocm_home = /opt/dtk-25.04.1 2025-09-16 19:52:09,104 build [INFO] - Build started 2025-09-16 19:52:09,104 util.run [INFO] - Running subprocess in '/home/test/onnxruntime' git submodule sync --recursive Synchronizing submodule url for 'cmake/external/eigen' Synchronizing submodule url for 'cmake/external/emsdk' Synchronizing submodule url for 'cmake/external/libprotobuf-mutator' Synchronizing submodule url for 'cmake/external/onnx' Synchronizing submodule url for 'cmake/external/onnx/third_party/benchmark' Synchronizing submodule url for 'cmake/external/onnx/third_party/pybind11' Synchronizing submodule url for 'cmake/external/onnxruntime-extensions' 2025-09-16 19:52:09,173 util.run [DEBUG] - Subprocess completed. Return code: 0 2025-09-16 19:52:09,173 util.run [INFO] - Running subprocess in '/home/test/onnxruntime' git submodule update --init --recursive 2025-09-16 19:52:09,365 util.run [DEBUG] - Subprocess completed. Return code: 0 2025-09-16 19:52:09,365 build [INFO] - Generating CMake build tree 2025-09-16 19:52:09,365 util.run [INFO] - Running subprocess in '/home/test/onnxruntime/build/Linux/Release' /home/test/cmake-3.27.0/install/bin/cmake /home/test/onnxruntime/cmake -Donnxruntime_RUN_ONNX_TESTS=OFF -Donnxruntime_GENERATE_TEST_REPORTS=ON -DPython_EXECUTABLE=/root/anaconda3/envs/py311/bin/python3 -DPYTHON_EXECUTABLE=/root/anaconda3/envs/py311/bin/python3 -Donnxruntime_USE_MIMALLOC=OFF -Donnxruntime_ENABLE_PYTHON=ON -Donnxruntime_BUILD_CSHARP=OFF -Donnxruntime_BUILD_JAVA=OFF -Donnxruntime_BUILD_NODEJS=OFF -Donnxruntime_BUILD_OBJC=OFF -Donnxruntime_BUILD_SHARED_LIB=OFF -Donnxruntime_BUILD_APPLE_FRAMEWORK=OFF -Donnxruntime_USE_DNNL=OFF -Donnxruntime_USE_NNAPI_BUILTIN=OFF -Donnxruntime_USE_RKNPU=OFF -Donnxruntime_USE_LLVM=OFF -Donnxruntime_ENABLE_MICROSOFT_INTERNAL=OFF -Donnxruntime_USE_VITISAI=OFF -Donnxruntime_USE_TENSORRT=OFF -Donnxruntime_USE_TENSORRT_BUILTIN_PARSER=ON -Donnxruntime_USE_TVM=OFF -Donnxruntime_TVM_CUDA_RUNTIME=OFF -Donnxruntime_TVM_USE_HASH=OFF -Donnxruntime_USE_MIGRAPHX=OFF -Donnxruntime_DISABLE_CONTRIB_OPS=OFF -Donnxruntime_DISABLE_ML_OPS=OFF -Donnxruntime_DISABLE_RTTI=OFF -Donnxruntime_DISABLE_EXCEPTIONS=OFF -Donnxruntime_MINIMAL_BUILD=OFF -Donnxruntime_EXTENDED_MINIMAL_BUILD=OFF -Donnxruntime_MINIMAL_BUILD_CUSTOM_OPS=OFF -Donnxruntime_REDUCED_OPS_BUILD=OFF -Donnxruntime_ENABLE_LANGUAGE_INTEROP_OPS=OFF -Donnxruntime_USE_DML=OFF -Donnxruntime_USE_WINML=OFF -Donnxruntime_BUILD_MS_EXPERIMENTAL_OPS=OFF -Donnxruntime_USE_TELEMETRY=OFF -Donnxruntime_ENABLE_LTO=OFF -Donnxruntime_USE_ACL=OFF -Donnxruntime_USE_ACL_1902=OFF -Donnxruntime_USE_ACL_1905=OFF -Donnxruntime_USE_ACL_1908=OFF -Donnxruntime_USE_ACL_2002=OFF -Donnxruntime_USE_ARMNN=OFF -Donnxruntime_ARMNN_RELU_USE_CPU=ON -Donnxruntime_ARMNN_BN_USE_CPU=ON -Donnxruntime_USE_JSEP=OFF -Donnxruntime_ENABLE_NVTX_PROFILE=OFF -Donnxruntime_ENABLE_TRAINING=OFF -Donnxruntime_ENABLE_TRAINING_OPS=OFF -Donnxruntime_ENABLE_TRAINING_APIS=OFF -Donnxruntime_ENABLE_CPU_FP16_OPS=OFF -Donnxruntime_USE_NCCL=OFF -Donnxruntime_BUILD_BENCHMARKS=OFF -Donnxruntime_USE_ROCM=ON -DOnnxruntime_GCOV_COVERAGE=OFF -Donnxruntime_USE_MPI=OFF -Donnxruntime_ENABLE_MEMORY_PROFILE=OFF -Donnxruntime_ENABLE_CUDA_LINE_NUMBER_INFO=OFF -Donnxruntime_BUILD_WEBASSEMBLY=OFF -Donnxruntime_BUILD_WEBASSEMBLY_STATIC_LIB=OFF -Donnxruntime_ENABLE_WEBASSEMBLY_EXCEPTION_CATCHING=ON -Donnxruntime_ENABLE_WEBASSEMBLY_API_EXCEPTION_CATCHING=OFF -Donnxruntime_ENABLE_WEBASSEMBLY_EXCEPTION_THROWING=ON -Donnxruntime_WEBASSEMBLY_RUN_TESTS_IN_BROWSER=OFF -Donnxruntime_ENABLE_WEBASSEMBLY_THREADS=OFF -Donnxruntime_ENABLE_WEBASSEMBLY_DEBUG_INFO=OFF -Donnxruntime_ENABLE_WEBASSEMBLY_PROFILING=OFF -Donnxruntime_ENABLE_LAZY_TENSOR=OFF -Donnxruntime_ENABLE_EXTERNAL_CUSTOM_OP_SCHEMAS=OFF -Donnxruntime_ENABLE_CUDA_PROFILING=OFF -Donnxruntime_ENABLE_ROCM_PROFILING=OFF -Donnxruntime_USE_XNNPACK=OFF -Donnxruntime_USE_CANN=OFF -Donnxruntime_ROCM_HOME=/opt/dtk-25.04.1 -Donnxruntime_ROCM_VERSION= -DCMAKE_TLS_VERIFY=ON -DFETCHCONTENT_QUIET=OFF -Donnxruntime_PYBIND_EXPORT_OPSCHEMA=OFF -Donnxruntime_ENABLE_MEMLEAK_CHECKER=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/home/test/onnxruntime/build/Linux/Release/installed CMake Deprecation Warning at CMakeLists.txt:21 (cmake_policy): The OLD behavior for policy CMP0104 will be removed from a future version of CMake. The cmake-policies(7) manual explains that the OLD behaviors of all policies are deprecated and that a policy should be set to OLD only under specific short-term circumstances. Projects should be ported to the NEW behavior and not rely on setting a policy to OLD. CMake Warning (dev) at CMakeLists.txt:52 (include): Policy CMP0145 is not set: The Dart and FindDart modules are removed. Run "cmake --help-policy CMP0145" for policy details. Use the cmake_policy command to set the policy and suppress this warning. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at /home/test/cmake-3.27.0/install/share/cmake-3.27/Modules/Dart.cmake:47 (message): Policy CMP0145 is not set: The Dart and FindDart modules are removed. Run "cmake --help-policy CMP0145" for policy details. Use the cmake_policy command to set the policy and suppress this warning. Call Stack (most recent call first): CMakeLists.txt:52 (include) This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at /home/test/cmake-3.27.0/install/share/cmake-3.27/Modules/Dart.cmake:57 (find_package): Policy CMP0144 is not set: find_package uses upper-case _ROOT variables. Run "cmake --help-policy CMP0144" for policy details. Use the cmake_policy command to set the policy and suppress this warning. For compatibility, find_package is ignoring the variable, but code in a .cmake module might still use it. Call Stack (most recent call first): CMakeLists.txt:52 (include) This warning is for project developers. Use -Wno-dev to suppress it. ***** ROCm version from /opt/dtk-25.04.1/.info/version-dev **** ROCM_VERSION_DEV: ROCM_VERSION_DEV_MAJOR: ROCM_VERSION_DEV_MINOR: ROCM_VERSION_DEV_PATCH: ROCM_VERSION_DEV_INT: ***** HIP LANGUAGE CONFIG INFO **** CMAKE_HIP_COMPILER: /opt/dtk-25.04.1/llvm/bin/clang++ CMAKE_HIP_ARCHITECTURES: gfx906;gfx908;gfx90a;gfx1030 CMAKE_HIP_FLAGS: CMAKE_HIP_FLAGS_RELEASE: -O3 -DNDEBUG CMake Warning at CMakeLists.txt:321 (message): composable kernel is only supported on ROCm >= 5.3 Building ONNX Runtime for x86_64 Patch found: /usr/bin/patch -- Could NOT find Python (missing: Development.Module NumPy) (found suitable version "3.11.9", minimum required is "3.8") Loading Dependencies URLs ... Loading Dependencies ... -- Populating abseil_cpp -- Configuring done (0.0s) -- Generating done (0.0s) -- Build files have been written to: /home/test/onnxruntime/build/Linux/Release/_deps/abseil_cpp-subbuild /usr/bin/gmake: relocation error: /usr/lib64/libguile-2.0.so.22: symbol ffi_type_uint32 version LIBFFI_BASE_7.0 not defined in file libffi.so.7 with link time reference CMake Error at /home/test/cmake-3.27.0/install/share/cmake-3.27/Modules/FetchContent.cmake:1662 (message): Build step for abseil_cpp failed: 127 Call Stack (most recent call first): /home/test/cmake-3.27.0/install/share/cmake-3.27/Modules/FetchContent.cmake:1802:EVAL:2 (__FetchContent_directPopulate) /home/test/cmake-3.27.0/install/share/cmake-3.27/Modules/FetchContent.cmake:1802 (cmake_language) external/helper_functions.cmake:139 (FetchContent_Populate) external/abseil-cpp.cmake:27 (onnxruntime_fetchcontent_makeavailable) external/onnxruntime_external_deps.cmake:23 (include) CMakeLists.txt:510 (include) -- Configuring incomplete, errors occurred! Traceback (most recent call last): File "/home/test/onnxruntime/tools/ci_build/build.py", line 2599, in sys.exit(main()) ^^^^^^ File "/home/test/onnxruntime/tools/ci_build/build.py", line 2460, in main generate_build_tree( File "/home/test/onnxruntime/tools/ci_build/build.py", line 1369, in generate_build_tree run_subprocess( File "/home/test/onnxruntime/tools/ci_build/build.py", line 781, in run_subprocess return run(*args, cwd=cwd, capture_stdout=capture_stdout, shell=shell, env=my_env) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/test/onnxruntime/tools/python/util/run.py", line 49, in run completed_process = subprocess.run( ^^^^^^^^^^^^^^^ File "/root/anaconda3/envs/py311/lib/python3.11/subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args,
全部评论(4)
只看楼主
X
xingh
1楼
我们提供了ort的whl包,可以直接pip安装https://download.sourcefind.cn:65024/4/main/onnxruntime
2025/9/17
张
张
回复 @xingh
你好,感谢指导哈,我需要在arm+dcu的平台进行onnxruntime的编译,以及自定义算子的添加,所以需要通过源码进行编译,官方提供的只有x86的软件包
2025/9/17
X
xingh
回复 @张
直接编译github上的包需要使用fastpt进行不转码移植
2025/9/17
张
张
回复 @xingh
请问下这个有编译的教程么?
2025/10/18
没有更多内容了
--
楼主
Level.3
0 帖子
楼主热帖
暂无数据