Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
297 changes: 15 additions & 282 deletions CMakeLists.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cmake/BuildInfo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
function(setup_build_info)
message(STATUS "Setting up build information...")

include(cmake/CollectBuildInfoVars.cmake)
include(${PROJECT_SOURCE_DIR}/cmake/CollectBuildInfoVars.cmake)

set(BUILD_INFO_TEMPLATE "${CMAKE_SOURCE_DIR}/source/source_io/build_info.h.in")
set(BUILD_INFO_OUTPUT "${CMAKE_BINARY_DIR}/source/source_io/build_info.h")
Expand Down
5 changes: 1 addition & 4 deletions cmake/SetupCuBlasMp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

include_guard(GLOBAL)

function(abacus_setup_cublasmp target_name)
function(abacus_setup_cublasmp)
abacus_add_feature_definitions(__CUBLASMP)

# 1. Search for cuBLASMp library and header files
Expand Down Expand Up @@ -72,7 +72,4 @@ function(abacus_setup_cublasmp target_name)
INTERFACE_INCLUDE_DIRECTORIES "${CUBLASMP_INCLUDE_DIR}")
endif()

# 5. Propagate library usage requirements to all ABACUS targets.
target_link_libraries(abacus_external_deps INTERFACE cublasMp::cublasMp)

endfunction()
8 changes: 1 addition & 7 deletions cmake/SetupCuSolverMp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

include_guard(GLOBAL)

function(abacus_setup_cusolvermp target_name)
function(abacus_setup_cusolvermp)
abacus_add_feature_definitions(__CUSOLVERMP)

# Find cuSOLVERMp first, then decide communicator backend.
Expand Down Expand Up @@ -126,10 +126,4 @@ function(abacus_setup_cusolvermp target_name)
INTERFACE_INCLUDE_DIRECTORIES "${CUSOLVERMP_INCLUDE_DIR}")
endif()

# === Link libraries and propagate include directories ===
if(_use_cal)
target_link_libraries(abacus_external_deps INTERFACE CAL::CAL cusolverMp::cusolverMp)
else()
target_link_libraries(abacus_external_deps INTERFACE NCCL::NCCL cusolverMp::cusolverMp)
endif()
endfunction()
3 changes: 1 addition & 2 deletions cmake/SetupNccl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ include_guard(GLOBAL)

include(CheckIncludeFileCXX)

function(abacus_setup_nccl target_name)
function(abacus_setup_nccl)
find_library(NCCL_LIBRARY NAMES nccl
HINTS ${NCCL_PATH} ${NVHPC_ROOT_DIR}
PATH_SUFFIXES lib lib64 comm_libs/nccl/lib)
Expand Down Expand Up @@ -39,5 +39,4 @@ function(abacus_setup_nccl target_name)
endif()
endif()

target_link_libraries(abacus_external_deps INTERFACE NCCL::NCCL)
endfunction()
30 changes: 15 additions & 15 deletions cmake/Testing.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# =============================================================================
# Setup Testing Environment (GTest, CTest, AddTest function)
# SeSetup unit-test dependencies and the AddTest helper
Comment thread
Growl1234 marked this conversation as resolved.
Outdated
# ==============================================================================

# include_guard(GLOBAL)
Expand All @@ -12,8 +12,9 @@ macro(set_if_higher VARIABLE VALUE)
endmacro()

# Add performance test in abacus
if(ENABLE_GOOGLEBENCH)
set(BUILD_TESTING ON)
# Benchmarks are test targets; do not make them implicitly enable the full
# unit-test tree for ordinary builds.
if(BUILD_TESTING AND ENABLE_GOOGLEBENCH)
find_package(benchmark HINTS ${BENCHMARK_DIR})
if(NOT ${benchmark_FOUND})
set(BENCHMARK_USE_BUNDLED_GTEST OFF)
Expand All @@ -38,17 +39,19 @@ endif()
add_coverage(${UT_TARGET})
endif()

# dependencies & link library
target_link_libraries(${UT_TARGET} PRIVATE ${UT_LIBS} Threads::Threads
GTest::gtest_main GTest::gmock_main)
if(ENABLE_GOOGLEBENCH)
# Dependencies & link library
# Share the numerical/MPI/OpenMP runtime closure but not
# the optional feature closure of the final binary
target_link_libraries(${UT_TARGET} PRIVATE
${UT_LIBS}
GTest::gtest_main
GTest::gmock_main
abacus::linalg_libs)
if(BUILD_TESTING AND ENABLE_GOOGLEBENCH)
target_link_libraries(
${UT_TARGET} PRIVATE benchmark::benchmark)
endif()

if(USE_OPENMP)
target_link_libraries(${UT_TARGET} PRIVATE OpenMP::OpenMP_CXX)
endif()

# Link to build info if needed
if("${UT_SOURCES}" MATCHES "parse_args.cpp")
Expand All @@ -64,8 +67,6 @@ endif()

if(BUILD_TESTING)
set_if_higher(CMAKE_CXX_STANDARD 14) # Required in orbital
include(CTest)
enable_testing()
find_package(GTest HINTS /usr/local/lib/ ${GTEST_DIR})
if(NOT ${GTest_FOUND})
include(FetchContent)
Expand All @@ -77,7 +78,6 @@ if(BUILD_TESTING)
GIT_PROGRESS TRUE)
FetchContent_MakeAvailable(googletest)
endif()
# TODO: Try the GoogleTest module.
# https://cmake.org/cmake/help/latest/module/GoogleTest.html
add_subdirectory(tests) # Contains integration tests
# Integration tests are registered from source/CMakeLists.txt after the
# final executable has been created.
endif()
Loading
Loading