Skip to content

Commit c280c34

Browse files
committed
fix(unit_tests): find CMake module when building standalone
Signed-off-by: Gabriel Dos Santos <[email protected]>
1 parent f4d2629 commit c280c34

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

.cmake-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
definitions: [./cmake/kokkoscomm_test.cmake]
1+
definitions: [./cmake/kc-test.cmake]
22
line_length: 120
33
list_expansion: favour-inlining
44
indent: 2

cmake/kokkoscomm_test.cmake renamed to cmake/kc-test.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ function(kc_add_unit_test name)
2323
target_link_libraries(${name} PRIVATE NCCL::NCCL)
2424
endif()
2525

26-
add_test(NAME ${name} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${UT_NUM_PES} ${name})
26+
add_test(NAME ${name} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${UT_NUM_PES} ./${name})
2727
endfunction()

unit_tests/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ FetchContent_Declare(
4242
)
4343
FetchContent_MakeAvailable(fmt)
4444

45-
include(kokkoscomm_test)
45+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")
46+
include(kc-test)
4647

4748
# --- Core API unit tests --- #
4849
kc_add_unit_test(test.core.p2p CORE NUM_PES 2 FILES test_main.cpp test_sendrecv.cpp)
@@ -58,12 +59,10 @@ if(KOKKOSCOMM_ENABLE_MPI)
5859
kc_add_unit_test(smoke.mpi.cuda-p2p MPI NUM_PES 2 FILES mpi/test_mpi_cuda_sendrecv.cpp)
5960
# MPICH needs dynamic cudart (we think, pmodels/mpich#7304)
6061
if(KOKKOSCOMM_IMPL_MPI_IS_MPICH)
61-
# gersemi: off
6262
# Setting the CUDA_RUNTIME_LIBRARY property on this target to "Shared" doesn't work for
6363
# reasons I don't understand.
6464
target_compile_options(smoke.mpi.cuda-p2p PUBLIC --cudart shared)
6565
target_link_options(smoke.mpi.cuda-p2p PUBLIC --cudart shared)
66-
# gersemi: on
6766
endif()
6867
endif()
6968

0 commit comments

Comments
 (0)