Skip to content

Commit

Permalink
Make CMake library include directory handling more robust. (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
romerojosh authored Apr 20, 2024
1 parent cff5275 commit bfcdffc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ endif()
find_package(NVHPC REQUIRED COMPONENTS CUDA MATH)

# Set up required include directory flags, NVHPC CMake config only defined library directories
string(REPLACE "/lib64" "/include" NVHPC_CUDA_INCLUDE_DIR ${NVHPC_CUDA_LIBRARY_DIR})
string(REPLACE "/lib64" "/include" NVHPC_CUFFT_INCLUDE_DIR ${NVHPC_MATH_LIBRARY_DIR})
string(REPLACE "/lib64" "/include" NVHPC_CUTENSOR_INCLUDE_DIR ${NVHPC_MATH_LIBRARY_DIR})
string(REGEX REPLACE "(.+)(\/lib64)$" "\\1/include" NVHPC_CUDA_INCLUDE_DIR ${NVHPC_CUDA_LIBRARY_DIR})
string(REGEX REPLACE "(.+)(\/lib64)$" "\\1/include" NVHPC_CUFFT_INCLUDE_DIR ${NVHPC_MATH_LIBRARY_DIR})
string(REGEX REPLACE "(.+)(\/lib64)$" "\\1/include" NVHPC_CUTENSOR_INCLUDE_DIR ${NVHPC_MATH_LIBRARY_DIR})

# Get NCCL library (with optional override)
if (CUDECOMP_NCCL_HOME)
Expand All @@ -97,7 +97,7 @@ else()
NAMES nccl
HINTS ${NVHPC_NCCL_LIBRARY_DIR}
)
string(REPLACE "/lib" "/include" NCCL_INCLUDE_DIR ${NVHPC_NCCL_LIBRARY_DIR})
string(REGEX REPLACE "(.+)(\/lib)$" "\\1/include" NCCL_INCLUDE_DIR ${NVHPC_NCCL_LIBRARY_DIR})
endif()

message(STATUS "Using NCCL library: ${NCCL_LIBRARY}")
Expand All @@ -117,7 +117,7 @@ if (CUDECOMP_ENABLE_NVSHMEM)
else()
find_package(NVHPC REQUIRED COMPONENTS NVSHMEM)
set(NVSHMEM_LIBRARY_DIR ${NVHPC_NVSHMEM_LIBRARY_DIR})
string(REPLACE "/lib" "/include" NVSHMEM_INCLUDE_DIR ${NVHPC_NVSHMEM_LIBRARY_DIR})
string(REGEX REPLACE "(.+)(\/lib)$" "\\1/include" NVSHMEM_INCLUDE_DIR ${NVHPC_NVSHMEM_LIBRARY_DIR})
endif()

message(STATUS "Using NVSHMEM installation at: ${NVSHMEM_LIBRARY_DIR}")
Expand Down

0 comments on commit bfcdffc

Please sign in to comment.