From e00e1e3af0f1edc60ab6b2d10bfb7cf8b47fe9ca Mon Sep 17 00:00:00 2001 From: Stephanie Brink Date: Mon, 23 Sep 2024 13:35:31 -0700 Subject: [PATCH 1/2] build CUDA smoketest if CUDA is found --- src/c/CMakeLists.txt | 5 ----- src/c/test/CMakeLists.txt | 11 +++++++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/c/CMakeLists.txt b/src/c/CMakeLists.txt index 0d75407d..0f001d9c 100644 --- a/src/c/CMakeLists.txt +++ b/src/c/CMakeLists.txt @@ -2,11 +2,6 @@ cmake_minimum_required(VERSION 3.12) project(PerfFlowAspect VERSION "0.1.0") -# Build Options -option(PERFFLOWASPECT_WITH_CUDA "Build CUDA smoketest" ON) -option(PERFFLOWASPECT_WITH_MPI "Build MPI smoketest" ON) -option(PERFFLOWASPECT_WITH_MULTITHREADS "Build multi-threaded smoketest" ON) - # Fail if using Clang < 9.0 if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") # require at least Clang 9.0 diff --git a/src/c/test/CMakeLists.txt b/src/c/test/CMakeLists.txt index 754e231f..a6379ba7 100644 --- a/src/c/test/CMakeLists.txt +++ b/src/c/test/CMakeLists.txt @@ -15,6 +15,17 @@ foreach(TEST ${SMOKETESTS}) target_link_libraries(${TEST} ${perfflow_deps}) endforeach() +# Build Options +option(PERFFLOWASPECT_WITH_MULTITHREADS "Build multi-threaded smoketest" ON) +find_package(CUDA QUIET) +if(CUDA_FOUND) + option(PERFFLOWASPECT_WITH_CUDA "Build CUDA smoketest" ON) +endif() +find_package(MPI QUIET) +if(MPI_FOUND) + option(PERFFLOWASPECT_WITH_MPI "Build MPI smoketest" ON) +endif() + if(PERFFLOWASPECT_WITH_MULTITHREADS) message(STATUS " [*] Adding test: smoketest_MT") add_executable(smoketest_MT smoketest_MT.cpp) From e0d1016dceeaf368a43f226027594ae9e8697456 Mon Sep 17 00:00:00 2001 From: Stephanie Brink Date: Sat, 28 Sep 2024 05:56:05 -0700 Subject: [PATCH 2/2] set variables to off if MPI or CUDA not found --- src/c/test/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/c/test/CMakeLists.txt b/src/c/test/CMakeLists.txt index a6379ba7..aae008c8 100644 --- a/src/c/test/CMakeLists.txt +++ b/src/c/test/CMakeLists.txt @@ -20,10 +20,14 @@ option(PERFFLOWASPECT_WITH_MULTITHREADS "Build multi-threaded smoketest" ON) find_package(CUDA QUIET) if(CUDA_FOUND) option(PERFFLOWASPECT_WITH_CUDA "Build CUDA smoketest" ON) +else() + option(PERFFLOWASPECT_WITH_CUDA "Build CUDA smoketest" OFF) endif() find_package(MPI QUIET) if(MPI_FOUND) option(PERFFLOWASPECT_WITH_MPI "Build MPI smoketest" ON) +else() + option(PERFFLOWASPECT_WITH_MPI "Build MPI smoketest" OFF) endif() if(PERFFLOWASPECT_WITH_MULTITHREADS)