我有这个库,其中一部分依赖于 nvrtc,我正在为此构建示例程序。当我在我自己的机器(Devuan GNU/Linux Beowulf)上构建它们时,一切都很好,使用 CUDA 版本 9.x、10.x 和 11.x(无论如何都是大多数)。但是,当我在 Travis CI 构建机器上执行此操作时(每个人都可能无法访问链接),我收到以下错误:
CMake Error at examples/CMakeLists.txt:48 (add_executable):
Target "vectorAdd_nvrtc" links to target "CUDA::nvrtc" but the target was
not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
这特别奇怪,因为检测到 CUDA 工具包:
-- Found CUDAToolkit: /usr/local/cuda-10.2/include (found version "10.2.89")
我正在通过 .deb 文件安装 nvrtc 库:
CUDA_HOME=/usr/local/cuda-${CUDA_SHORT}
LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${CUDA_HOME}/lib64/stubs:/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH}
PATH=${CUDA_HOME}/bin:${PATH}
CMAKE_ARCHIVE_FILE_BASENAME="cmake-3.17.5-Linux-x86_64"
CMAKE_ARCHIVE_FILENAME="${CMAKE_ARCHIVE_FILE_BASENAME}.tar.gz"
echo "c240abaaa4df5a7441915b3f6ecd636b ${CMAKE_ARCHIVE_FILENAME}" > cmake_md5.txt
travis_retry wget --no-check-certificate https://cmake.org/files/v3.17/${CMAKE_ARCHIVE_FILENAME}
md5sum -c cmake_md5.txt
export DEPS_DIR="$(pwd)/travis-deps/"
mkdir -p "${DEPS_DIR}"
tar xvf ${CMAKE_ARCHIVE_FILENAME} -C "${DEPS_DIR}" > /dev/null
PATH="${DEPS_DIR}/${CMAKE_ARCHIVE_FILE_BASENAME}/bin:$PATH"
mkdir build
cd build; cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=ON ..