Browse Source

build(cmake): bump minimum CMake version to 3.17 and add CUDA driver stub linking

沉默の金 5 tháng trước cách đây
mục cha
commit
bf5823431c
3 tập tin đã thay đổi với 11 bổ sung3 xóa
  1. 9 1
      CMakeLists.txt
  2. 1 1
      README.md
  3. 1 1
      README.zh.md

+ 9 - 1
CMakeLists.txt

@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.16)
+cmake_minimum_required(VERSION 3.17)
 project(mel_band_roformer_cpp VERSION 1.0.0 LANGUAGES CXX)
 
 set(CMAKE_CXX_STANDARD 17)
@@ -82,6 +82,14 @@ target_include_directories(mel_band_roformer PRIVATE
 target_link_libraries(mel_band_roformer PUBLIC ggml)
 if(GGML_CUDA AND TARGET ggml-cuda)
     target_link_libraries(mel_band_roformer PUBLIC ggml-cuda)
+    
+    # Fix for CI: Link against CUDA stubs if the driver is not present
+    # This prevents errors like "libcuda.so.1 needed by ... not found" during linking
+    find_package(CUDAToolkit REQUIRED)
+    if(TARGET CUDA::cuda_driver)
+        target_link_libraries(mel_band_roformer PUBLIC CUDA::cuda_driver)
+        message(STATUS "Linked against CUDA driver stubs")
+    endif()
 endif()
 
 # Compiler options

+ 1 - 1
README.md

@@ -63,7 +63,7 @@ Options:
 
 ### Prerequisites
 
-- CMake >= 3.16
+- CMake >= 3.17
 - C++17 compatible compiler (MSVC 2019+, GCC 9+, Clang 10+)
 - GGML source code (submodule or local directory)
 

+ 1 - 1
README.zh.md

@@ -63,7 +63,7 @@ Mel-Band-Roformer 音频源分离模型的高性能 C++ 推理实现。
 
 ### 前置条件
 
-- CMake >= 3.16
+- CMake >= 3.17
 - C++17 兼容编译器(MSVC 2019+, GCC 9+, Clang 10+)
 - GGML 源码(submodule 或本地目录)