diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index ffc7ba12b2..0e7e29a9a8 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -74,13 +74,16 @@ if(KvikIO_CUDA_SUPPORT) include(cmake/thirdparty/get_nvtx.cmake) endif() -if(NOT cuFile_FOUND) +if(NOT TARGET CUDA::cuFile) + set(cuFile_FOUND 0) message( WARNING "Cannot find cuFile - KvikIO will still work but won't use GPUDirect Storage (GDS)" ) else() + set(cuFile_FOUND 1) + # Check batch and stream API support (cuFile_BATCH_API_FOUND and cuFile_STREAM_API_FOUND) - file(READ "${cuFile_INCLUDE_DIRS}/cufile.h" CUFILE_H_STR) + file(READ "${CUDAToolkit_INCLUDE_DIRS}/cufile.h" CUFILE_H_STR) string(FIND "${CUFILE_H_STR}" "cuFileBatchIOSetUp" cuFileBatchIOSetUp_location) if(cuFileBatchIOSetUp_location EQUAL "-1") set(cuFile_BATCH_API_FOUND FALSE) @@ -128,7 +131,7 @@ target_include_directories( target_link_libraries( kvikio PUBLIC Threads::Threads BS::thread_pool ${CMAKE_DL_LIBS} $ - $:CUDA::cudart>> $ + $:CUDA::cudart>> $> PRIVATE $ )