Download GTest if not found in system (#237)
Co-authored-by: Stanley Tsang <stanley.tsang@amd.com>
Этот коммит содержится в:
@@ -5,19 +5,8 @@ if(BUILD_TESTS)
|
||||
|
||||
message("Going to build unit tests (Installed in /test/UnitTests)")
|
||||
|
||||
# chrpath is required to properly set rpath for the UnitTests executable
|
||||
find_program(CHRPATH chrpath)
|
||||
if(NOT CHRPATH)
|
||||
message(FATAL_ERROR "chrpath is required for UnitTests. Please install (e.g. sudo apt-get install chrpath)")
|
||||
endif()
|
||||
|
||||
find_package(GTest REQUIRED)
|
||||
if (NOT GTest_FOUND)
|
||||
message(FATAL_ERROR "Please ensure GTest is installed on the system")
|
||||
endif()
|
||||
|
||||
include_directories(${GTEST_INCLUDE_DIR})
|
||||
|
||||
include_directories(${GTEST_INCLUDE_DIRS})
|
||||
|
||||
# Collect source files for tests
|
||||
set(TEST_SOURCES
|
||||
test_AllGather.cpp
|
||||
@@ -31,12 +20,12 @@ if(BUILD_TESTS)
|
||||
test_BroadcastAbort.cpp
|
||||
test_Scatter.cpp
|
||||
test_Gather.cpp
|
||||
test_AllToAll.cpp
|
||||
test_AllToAll.cpp
|
||||
)
|
||||
|
||||
add_executable(UnitTests ${TEST_SOURCES})
|
||||
target_include_directories(UnitTests PRIVATE /opt/rocm)
|
||||
target_link_libraries(UnitTests PRIVATE ${GTEST_LIBRARY} ${GTEST_MAIN_LIBRARY} PRIVATE rccl)
|
||||
target_include_directories(UnitTests PRIVATE /opt/rocm ${GTEST_INCLUDE_DIRS})
|
||||
target_link_libraries(UnitTests PRIVATE ${GTEST_BOTH_LIBRARIES} PRIVATE rccl)
|
||||
else()
|
||||
message("Not building unit tests")
|
||||
endif()
|
||||
|
||||
Ссылка в новой задаче
Block a user