From b75ed2d20097def5ec75e4571cc5e47d0b886725 Mon Sep 17 00:00:00 2001 From: Marcel Koch Date: Fri, 19 Jan 2024 13:08:06 +0000 Subject: [PATCH 01/18] remove unused cmake function --- cmake/build_helpers.cmake | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/cmake/build_helpers.cmake b/cmake/build_helpers.cmake index 0985f089382..eb295719758 100644 --- a/cmake/build_helpers.cmake +++ b/cmake/build_helpers.cmake @@ -115,26 +115,6 @@ macro(ginkgo_modify_flags name) string(REPLACE "\"" "\\\"" ${name}_MODIFY "${${name}}") endmacro() -# Extract the clang version from a clang executable path -function(ginkgo_extract_clang_version CLANG_COMPILER GINKGO_CLANG_VERSION) - set(CLANG_VERSION_PROG "#include \n" - "int main() {printf(\"%d.%d.%d\", __clang_major__, __clang_minor__, __clang_patchlevel__)\;" - "return 0\;}") - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/extract_clang_ver.cpp" ${CLANG_VERSION_PROG}) - execute_process(COMMAND ${CLANG_COMPILER} ${CMAKE_CURRENT_BINARY_DIR}/extract_clang_ver.cpp - -o ${CMAKE_CURRENT_BINARY_DIR}/extract_clang_ver - ERROR_VARIABLE CLANG_EXTRACT_VER_ERROR) - execute_process(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/extract_clang_ver - OUTPUT_VARIABLE FOUND_CLANG_VERSION - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_STRIP_TRAILING_WHITESPACE - ) - - set (${GINKGO_CLANG_VERSION} "${FOUND_CLANG_VERSION}" PARENT_SCOPE) - file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/extract_clang_ver.cpp) - file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/extract_clang_ver) -endfunction() - # Extract the DPC++ version function(ginkgo_extract_dpcpp_version DPCPP_COMPILER GINKGO_DPCPP_VERSION MACRO_VAR) set(DPCPP_VERSION_PROG "#include \n#include \n" From ebbb23962cda1e73e01b85d7b97097e2ae365b95 Mon Sep 17 00:00:00 2001 From: Marcel Koch Date: Mon, 22 Jan 2024 16:26:52 +0100 Subject: [PATCH 02/18] don't present BUILD_SHARED_LIBS as a ginkgo option --- CMakeLists.txt | 5 +++++ INSTALL.md | 2 +- cmake/rename.cmake | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 10f76ac9a6c..4ab6cdb0e1a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,6 +70,11 @@ option(GINKGO_EXTENSION_KOKKOS_CHECK_TYPE_ALIGNMENT "Enables mapping to Kokkos t gko_rename_cache(GINKGO_COMPILER_FLAGS CMAKE_CXX_FLAGS BOOL "Flags used by the CXX compiler during all build types.") gko_rename_cache(GINKGO_CUDA_COMPILER_FLAGS CMAKE_CUDA_FLAGS BOOL "Flags used by the CUDA compiler during all build types.") +if(NOT DEFINED BUILD_SHARED_LIBS) + message(STATUS "BUILD_SHARED_LIBS is not set, so enabling it by default.") + set(BUILD_SHARED_LIBS ON) +endif() + # load executor-specific configuration if(GINKGO_BUILD_CUDA) include(cmake/cuda.cmake) diff --git a/INSTALL.md b/INSTALL.md index 9719bdfb920..bab79203e93 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -89,7 +89,7 @@ Ginkgo adds the following additional switches to control what is being built: `COVERAGE`, `ASAN` (AddressSanitizer), `LSAN` (LeakSanitizer), `TSAN` (ThreadSanitizer) and `UBSAN` (undefined behavior sanitizer) types. * `-DBUILD_SHARED_LIBS={ON, OFF}` builds ginkgo as shared libraries (`OFF`) - or as dynamic libraries (`ON`), default is `ON`. + or as dynamic libraries (`ON`), default is `ON`, see https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html. * `-DGINKGO_JACOBI_FULL_OPTIMIZATIONS={ON, OFF}` use all the optimizations for the CUDA Jacobi algorithm. `OFF` by default. Setting this option to `ON` may lead to very slow compile time (>20 minutes) for the diff --git a/cmake/rename.cmake b/cmake/rename.cmake index d2751bf6623..8964240cea9 100644 --- a/cmake/rename.cmake +++ b/cmake/rename.cmake @@ -2,7 +2,7 @@ macro(gko_rename_cache deprecated actual type doc_string) if(DEFINED ${deprecated}) if(DEFINED ${actual}) - message("actual ${actual} and deprecated ${deprecated}") + message(TRACE "actual ${actual} and deprecated ${deprecated}") if("${${actual}}" STREQUAL "${${deprecated}}") # They are the same, so only throw warning message(WARNING "${deprecated} was deprecated, please only use ${actual} instead. We removed the old variable.") From 137ad34b3400d460fea6235172b78ed2cf91f081 Mon Sep 17 00:00:00 2001 From: Marcel Koch Date: Tue, 30 Jan 2024 16:02:29 +0000 Subject: [PATCH 03/18] update GINKGO_BENCHMARK_ENABLE_TUNING usage The CMake variable is now marked as advanced. There is no incompatibility with other CMake options anymore. The source tuning_variables.cpp is added to the device libs cuda, dpcpp, and hip if the CMake option is set. --- CMakeLists.txt | 10 ++-------- benchmark/CMakeLists.txt | 2 +- benchmark/conversion/conversion.cpp | 5 ----- benchmark/matrix_generator/matrix_generator.cpp | 5 ----- benchmark/matrix_statistics/matrix_statistics.cpp | 5 ----- benchmark/preconditioner/preconditioner.cpp | 5 ----- benchmark/solver/solver_common.hpp | 5 ----- benchmark/spmv/spmv_common.hpp | 1 - cmake/install_helpers.cmake | 7 +++++++ cuda/CMakeLists.txt | 7 +++++++ cuda/components/format_conversion.cuh | 2 +- dpcpp/CMakeLists.txt | 5 ++++- dpcpp/components/format_conversion.dp.hpp | 2 +- hip/CMakeLists.txt | 3 +++ hip/components/format_conversion.hip.hpp | 2 +- 15 files changed, 27 insertions(+), 39 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ab6cdb0e1a..27eee6d2abb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,8 +44,9 @@ option(GINKGO_CHECK_CIRCULAR_DEPS option(GINKGO_CONFIG_LOG_DETAILED "Enable printing of detailed configuration log to screen in addition to the writing of files," OFF) option(GINKGO_BENCHMARK_ENABLE_TUNING - "Enable tuning variables in the benchmarks. For specific use cases, manual code changes could be required." + "Enable tuning variables in the benchmarks. For specific use cases, manual code changes could be required. WARNING: It is not possible to install Ginkgo with this option enabled." OFF) +mark_as_advanced(GINKGO_BENCHMARK_ENABLE_TUNING) set(GINKGO_VERBOSE_LEVEL "1" CACHE STRING "Verbosity level. Put 0 to turn off. 1 activates a few important messages.") set(GINKGO_CUDA_ARCHITECTURES "Auto" CACHE STRING @@ -125,13 +126,6 @@ if(GINKGO_WITH_CCACHE) endif() endif() -if(GINKGO_BENCHMARK_ENABLE_TUNING) - # In this state, the tests and examples cannot be compiled without extra - # complexity/intrusiveness, so we simply disable them. - set(GINKGO_BUILD_TESTS OFF) - set(GINKGO_BUILD_EXAMPLES OFF) -endif() - if(GINKGO_BUILD_TESTS) message(STATUS "GINKGO_BUILD_TESTS is ON, enabling GINKGO_BUILD_REFERENCE") set(GINKGO_BUILD_REFERENCE ON CACHE BOOL "Compile reference CPU kernels" FORCE) diff --git a/benchmark/CMakeLists.txt b/benchmark/CMakeLists.txt index de6e74d464c..78fdfcaf219 100644 --- a/benchmark/CMakeLists.txt +++ b/benchmark/CMakeLists.txt @@ -6,7 +6,7 @@ endif() function(ginkgo_benchmark_add_tuning_maybe name) if(GINKGO_BENCHMARK_ENABLE_TUNING) - target_sources(${name} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../utils/tuning_variables.cpp) + target_sources(${name} PRIVATE ${Ginkgo_SOURCE_DIR}/benchmark/utils/tuning_variables.cpp) endif() endfunction() diff --git a/benchmark/conversion/conversion.cpp b/benchmark/conversion/conversion.cpp index 59c052b11e7..c7de9a66506 100644 --- a/benchmark/conversion/conversion.cpp +++ b/benchmark/conversion/conversion.cpp @@ -23,11 +23,6 @@ #include "benchmark/utils/types.hpp" -#ifdef GINKGO_BENCHMARK_ENABLE_TUNING -#include "benchmark/utils/tuning_variables.hpp" -#endif // GINKGO_BENCHMARK_ENABLE_TUNING - - using Generator = DefaultSystemGenerator<>; diff --git a/benchmark/matrix_generator/matrix_generator.cpp b/benchmark/matrix_generator/matrix_generator.cpp index dc1cb3cc08a..895eec2325e 100644 --- a/benchmark/matrix_generator/matrix_generator.cpp +++ b/benchmark/matrix_generator/matrix_generator.cpp @@ -13,11 +13,6 @@ #include "benchmark/utils/types.hpp" -#ifdef GINKGO_BENCHMARK_ENABLE_TUNING -#include "benchmark/utils/tuning_variables.hpp" -#endif // GINKGO_BENCHMARK_ENABLE_TUNING - - namespace { std::string input_format = " [\n" diff --git a/benchmark/matrix_statistics/matrix_statistics.cpp b/benchmark/matrix_statistics/matrix_statistics.cpp index 8eb847f42f2..7ddf408d565 100644 --- a/benchmark/matrix_statistics/matrix_statistics.cpp +++ b/benchmark/matrix_statistics/matrix_statistics.cpp @@ -16,11 +16,6 @@ #include "benchmark/utils/types.hpp" -#ifdef GINKGO_BENCHMARK_ENABLE_TUNING -#include "benchmark/utils/tuning_variables.hpp" -#endif // GINKGO_BENCHMARK_ENABLE_TUNING - - // See en.wikipedia.org/wiki/Five-number_summary // Quartile computation uses Method 3 from en.wikipedia.org/wiki/Quartile void compute_summary(const std::vector& dist, json& out) diff --git a/benchmark/preconditioner/preconditioner.cpp b/benchmark/preconditioner/preconditioner.cpp index b9dfe1d8369..a1283e50535 100644 --- a/benchmark/preconditioner/preconditioner.cpp +++ b/benchmark/preconditioner/preconditioner.cpp @@ -22,11 +22,6 @@ #include "benchmark/utils/types.hpp" -#ifdef GINKGO_BENCHMARK_ENABLE_TUNING -#include "benchmark/utils/tuning_variables.hpp" -#endif // GINKGO_BENCHMARK_ENABLE_TUNING - - // preconditioner generation and application std::string encode_parameters(const char* precond_name) { diff --git a/benchmark/solver/solver_common.hpp b/benchmark/solver/solver_common.hpp index 541a9f66287..1e77e13234b 100644 --- a/benchmark/solver/solver_common.hpp +++ b/benchmark/solver/solver_common.hpp @@ -16,11 +16,6 @@ #include "benchmark/utils/runner.hpp" -#ifdef GINKGO_BENCHMARK_ENABLE_TUNING -#include "benchmark/utils/tuning_variables.hpp" -#endif // GINKGO_BENCHMARK_ENABLE_TUNING - - // Command-line arguments DEFINE_uint32(max_iters, 1000, "Maximal number of iterations the solver will be run for"); diff --git a/benchmark/spmv/spmv_common.hpp b/benchmark/spmv/spmv_common.hpp index 4ac777479b2..0c58cf30b7b 100644 --- a/benchmark/spmv/spmv_common.hpp +++ b/benchmark/spmv/spmv_common.hpp @@ -135,7 +135,6 @@ struct SpmvBenchmark : Benchmark> { // tuning run #ifdef GINKGO_BENCHMARK_ENABLE_TUNING - auto& format_case = spmv_case[format_name]; format_case["tuning"] = json::object(); auto& tuning_case = format_case["tuning"]; tuning_case["time"] = json::array(); diff --git a/cmake/install_helpers.cmake b/cmake/install_helpers.cmake index 7165cad0c2b..5e7ea305c55 100644 --- a/cmake/install_helpers.cmake +++ b/cmake/install_helpers.cmake @@ -1,6 +1,13 @@ include(CMakePackageConfigHelpers) include(GNUInstallDirs) +if(GINKGO_BENCHMARK_ENABLE_TUNING) + install(CODE [=[ + message(FATAL_ERROR + "Skipping install configuration due to enabled GINKGO_BENCHMARK_ENABLE_TUNING. " + "Please deactivate that variable if you want to install Ginkgo") + ]=]) +endif() set(GINKGO_INSTALL_CONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/Ginkgo") set(GINKGO_INSTALL_MODULE_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/Ginkgo/Modules") diff --git a/cuda/CMakeLists.txt b/cuda/CMakeLists.txt index d4a94eda802..a83cf7434c3 100644 --- a/cuda/CMakeLists.txt +++ b/cuda/CMakeLists.txt @@ -31,6 +31,13 @@ target_sources(ginkgo_cuda ${GKO_UNIFIED_COMMON_SOURCES} ${GKO_CUDA_HIP_COMMON_SOURCES} ) +if(GINKGO_BENCHMARK_ENABLE_TUNING) + target_sources(ginkgo_cuda PRIVATE ${Ginkgo_SOURCE_DIR}/benchmark/utils/tuning_variables.cpp) +endif() +# override the default language mapping for the common files, set them to CUDA +foreach(source_file IN LISTS GKO_UNIFIED_COMMON_SOURCES) + set_source_files_properties(${source_file} PROPERTIES LANGUAGE CUDA) +endforeach(source_file) if(GINKGO_JACOBI_FULL_OPTIMIZATIONS) set(GKO_CUDA_JACOBI_BLOCK_SIZES) foreach(blocksize RANGE 1 32) diff --git a/cuda/components/format_conversion.cuh b/cuda/components/format_conversion.cuh index 9ece2cdffe4..9bb57079edd 100644 --- a/cuda/components/format_conversion.cuh +++ b/cuda/components/format_conversion.cuh @@ -87,7 +87,7 @@ __host__ size_type calculate_nwarps(std::shared_ptr exec, multiple = 32; } #ifdef GINKGO_BENCHMARK_ENABLE_TUNING - if (_tuning_flag) { + if (_tuning_flag && _tuned_value > 0) { multiple = _tuned_value; } #endif // GINKGO_BENCHMARK_ENABLE_TUNING diff --git a/dpcpp/CMakeLists.txt b/dpcpp/CMakeLists.txt index 851ef9a3dc6..c73d5c1c8e4 100644 --- a/dpcpp/CMakeLists.txt +++ b/dpcpp/CMakeLists.txt @@ -1,6 +1,6 @@ find_package(MKL CONFIG REQUIRED HINTS "$ENV{MKLROOT}" "$ENV{MKL_ROOT}") find_package(oneDPL REQUIRED HINTS "$ENV{DPL_ROOT}" "$ENV{DPLROOT}") -# use the parameter from cmake +# use the parameter from cmake set(GINKGO_MKL_ROOT "${MKL_DIR}" PARENT_SCOPE) set(GINKGO_DPL_ROOT "${oneDPL_DIR}" PARENT_SCOPE) @@ -69,6 +69,9 @@ target_sources(ginkgo_dpcpp ${GKO_UNIFIED_COMMON_SOURCES} ${DENSE_INSTANTIATE} ) +if(GINKGO_BENCHMARK_ENABLE_TUNING) + target_sources(ginkgo_dpcpp PRIVATE ${Ginkgo_SOURCE_DIR}/benchmark/utils/tuning_variables.cpp) +endif() # TODO: adjust it when dpcpp jacobi supports more block size set(GKO_DPCPP_JACOBI_BLOCK_SIZES 32) diff --git a/dpcpp/components/format_conversion.dp.hpp b/dpcpp/components/format_conversion.dp.hpp index 17cf55389df..4adf706c2a5 100644 --- a/dpcpp/components/format_conversion.dp.hpp +++ b/dpcpp/components/format_conversion.dp.hpp @@ -48,7 +48,7 @@ size_type calculate_nwarps(std::shared_ptr exec, multiple = 32; } #ifdef GINKGO_BENCHMARK_ENABLE_TUNING - if (_tuning_flag) { + if (_tuning_flag && _tuned_value > 0) { multiple = _tuned_value; } #endif // GINKGO_BENCHMARK_ENABLE_TUNING diff --git a/hip/CMakeLists.txt b/hip/CMakeLists.txt index 30e675509d5..319dee6b58c 100644 --- a/hip/CMakeLists.txt +++ b/hip/CMakeLists.txt @@ -28,6 +28,9 @@ set(GINKGO_HIP_SOURCES ${GKO_UNIFIED_COMMON_SOURCES} ${GKO_CUDA_HIP_COMMON_SOURCES} ) +if(GINKGO_BENCHMARK_ENABLE_TUNING) + list(APPEND GINKGO_HIP_SOURCES ${Ginkgo_SOURCE_DIR}/benchmark/utils/tuning_variables.cpp) +endif() if(hipfft_FOUND) list(APPEND GINKGO_HIP_SOURCES matrix/fft_kernels.hip.cpp) diff --git a/hip/components/format_conversion.hip.hpp b/hip/components/format_conversion.hip.hpp index 2e6c4eb1236..c11a0364f3a 100644 --- a/hip/components/format_conversion.hip.hpp +++ b/hip/components/format_conversion.hip.hpp @@ -97,7 +97,7 @@ __host__ size_type calculate_nwarps(std::shared_ptr exec, } #endif // GINKGO_HIP_PLATFORM_NVCC #ifdef GINKGO_BENCHMARK_ENABLE_TUNING - if (_tuning_flag) { + if (_tuning_flag && _tuned_value > 0) { multiple = _tuned_value; } #endif // GINKGO_BENCHMARK_ENABLE_TUNING From 6f94f83b3e246e370ef58ce4eca2658f584a73ad Mon Sep 17 00:00:00 2001 From: Marcel Koch Date: Fri, 26 Jan 2024 14:25:14 +0000 Subject: [PATCH 04/18] fix cmake log --- cmake/get_info.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/get_info.cmake b/cmake/get_info.cmake index 63f43c645f0..aee19cdd0c9 100644 --- a/cmake/get_info.cmake +++ b/cmake/get_info.cmake @@ -133,7 +133,7 @@ foreach(log_type ${log_types}) "GINKGO_MIXED_PRECISION;GINKGO_HAVE_GPU_AWARE_MPI") ginkgo_print_module_footer(${${log_type}} " Tests, benchmarks and examples:") ginkgo_print_foreach_variable(${${log_type}} - "GINKGO_BUILD_TESTS;GINKGO_FAST_TESTS;GINKGO_BUILD_EXAMPLES;GINKGO_EXTLIB_EXAMPLE;GINKGO_BUILD_BENCHMARKS;GINKGO_BENCHMARK_ENABLE_TUNING") + "GINKGO_BUILD_TESTS;GINKGO_FAST_TESTS;GINKGO_BUILD_EXAMPLES;GINKGO_BUILD_EXTLIB_EXAMPLE;GINKGO_BUILD_BENCHMARKS;GINKGO_BENCHMARK_ENABLE_TUNING") ginkgo_print_module_footer(${${log_type}} " Documentation:") ginkgo_print_foreach_variable(${${log_type}} "GINKGO_BUILD_DOC;GINKGO_VERBOSE_LEVEL") ginkgo_print_module_footer(${${log_type}} "") From 30c74972f19c7e47de018f9a3173906de803b003 Mon Sep 17 00:00:00 2001 From: Marcel Koch Date: Fri, 19 Jan 2024 14:01:56 +0000 Subject: [PATCH 05/18] add base CMakePresets.json --- CMakePresets.json | 37 +++++++++++++++++++++++++++++++++++++ CONTRIBUTING.md | 11 ++++++++--- 2 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 CMakePresets.json diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 00000000000..37081e15cc0 --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,37 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "base", + "hidden": true, + "generator": "Ninja", + "binaryDir": "${sourceDir}/build-${presetName}" + }, + { + "name": "release", + "inherits": "base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + }, + "warnings": { + "dev": false + } + }, + { + "name": "develop", + "inherits": "base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_CXX_FLAGS": "$env{CXXFLAGS} -Wpedantic" + } + }, + { + "name": "develop-msvc", + "inherits": "base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_CXX_FLAGS": "$env{CXXFLAGS} /permissive-" + } + } + ] +} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 66865585dca..4547986f3fe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -568,9 +568,14 @@ files. ### Warnings -By default, the `-DCMAKE_CXX_FLAGS` should be set to `-Wpedantic` to emit -pedantic warnings by default. The CI system additionally also has a step -where it compiles for pedantic warnings to be errors. +By default, the `-Wpedantic` (or `/permissive-` on MSVC) is added to `CMAKE_CXX_FLAGS` +and hence pedantic warnings are emitted by default. Some of these warnings +are false positives and a complete list of the resolved warnings and their solutions +is listed in [Issue 174](https://github.com/ginkgo-project/ginkgo/issues/174). +Specifically, when macros are being used, we have the issue of having `extra ;` +warnings, which is resolved by adding a `static_assert()`. The CI system +additionally also has a step where it compiles for pedantic warnings to be +errors. ### Avoiding circular dependencies From e6b0e5396d054902bc6e13a8d4e448f890daac23 Mon Sep 17 00:00:00 2001 From: Marcel Koch Date: Tue, 30 Jan 2024 16:51:51 +0000 Subject: [PATCH 06/18] add CI presets --- CMakeCIPresets.json | 573 ++++++++++++++++++++++++++++++++++++++++++++ CMakePresets.json | 71 +++--- 2 files changed, 609 insertions(+), 35 deletions(-) create mode 100644 CMakeCIPresets.json diff --git a/CMakeCIPresets.json b/CMakeCIPresets.json new file mode 100644 index 00000000000..5b2863bb47e --- /dev/null +++ b/CMakeCIPresets.json @@ -0,0 +1,573 @@ +{ + "version": 4, + "configurePresets": [ + { + "name": "base-ci", + "hidden": true, + "binaryDir": "${sourceDir}/build-${presetName}", + "generator": "Ninja", + "environment": { + "MPI_AS_ROOT": "OFF" + }, + "cacheVariables": { + "CMAKE_CXX_FLAGS": "", + "GINKGO_BUILD_SHARED_LIBS": "ON", + "GINKGO_BUILD_REFERENCE": "ON", + "GINKGO_BUILD_OMP": "OFF", + "GINKGO_BUILD_CUDA": "OFF", + "GINKGO_BUILD_HIP": "OFF", + "GINKGO_BUILD_SYCL": "OFF", + "GINKGO_BUILD_HWLOC": "ON", + "GINKGO_BUILD_PAPI_SDE": "OFF", + "GINKGO_BUILD_MPI": "OFF", + "GINKGO_BUILD_TESTS": "ON", + "GINKGO_CONFIG_LOG_DETAILED": "ON", + "GINKGO_DEVEL_TOOLS": "OFF", + "GINKGO_DPCPP_SINGLE_MODE": "OFF", + "GINKGO_FAST_TESTS": "OFF", + "GINKGO_MIXED_PRECISION": "ON", + "GINKGO_TEST_NONDEFAULT_STREAM": "OFF", + "GINKGO_RUN_EXAMPLES": "OFF" + } + }, + { + "name": "enable-release", + "hidden": true, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "CMAKE_CONFIGURATION_TYPES": "Release" + } + }, + { + "name": "enable-debug", + "hidden": true, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_CONFIGURATION_TYPES": "Debug" + } + }, + { + "name": "enable-cuda", + "hidden": true, + "cacheVariables": { + "GINKGO_BUILD_CUDA": "ON", + "CMAKE_CUDA_COMPILER": "nvcc", + "CMAKE_CUDA_ARCHITECTURES": "$env{CUDA_ARCH}" + } + }, + { + "name": "enable-sycl", + "hidden": true, + "cacheVariables": { + "GINKGO_BUILD_SYCL": "ON", + "CMAKE_CXX_FLAGS": "-Wpedantic -ffp-model=precise", + "GINKGO_DPCPP_SINGLE_MODE": "ON" + } + }, + { + "name": "enable-hip", + "hidden": true, + "cacheVariables": { + "GINKGO_BUILD_HIP": "ON" + } + }, + { + "name": "enable-openmp", + "hidden": true, + "cacheVariables": { + "GINKGO_BUILD_OMP": "ON" + } + }, + { + "name": "enable-mpi", + "hidden": true, + "environment": { + "MPI_AS_ROOT": "ON" + }, + "cacheVariables": { + "GINKGO_BUILD_MPI": "ON" + } + }, + { + "name": "enable-gcc", + "hidden": true, + "cacheVariables": { + "CMAKE_CXX_COMPILER": "g++" + } + }, + { + "name": "enable-clang", + "hidden": true, + "cacheVariables": { + "CMAKE_CXX_COMPILER": "clang++" + } + }, + { + "name": "enable-intel", + "hidden": true, + "cacheVariables": { + "CMAKE_CXX_COMPILER": "icpx" + } + }, + { + "name": "enable-dpcpp", + "hidden": true, + "cacheVariables": { + "CMAKE_CXX_COMPILER": "dpcpp" + } + }, + { + "name": "enable-nvhpc", + "hidden": true, + "cacheVariables": { + "CMAKE_CXX_COMPILER": "nvc++", + "CMAKE_CXX_FLAGS": "--diag_suppress=useless_using_declaration,declared_but_not_referenced", + "CMAKE_CUDA_FLAGS": "-diag-suppress=177" + } + }, + { + "name": "enable-msvc", + "hidden": true, + "generator": "Visual Studio 17 2022", + "cacheVariables": { + "CMAKE_CXX_COMPILER": "msvc", + "CMAKE_CXX_FLAGS_DEBUG": "/MDd /Zi /Ob1 /O1 /Od /RTC1" + } + }, + { + "name": "ci-cuda-msvc-nompi-release", + "inherits": [ + "enable-cuda", + "enable-msvc", + "enable-release", + "base-ci" + ] + }, + { + "name": "ci-cuda+omp-gcc-mpi-release-shared", + "inherits": [ + "enable-cuda", + "enable-openmp", + "enable-gcc", + "enable-release", + "base-ci" + ] + }, + { + "name": "ci-cuda+omp-gcc-mpi-debug-fasttest-nondefault_stream", + "inherits": [ + "enable-cuda", + "enable-openmp", + "enable-gcc", + "enable-debug", + "base-ci" + ], + "cacheVariables": { + "GINKGO_FAST_TESTS": "ON", + "GINKGO_TEST_NONDEFAULT_STREAM": "ON" + } + }, + { + "name": "ci-cuda+omp-clang-nompi-release-static", + "inherits": [ + "enable-cuda", + "enable-openmp", + "enable-clang", + "enable-release", + "base-ci" + ], + "cacheVariables": { + "GINKGO_BUILD_SHARED_LIBS": "OFF" + } + }, + { + "name": "ci-cuda+omp-clang-nompi-release-fasttest-shared", + "inherits": [ + "enable-cuda", + "enable-openmp", + "enable-clang", + "enable-release", + "base-ci" + ], + "cacheVariables": { + "GINKGO_FAST_TESTS": "ON", + "CMAKE_CXX_FLAGS": "-Wno-error=maybe-uninitialized", + "CMAKE_CUDA_FLAGS": "-diag-suppress=177" + } + }, + { + "name": "ci-cuda+omp-gcc-nompi-debug-fasttest", + "inherits": [ + "enable-cuda", + "enable-openmp", + "enable-gcc", + "enable-debug", + "base-ci" + ], + "cacheVariables": { + "GINKGO_FAST_TESTS": "ON", + "CMAKE_CXX_FLAGS": "-Wno-error=maybe-uninitialized", + "CMAKE_CUDA_FLAGS": "-diag-suppress=177" + } + }, + { + "name": "ci-cuda+omp-nvhpc-nompi-release-static-fasttest", + "inherits": [ + "enable-cuda", + "enable-openmp", + "enable-nvhpc", + "enable-release", + "base-ci" + ], + "cacheVariables": { + "GINKGO_FAST_TESTS": "ON", + "GINKGO_BUILD_SHARED_LIBS": "OFF" + } + }, + { + "name": "ci-cuda+omp-nvhpc-nompi-debug-fasttest", + "inherits": [ + "enable-cuda", + "enable-openmp", + "enable-nvhpc", + "enable-debug", + "base-ci" + ], + "cacheVariables": { + "GINKGO_FAST_TESTS": "ON" + } + }, + { + "name": "ci-cuda-msvc-nompi-release-shared", + "inherits": [ + "enable-cuda", + "enable-msvc", + "enable-release", + "base-ci" + ] + }, + { + "name": "ci-hip+omp-gcc-nompi-debug-static", + "inherits": [ + "enable-hip", + "enable-openmp", + "enable-gcc", + "enable-debug", + "base-ci" + ], + "cacheVariables": { + "GINKGO_BUILD_SHARED_LIBS": "OFF", + "GINKGO_RUN_EXAMPLES": "ON" + } + }, + { + "name": "ci-hip+omp-gcc-nompi-release-fasttest-nondefault_stream", + "inherits": [ + "enable-hip", + "enable-openmp", + "enable-gcc", + "enable-release", + "base-ci" + ], + "cacheVariables": { + "GINKGO_FAST_TESTS": "ON", + "GINKGO_TEST_NONDEFAULT_STREAM": "ON", + "GINKGO_RUN_EXAMPLES": "ON" + } + }, + { + "name": "ci-hip+omp-clang-nompi-debug", + "inherits": [ + "enable-hip", + "enable-openmp", + "enable-clang", + "enable-debug", + "base-ci" + ], + "cacheVariables": { + "GINKGO_RUN_EXAMPLES": "ON" + } + }, + { + "name": "ci-hip+omp-clang-nompi-release", + "inherits": [ + "enable-hip", + "enable-openmp", + "enable-clang", + "enable-release", + "base-ci" + ], + "cacheVariables": { + "GINKGO_RUN_EXAMPLES": "ON" + } + }, + { + "name": "ci-hip+omp-clang-nompi-release-static", + "inherits": [ + "ci-hip+omp-clang-nompi-release" + ], + "cacheVariables": { + "GINKGO_BUILD_SHARED_LIBS": "OFF", + "GINKGO_RUN_EXAMPLES": "ON" + } + }, + { + "name": "ci-hip-gcc-nompi-release", + "inherits": [ + "enable-hip", + "enable-gcc", + "enable-release", + "base-ci" + ], + "cacheVariables": { + "GINKGO_RUN_EXAMPLES": "ON" + } + }, + { + "name": "ci-ref-clang-nompi-release", + "inherits": [ + "enable-clang", + "enable-release", + "base-ci" + ] + }, + { + "name": "ci-ref-gcc-nompi-debug-static-fasttest", + "inherits": [ + "enable-clang", + "enable-release", + "base-ci" + ], + "cacheVariables": { + "GINKGO_FAST_TESTS": "ON", + "GINKGO_BUILD_SHARED_LIBS": "OFF" + } + }, + { + "name": "ci-ref-msvc-nompi-release", + "generator": "Visual Studio 17 2022", + "inherits": [ + "enable-msvc", + "enable-release", + "base-ci" + ] + }, + { + "name": "ci-ref-msvc-nompi-release-static", + "generator": "Visual Studio 17 2022", + "inherits": [ + "ci-ref-msvc-nompi-release" + ], + "cacheVariables": { + "GINKGO_BUILD_SHARED_LIBS": "OFF" + } + }, + { + "name": "ci-omp-clang-mpi-debug-static-fasttest", + "inherits": [ + "enable-openmp", + "enable-clang", + "enable-mpi", + "enable-debug", + "base-ci" + ], + "cacheVariables": { + "GINKGO_BUILD_SHARED_LIBS": "OFF", + "GINKGO_FAST_TESTS": "ON" + } + }, + { + "name": "ci-omp-clang-mpi-glibcxx+debug-release", + "inherits": [ + "enable-openmp", + "enable-clang", + "enable-mpi", + "enable-debug", + "base-ci" + ], + "cacheVariables": { + "CMAKE_CXX_FLAGS": "-Wpedantic -D_GLIBCXX_DEBUG=1" + } + }, + { + "name": "ci-omp-clang-nompi-debug-nomixed", + "inherits": [ + "enable-openmp", + "enable-clang", + "enable-mpi", + "enable-debug", + "base-ci" + ], + "cacheVariables": { + "GINKGO_MIXED_PRECISION": "OFF" + } + }, + { + "name": "ci-omp-clang-nompi-debug-static-nomixed", + "inherits": [ + "ci-omp-clang-nompi-debug-nomixed" + ], + "cacheVariables": { + "GINKGO_BUILD_SHARED_LIBS": "OFF" + } + }, + { + "name": "ci-omp-clang-nompi-release-static", + "inherits": [ + "enable-openmp", + "enable-clang", + "enable-mpi", + "enable-release", + "base-ci" + ], + "cacheVariables": { + "GINKGO_BUILD_SHARED_LIBS": "OFF" + } + }, + { + "name": "ci-omp-clang-nompi-release-static-nomixed", + "inherits": [ + "ci-omp-clang-nompi-release-static" + ], + "cacheVariables": { + "GINKGO_MIXED_PRECISION": "OFF" + } + }, + { + "name": "ci-omp-gcc-nompi-release", + "inherits": [ + "enable-openmp", + "enable-gcc", + "enable-release", + "base-ci" + ] + }, + { + "name": "ci-omp-gcc-nompi-release-static", + "inherits": [ + "ci-omp-gcc-nompi-release" + ], + "cacheVariables": { + "GINKGO_BUILD_SHARED_LIBS": "OFF" + } + }, + { + "name": "ci-omp-gcc-mpi-release-nomixed", + "inherits": [ + "enable-openmp", + "enable-clang", + "enable-mpi", + "enable-release", + "base-ci" + ], + "cacheVariables": { + "GINKGO_MIXED_PRECISION": "OFF" + } + }, + { + "name": "ci-omp-mingwgcc-nompi-release-static", + "generator": "MinGW Makefiles", + "inherits": [ + "enable-openmp", + "enable-gcc", + "enable-release", + "base-ci" + ], + "cacheVariables": { + "GINKGO_BUILD_SHARED_LIBS": "OFF" + } + }, + { + "name": "ci-sycl-icpx-nompi-release-shared-singlemode", + "inherits": [ + "enable-sycl", + "enable-intel", + "enable-mpi", + "enable-release", + "base-ci" + ] + }, + { + "name": "ci-sycl-dpcpp-nompi-release-singlemode", + "inherits": [ + "enable-sycl", + "enable-dpcpp", + "enable-mpi", + "enable-release", + "base-ci" + ] + }, + { + "name": "ci-sycl-dpcpp-nompi-release-static-singlemode", + "inherits": [ + "ci-sycl-dpcpp-nompi-release-singlemode" + ], + "cacheVariables": { + "GINKGO_BUILD_SHARED_LIBS": "OFF" + } + }, + { + "name": "ci-sycl-icpx-nompi-release-singlemode-nomixed", + "inherits": [ + "ci-sycl-icpx-nompi-release-singlemode" + ], + "cacheVariables": { + "GINKGO_MIXED_PRECISION": "OFF" + } + }, + { + "name": "ci-warnings", + "inherits": [ + "enable-cuda", + "enable-hip", + "enable-openmp", + "base-ci" + ], + "cacheVariables": { + "CMAKE_CXX_FLAGS": "-Wpedantic -Werror=pedantic -pedantic-errors" + } + }, + { + "name": "ci-no_circular_deps", + "inherits": [ + "enable-cuda", + "enable-hip", + "enable-openmp", + "base-ci" + ], + "cacheVariables": { + "GINKGO_CHECK_CIRCULAR_DEPS": "ON" + } + }, + { + "name": "ci-subdir_build", + "inherits": [ + "enable-openmp", + "base-ci" + ] + }, + { + "name": "ci-clang_tidy", + "inherits": [ + "enable-cuda", + "enable-hip", + "enable-openmp", + "base-ci" + ], + "cacheVariables": { + "GINKGO_WITH_CLANG_TIDY": "ON" + } + }, + { + "name": "ci-iwyu", + "inherits": [ + "enable-cuda", + "enable-openmp", + "base-ci" + ], + "cacheVariables": { + "GINKGO_WITH_IWYU": "ON" + } + } + ] +} diff --git a/CMakePresets.json b/CMakePresets.json index 37081e15cc0..cbf3b783990 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -1,37 +1,38 @@ { - "version": 1, - "configurePresets": [ - { - "name": "base", - "hidden": true, - "generator": "Ninja", - "binaryDir": "${sourceDir}/build-${presetName}" - }, - { - "name": "release", - "inherits": "base", - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Release" - }, - "warnings": { - "dev": false - } - }, - { - "name": "develop", - "inherits": "base", - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug", - "CMAKE_CXX_FLAGS": "$env{CXXFLAGS} -Wpedantic" - } - }, - { - "name": "develop-msvc", - "inherits": "base", - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug", - "CMAKE_CXX_FLAGS": "$env{CXXFLAGS} /permissive-" - } - } - ] + "version": 4, + "include": ["CMakeCIPresets.json"], + "configurePresets": [ + { + "name": "base", + "hidden": true, + "generator": "Ninja", + "binaryDir": "${sourceDir}/build-${presetName}" + }, + { + "name": "release", + "inherits": "base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + }, + "warnings": { + "dev": false + } + }, + { + "name": "develop", + "inherits": "base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_CXX_FLAGS": "$env{CXXFLAGS} -Wpedantic" + } + }, + { + "name": "develop-msvc", + "inherits": "base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_CXX_FLAGS": "$env{CXXFLAGS} /permissive-" + } + } + ] } From 12756049c37e0d0b0c2a34eef2c7308e4d98ee18 Mon Sep 17 00:00:00 2001 From: Marcel Koch Date: Tue, 13 Aug 2024 17:13:50 +0200 Subject: [PATCH 07/18] use cmake presets in gitlab ci --- .github/workflows/intel.yml | 10 +- .github/workflows/osx.yml | 16 +- .github/workflows/windows-mingw.yml | 6 +- .github/workflows/windows-msvc-cuda.yml | 9 +- .github/workflows/windows-msvc-ref.yml | 16 +- .gitlab-ci.yml | 204 +++++++----------------- .gitlab/scripts.yml | 130 ++++++++------- 7 files changed, 154 insertions(+), 237 deletions(-) diff --git a/.github/workflows/intel.yml b/.github/workflows/intel.yml index 7a1e97a80e8..b3105067148 100644 --- a/.github/workflows/intel.yml +++ b/.github/workflows/intel.yml @@ -21,9 +21,9 @@ jobs: fail-fast: false matrix: config: - - {compiler: "dpcpp", build_type: "Release", name: "intel/dpcpp/release/shared", mixed: "ON"} - - {compiler: "icpx", build_type: "Release", name: "intel/icpx/release/shared", mixed: "OFF"} - name: ${{ matrix.config.name }} + - { preset: "ci-sycl-dpcpp-nompi-release-singlemode" } + - { preset: "ci-sycl-icpx-nompi-release-singlemode-nomixed" } + name: ${{ matrix.config.preset }} runs-on: [gpu_intel] steps: @@ -36,8 +36,8 @@ jobs: module load intel-oneapi-compilers intel-oneapi-dpl intel-oneapi-mkl intel-oneapi-tbb cmake mkdir build cd build - cmake .. -DCMAKE_INSTALL_PREFIX=install_ginkgo -DCMAKE_CXX_FLAGS="-Wpedantic -ffp-model=precise" -DCMAKE_CXX_COMPILER=${{ matrix.config.compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DGINKGO_MIXED_PRECISION=${{ matrix.config.mixed }} -DGINKGO_BUILD_CUDA=OFF -DGINKGO_BUILD_HIP=OFF -DGINKGO_BUILD_MPI=OFF -DGINKGO_DPCPP_SINGLE_MODE=ON - make -j8 + cmake -S .. -B . --preset ${{ matrix.config.preset }} -DCMAKE_INSTALL_PREFIX=install_ginkgo + cmake --build . -j8 ONEAPI_DEVICE_SELECTOR=level_zero:gpu ctest -j10 --output-on-failure - name: install diff --git a/.github/workflows/osx.yml b/.github/workflows/osx.yml index 441be04d842..b593a19f966 100644 --- a/.github/workflows/osx.yml +++ b/.github/workflows/osx.yml @@ -27,9 +27,9 @@ jobs: fail-fast: false matrix: config: - - {shared: "ON", build_type: "Debug", name: "omp/debug/shared", "mixed": "OFF"} - - {shared: "OFF", build_type: "Release", name: "omp/release/static", "mixed": "ON"} - name: ${{ matrix.config.name }} + - { preset: "ci-omp-clang-nompi-debug-nomixed" } + - { preset: "ci-omp-clang-nompi-release-static" } + name: ${{ matrix.config.preset }} runs-on: [macos-latest] steps: @@ -42,7 +42,7 @@ jobs: - name: info run: | - g++ -v + clang++ -v cmake --version - name: Debug over SSH (tmate) @@ -55,12 +55,12 @@ jobs: mkdir install export INSTALL_PREFIX=`pwd`/install cd build - cmake .. -DCMAKE_PREFIX_PATH=/opt/homebrew/opt/libomp/ -DCMAKE_CXX_FLAGS=-Wpedantic -DBUILD_SHARED_LIBS=${{ matrix.config.shared }} -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DGINKGO_MIXED_PRECISION=${{ matrix.config.mixed }} - make -j8 + cmake -S .. -B . --preset ${{ matrix.config.preset }} -DCMAKE_PREFIX_PATH=/opt/homebrew/opt/libomp/ + cmake --build . -j8 ctest -j10 --output-on-failure - name: install run: | cd build - make install - make test_install + cmake --install . + cmake --build . --target test_install diff --git a/.github/workflows/windows-mingw.yml b/.github/workflows/windows-mingw.yml index 1c859661562..b789b76a0ae 100644 --- a/.github/workflows/windows-mingw.yml +++ b/.github/workflows/windows-mingw.yml @@ -28,8 +28,8 @@ jobs: fail-fast: false matrix: config: - - {shared: "OFF", build_type: "Release", name: "omp/release/static", cflags: ""} - name: mingw/${{ matrix.config.name }} + - { preset: "ci-omp-mingwgcc-nompi-release-static" } + name: ${{ matrix.config.preset }} runs-on: [windows-latest] steps: - name: Checkout the latest code (shallow clone) @@ -50,7 +50,7 @@ jobs: set PATH=C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin;%PATH% mkdir build cd build - cmake -G "MinGW Makefiles" -DBUILD_SHARED_LIBS=${{ matrix.config.shared }} -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DCMAKE_CXX_FLAGS=${{ matrix.config.cflags }} .. + cmake -S .. -B . --preset ${{ matrix.config.preset }} cmake --build . -j4 shell: cmd diff --git a/.github/workflows/windows-msvc-cuda.yml b/.github/workflows/windows-msvc-cuda.yml index efa637b2bf9..c45da57b231 100644 --- a/.github/workflows/windows-msvc-cuda.yml +++ b/.github/workflows/windows-msvc-cuda.yml @@ -28,10 +28,13 @@ jobs: fail-fast: false matrix: config: - - {version: "latest", name: "cuda-latest/release/shared", "mixed": "ON"} - name: msvc/${{ matrix.config.name }} (only compile) + - {version: "latest", preset: "ci-cuda-msvc-nompi-release"} + name: ${{ matrix.config.preset }} (only compile) runs-on: [windows-2019] + env: + CUDA_ARCH: "60" + steps: - name: Checkout the latest code (shallow clone) uses: actions/checkout@v4 @@ -58,5 +61,5 @@ jobs: refreshenv mkdir build cd build - cmake -DGINKGO_BUILD_CUDA=ON -DGINKGO_BUILD_OMP=OFF -DGINKGO_MIXED_PRECISION=${{ matrix.config.mixed }} -DGINKGO_CUDA_ARCHITECTURES=60 .. + cmake -S .. -B . --preset ${{ matrix.config.preset }} cmake --build . -j4 --config Release diff --git a/.github/workflows/windows-msvc-ref.yml b/.github/workflows/windows-msvc-ref.yml index 60a811bb99b..52ad7ae8e30 100644 --- a/.github/workflows/windows-msvc-ref.yml +++ b/.github/workflows/windows-msvc-ref.yml @@ -30,11 +30,11 @@ jobs: config: # Debug shared exceeds symbol limit # - {shared: "ON", build_type: "Debug", name: "reference/debug/shared"} - - {shared: "OFF", build_type: "Release", name: "reference/release/static"} - - {shared: "ON", build_type: "Release", name: "reference/release/shared"} + - { preset: "ci-ref-msvc-nompi-release-static" } + - { preset: "ci-ref-msvc-nompi-release" } # Debug static needs too much storage # - {shared: "OFF", build_type: "Debug", name: "reference/debug/static"} - name: msvc/${{ matrix.config.name }} + name: ${{ matrix.config.preset }} runs-on: [windows-latest] steps: - name: Checkout the latest code (shallow clone) @@ -50,13 +50,13 @@ jobs: run: | mkdir build cd build - cmake -DBUILD_SHARED_LIBS=${{ matrix.config.shared }} -DCMAKE_CXX_FLAGS_DEBUG='/MDd /Zi /Ob1 /O1 /Od /RTC1' -DGINKGO_BUILD_CUDA=OFF -DGINKGO_BUILD_OMP=OFF .. - cmake --build . -j4 --config ${{ matrix.config.build_type }} - ctest . -C ${{ matrix.config.build_type }} --output-on-failure + cmake -S .. -B . --preset ${{ matrix.config.preset }} + cmake --build . -j4 + ctest . --output-on-failure - name: install run: | $env:PATH="$env:PATH;C:\Program Files (x86)\Ginkgo\bin" cd build - cmake --install . --config ${{ matrix.config.build_type }} - cmake --build . --target test_install --config ${{ matrix.config.build_type }} + cmake --install . + cmake --build . --target test_install diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2f8e3a892a5..3f15c3399fb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,6 +2,7 @@ stages: - init-status - sync - trigger_pipeline + - configure - build - test - code_quality @@ -90,6 +91,27 @@ trigger_pipeline: echo "Can not find the corresponding Pull Request" fi +configure/cmake-3.16: + extends: + - .quick_test_condition + - .configure_template + - .use_gko-rocm45-nompi-gnu8-llvm8 + variables: + BUILD_CUDA: "OFF" + BUILD_HIP: "ON" + BUILD_SYCL: "OFF" + BUILD_MPI: "ON" + +configure/cmake-3.18: + extends: + - .quick_test_condition + - .configure_template + - .use_gko-cuda102-nompi-gnu8-llvm8-intel2019 + variables: + BUILD_CUDA: "ON" + BUILD_HIP: "OFF" + BUILD_SYCL: "OFF" + BUILD_MPI: "OFF" # Build jobs # Job with example runs. @@ -101,12 +123,7 @@ build/cuda110/mvapich2/gcc/cuda/debug/shared: - .quick_test_condition - .use_gko-cuda110-mvapich2-gnu9-llvm9-intel2020 variables: - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - BUILD_MPI: "ON" - BUILD_TYPE: "Debug" - FAST_TESTS: "ON" - NONDEFAULT_STREAM: "ON" + CI_CMAKE_PRESET: "ci-cuda+omp-gcc-mpi-debug-fasttest-nondefault_stream" CUDA_ARCH: 80 USE_NAME: "cuda110-mvapich2-gcc-${CI_PIPELINE_ID}" KEEP_CONTAINER: "ON" @@ -134,11 +151,7 @@ build/cuda110/nompi/clang/cuda/release/static: - .full_test_condition - .use_gko-cuda110-mvapich2-gnu9-llvm9-intel2020 variables: - CXX_COMPILER: "clang++" - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - BUILD_TYPE: "Release" - BUILD_SHARED_LIBS: "OFF" + CI_CMAKE_PRESET: "ci-cuda+omp-clang-nompi-release-static" CUDA_ARCH: 80 USE_NAME: "cuda110-nompi-clang-${CI_PIPELINE_ID}" KEEP_CONTAINER: "ON" @@ -157,7 +170,7 @@ test/cuda110/nompi/clang/cuda/release/static: SLURM_TIME: "01:30:00" dependencies: null needs: [ "build/cuda110/nompi/clang/cuda/release/static" ] - + build/cuda110/nompi/clang/cuda/release/shared: extends: @@ -166,14 +179,8 @@ build/cuda110/nompi/clang/cuda/release/shared: - .quick_test_condition - .use_gko-cuda110-mvapich2-gnu9-llvm9-intel2020 variables: - CXX_COMPILER: "clang++" + CI_CMAKE_PRESET: "ci-cuda+omp-clang-nompi-release-fasttest-shared" CUDA_ARCH: 52 - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - BUILD_TYPE: "Release" - FAST_TESTS: "ON" - # disable spurious unused argument warning - EXTRA_CMAKE_FLAGS: "-DCMAKE_CUDA_FLAGS=-diag-suppress=177" # cuda 11.4 and friends @@ -184,14 +191,7 @@ build/cuda114/nompi/gcc/cuda/debug/shared: - .quick_test_condition - .use_gko_cuda114-openmpi-gnu10-llvm12 variables: - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - BUILD_TYPE: "Debug" - FAST_TESTS: "ON" - # fix gtest issue https://github.com/google/googletest/issues/3514 - CXX_FLAGS: "-Wno-error=maybe-uninitialized" - # disable spurious unused argument warning - EXTRA_CMAKE_FLAGS: "-DCMAKE_CUDA_FLAGS=-diag-suppress=177" + CI_CMAKE_PRESET: "ci-cuda+omp-gcc-nompi-debug-fasttest" # nvhpc and friends @@ -202,17 +202,7 @@ build/nvhpc233/cuda120/nompi/nvcpp/release/static: - .quick_test_condition - .use_gko_nvhpc233-cuda120-openmpi-gnu12-llvm16 variables: - CXX_COMPILER: "nvc++" - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - BUILD_MPI: "OFF" - BUILD_TYPE: "Release" - FAST_TESTS: "ON" - BUILD_SHARED_LIBS: "OFF" - # disable common gflags warnings - CXX_FLAGS: "--diag_suppress=useless_using_declaration,declared_but_not_referenced" - # disable spurious unused argument warning - EXTRA_CMAKE_FLAGS: "-DCMAKE_CUDA_FLAGS=-diag-suppress=177" + CI_CMAKE_PRESET: "ci-cuda+omp-nvhpc-nompi-release-static-fasttest" build/nvhpc227/cuda117/nompi/nvcpp/debug/shared: extends: @@ -221,16 +211,7 @@ build/nvhpc227/cuda117/nompi/nvcpp/debug/shared: - .quick_test_condition - .use_gko_nvhpc227-cuda117-openmpi-gnu11-llvm14 variables: - CXX_COMPILER: "nvc++" - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - BUILD_MPI: "OFF" - BUILD_TYPE: "Debug" - FAST_TESTS: "ON" - # disable common gflags warnings - CXX_FLAGS: "--diag_suppress=useless_using_declaration,declared_but_not_referenced" - # disable spurious unused argument warning - EXTRA_CMAKE_FLAGS: "-DCMAKE_CUDA_FLAGS=-diag-suppress=177" + CI_CMAKE_PRESET: "ci-cuda+omp-nvhpc-nompi-debug-fasttest" # ROCm 4.5 and friends build/amd/nompi/gcc/rocm45/release/shared: @@ -240,11 +221,7 @@ build/amd/nompi/gcc/rocm45/release/shared: - .quick_test_condition - .use_gko-rocm45-nompi-gnu8-llvm8 variables: - BUILD_OMP: "ON" - BUILD_HIP: "ON" - NONDEFAULT_STREAM: "ON" - BUILD_TYPE: "Release" - BUILD_HWLOC: "OFF" + CI_CMAKE_PRESET: "ci-hip+omp-gcc-nompi-release-fasttest-nondefault_stream" build/amd/nompi/clang/rocm45/release/static: extends: @@ -253,11 +230,7 @@ build/amd/nompi/clang/rocm45/release/static: - .full_test_condition - .use_gko-rocm45-nompi-gnu8-llvm8 variables: - CXX_COMPILER: "clang++" - BUILD_OMP: "ON" - BUILD_HIP: "ON" - BUILD_TYPE: "Release" - BUILD_SHARED_LIBS: "OFF" + CI_CMAKE_PRESET: "ci-hip+omp-clang-nompi-release-static" build/amd/nompi/clang/rocm45/debug/shared: extends: @@ -266,10 +239,7 @@ build/amd/nompi/clang/rocm45/debug/shared: - .quick_test_condition - .use_gko-rocm45-nompi-gnu8-llvm8 variables: - CXX_COMPILER: "clang++" - BUILD_OMP: "ON" - BUILD_HIP: "ON" - BUILD_TYPE: "Debug" + CI_CMAKE_PRESET: "ci-hip+omp-clang-nompi-debug" # ROCm 5.1.4 and friends build/amd/nompi/gcc/rocm514/debug/static: @@ -279,10 +249,7 @@ build/amd/nompi/gcc/rocm514/debug/static: - .full_test_condition - .use_gko-rocm514-nompi-gnu11-llvm11 variables: - BUILD_OMP: "ON" - BUILD_HIP: "ON" - BUILD_TYPE: "Debug" - BUILD_SHARED_LIBS: "OFF" + CI_CMAKE_PRESET: "ci-hip+omp-gcc-nompi-debug-static" build/amd/nompi/clang/rocm514/release/shared: extends: @@ -291,10 +258,7 @@ build/amd/nompi/clang/rocm514/release/shared: - .quick_test_condition - .use_gko-rocm514-nompi-gnu11-llvm11 variables: - CXX_COMPILER: "clang++" - BUILD_OMP: "ON" - BUILD_HIP: "ON" - BUILD_TYPE: "Release" + CI_CMAKE_PRESET: "ci-hip+omp-clang-nompi-release" # without omp build/amd/nompi/gcc/rocm514_wo_omp/release/shared: @@ -304,10 +268,7 @@ build/amd/nompi/gcc/rocm514_wo_omp/release/shared: - .full_test_condition - .use_gko-rocm514-nompi-gnu11-llvm11 variables: - BUILD_OMP: "OFF" - BUILD_MPI: "OFF" - BUILD_HIP: "ON" - BUILD_TYPE: "Release" + CI_CMAKE_PRESET: "ci-hip-gcc-nompi-release" # no cuda but latest gcc and clang build/nocuda/nompi/gcc/core/debug/static: @@ -317,10 +278,7 @@ build/nocuda/nompi/gcc/core/debug/static: - .quick_test_condition - .use_gko-nocuda-nompi-gnu9-llvm8 variables: - BUILD_TYPE: "Debug" - FAST_TESTS: "ON" - BUILD_SHARED_LIBS: "OFF" - BUILD_HWLOC: "OFF" + CI_CMAKE_PRESET: "ci-ref-gcc-nompi-debug-static-fasttest" build/nocuda/nompi/clang/core/release/shared: extends: @@ -329,8 +287,7 @@ build/nocuda/nompi/clang/core/release/shared: - .quick_test_condition - .use_gko-nocuda-nompi-gnu9-llvm8 variables: - CXX_COMPILER: "clang++" - BUILD_TYPE: "Release" + CI_CMAKE_PRESET: "ci-ref-clang-nompi-release" build/nocuda/nompi/gcc/omp/release/shared: extends: @@ -339,8 +296,7 @@ build/nocuda/nompi/gcc/omp/release/shared: - .quick_test_condition - .use_gko-nocuda-nompi-gnu9-llvm8 variables: - BUILD_OMP: "ON" - BUILD_TYPE: "Release" + CI_CMAKE_PRESET: "ci-omp-gcc-nompi-release" build/nocuda/openmpi/clang/omp/debug/static: extends: @@ -349,13 +305,7 @@ build/nocuda/openmpi/clang/omp/debug/static: - .full_test_condition - .use_gko-nocuda-openmpi-gnu9-llvm8 variables: - CXX_COMPILER: "clang++" - BUILD_OMP: "ON" - MPI_AS_ROOT: "ON" - BUILD_MPI: "ON" - BUILD_TYPE: "Debug" - FAST_TESTS: "ON" - BUILD_SHARED_LIBS: "OFF" + CI_CMAKE_PRESET: "ci-omp-clang-mpi-debug-static-fasttest" build/nocuda/openmpi/clang/omp/glibcxx-debug-release/shared: extends: @@ -364,13 +314,7 @@ build/nocuda/openmpi/clang/omp/glibcxx-debug-release/shared: - .quick_test_condition - .use_gko-nocuda-nompi-gnu9-llvm8 variables: - CXX_COMPILER: "clang++" - BUILD_OMP: "ON" - MPI_AS_ROOT: "ON" - BUILD_MPI: "ON" - CXX_FLAGS: "-Wpedantic -D_GLIBCXX_DEBUG=1" - # The tests are prohibitively slow in Debug - BUILD_TYPE: "Release" + CI_CMAKE_PRESET: "ci-omp-clang-mpi-glibcxx+debug-release" # nocuda with old compiler build/nocuda/nompi/gcc/omp/release/static: @@ -380,9 +324,7 @@ build/nocuda/nompi/gcc/omp/release/static: - .quick_test_condition - .use_gko-nocuda-nompi-gnu9-llvm8 variables: - BUILD_OMP: "ON" - BUILD_TYPE: "Release" - BUILD_SHARED_LIBS: "OFF" + CI_CMAKE_PRESET: "ci-omp-gcc-nompi-release-static" build/nocuda-nomixed/nompi/clang/omp/release/static: extends: @@ -391,11 +333,7 @@ build/nocuda-nomixed/nompi/clang/omp/release/static: - .full_test_condition - .use_gko-nocuda-nompi-gnu9-llvm8 variables: - CXX_COMPILER: "clang++" - BUILD_OMP: "ON" - BUILD_TYPE: "Release" - BUILD_SHARED_LIBS: "OFF" - MIXED_PRECISION: "OFF" + CI_CMAKE_PRESET: "ci-omp-clang-nompi-release-static-nomixed" build/nocuda-nomixed/openmpi/gcc/omp/release/shared: extends: @@ -404,11 +342,7 @@ build/nocuda-nomixed/openmpi/gcc/omp/release/shared: - .quick_test_condition - .use_gko-nocuda-nompi-gnu9-llvm8 variables: - BUILD_MPI: "ON" - MPI_AS_ROOT: "ON" - BUILD_OMP: "ON" - BUILD_TYPE: "Release" - MIXED_PRECISION: "OFF" + CI_CMAKE_PRESET: "ci-omp-gcc-mpi-release-nomixed" build/nocuda-nomixed/nompi/clang/omp/debug/static: extends: @@ -417,11 +351,7 @@ build/nocuda-nomixed/nompi/clang/omp/debug/static: - .full_test_condition - .use_gko-nocuda-nompi-gnu9-llvm8 variables: - CXX_COMPILER: "clang++" - BUILD_OMP: "ON" - BUILD_TYPE: "Debug" - BUILD_SHARED_LIBS: "OFF" - MIXED_PRECISION: "OFF" + CI_CMAKE_PRESET: "ci-omp-clang-nompi-debug-static-nomixed" # spack oneapi 2023.1 build/icpx20231/igpu/release/shared: @@ -431,14 +361,8 @@ build/icpx20231/igpu/release/shared: - .quick_test_condition - .use_gko-oneapi20231-igpu variables: - CXX_COMPILER: "icpx" - CXX_FLAGS: "-Wpedantic -ffp-model=precise" - BUILD_SYCL: "ON" - BUILD_TYPE: "Release" - BUILD_SHARED_LIBS: "ON" - DPCPP_SINGLE_MODE: "ON" + CI_CMAKE_PRESET: "ci-sycl-icpx-nompi-release-shared-singlemode" ONEAPI_DEVICE_SELECTOR: "opencl:gpu" - BUILD_HWLOC: "OFF" # TODO: Enable when debug shared library size issues are fixed # build/dpcpp/level_zero_igpu/debug/shared: @@ -464,14 +388,8 @@ build/icpx/igpu/release/static: - .full_test_condition - .use_gko-oneapi-igpu variables: - CXX_COMPILER: "dpcpp" - CXX_FLAGS: "-Wpedantic -ffp-model=precise" - BUILD_SYCL: "ON" - BUILD_TYPE: "Release" - BUILD_SHARED_LIBS: "OF" - DPCPP_SINGLE_MODE: "ON" + CI_CMAKE_PRESET: "ci-sycl-dpcpp-nompi-release-static-singlemode" ONEAPI_DEVICE_SELECTOR: "*:gpu" - BUILD_HWLOC: "OFF" # windows jobs # Note that this is using Powershell, not bash @@ -484,7 +402,7 @@ build/windows-cuda/release/shared: - if (Test-Path install) { rm -r -fo install } - mkdir build - mkdir install - - cmake -B build -DBUILD_SHARED_LIBS=ON -DGINKGO_BUILD_CUDA=ON "-DCMAKE_INSTALL_PREFIX=$pwd\install" . + - cmake -B build --preset "ci-cuda-msvc-nompi-release-shared" "-DCMAKE_INSTALL_PREFIX=$pwd\install" . - cmake --build build --config Release -j16 # we disable these tests until the triangular solver issues are resolved # - ctest --test-dir build -C Release --no-tests=error --output-on-failure @@ -503,7 +421,7 @@ build/windows/release/shared: - if (Test-Path install) { rm -r -fo install } - mkdir build - mkdir install - - cmake -B build -DBUILD_SHARED_LIBS=ON -DGINKGO_BUILD_CUDA=OFF "-DCMAKE_INSTALL_PREFIX=$pwd\install" . + - cmake -B build --preset "ci-ref-msvc-nompi-release" "-DCMAKE_INSTALL_PREFIX=$pwd\install" . - cmake --build build --config Release -j16 - ctest --test-dir build -C Release --no-tests=error --output-on-failure -j16 - $env:PATH+=";$pwd/install/bin" @@ -521,9 +439,7 @@ warnings: - .full_test_condition - .use_gko-cuda110-mvapich2-gnu9-llvm9-intel2020 variables: - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - CXX_FLAGS: "-Werror=pedantic -pedantic-errors" + CI_CMAKE_PRESET: "ci-warnings" allow_failure: yes # Ensure kernel modules do not depend on core @@ -535,9 +451,7 @@ no-circular-deps: - .quick_test_condition - .use_gko-cuda110-mvapich2-gnu9-llvm9-intel2020 variables: - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - EXTRA_CMAKE_FLAGS: '-DGINKGO_CHECK_CIRCULAR_DEPS=on' + CI_CMAKE_PRESET: "ci-no_circular_deps" allow_failure: no # Ensure Ginkgo builds from a subdirectory @@ -549,8 +463,7 @@ subdir-build: - .full_test_condition - .use_gko-nocuda-nompi-gnu9-llvm8 variables: - BUILD_OMP: "ON" - CI_PROJECT_PATH_SUFFIX: "/test_subdir" + CI_CMAKE_PRESET: "ci-subdir_build" allow_failure: no # Run clang-tidy and iwyu @@ -562,9 +475,7 @@ clang-tidy: - .full_test_condition - .use_gko-cuda110-mvapich2-gnu9-llvm9-intel2020 variables: - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - EXTRA_CMAKE_FLAGS: '-DGINKGO_WITH_CLANG_TIDY=ON' + CI_CMAKE_PRESET: "ci-clang_tidy" allow_failure: yes iwyu: @@ -575,9 +486,7 @@ iwyu: - .full_test_condition - .use_gko-cuda110-mvapich2-gnu9-llvm9-intel2020 variables: - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - EXTRA_CMAKE_FLAGS: '-DGINKGO_WITH_IWYU=ON' + CI_CMAKE_PRESET: "ci-iwyu" allow_failure: yes # Code analysis, coverage and reporting tool @@ -769,12 +678,7 @@ benchmark-cuda-spmv-build: - .benchmark-spmv-cuda-rules stage: benchmark-build variables: - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - BUILD_MPI: "ON" - MPI_AS_ROOT: "ON" - BUILD_HIP: "OFF" - BUILD_TYPE: "Release" + CI_CMAKE_PRESET: "ci-cuda+omp-gcc-mpi-release-shared" CUDA_ARCH: 80 USE_NAME: "benchmark-cuda-spmv-${CI_PIPELINE_ID}" KEEP_CONTAINER: "ON" diff --git a/.gitlab/scripts.yml b/.gitlab/scripts.yml index dda127ff535..af32f61701f 100644 --- a/.gitlab/scripts.yml +++ b/.gitlab/scripts.yml @@ -15,6 +15,49 @@ - git config --global user.name "${BOT_USER}" - git config --global user.email "${BOT_EMAIL}" +.environment_script: &environment_script + - | + # extracts the value of the given CMake cache variable + function get_cache_val() { + cmake -S ${CI_PROJECT_DIR}${CI_PROJECT_DIR_SUFFIX} -B . -L -N | grep $1 | sed -e 's/.*=//' + } + - if [ -n "${CUDA_ARCH}" ]; then + export CUDA_ARCH_STR=-DGINKGO_CUDA_ARCHITECTURES=${CUDA_ARCH}; + fi + - | + export OMPI_ALLOW_RUN_AS_ROOT=1; + export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1; + - export CC=${C_COMPILER} CXX=${CXX_COMPILER} CUDAHOSTCXX=${CXX_COMPILER} CUDACXX=${CUDA_COMPILER} + + +.configure_template: + stage: configure + extends: + - .before_script_template + script: + - mkdir -p ${CI_JOB_NAME} && cd ${CI_JOB_NAME} + - *environment_script + - | + apt update + apt install -y python3-pip python3-venv doxygen + python3 -m pip install pipx + pipx install pre-commit + export PATH=$HOME/.local/bin:$PATH + - | + cmake -S ${CI_PROJECT_DIR}${CI_PROJECT_DIR_SUFFIX} -B . \ + -DGINKGO_BUILD_REFERENCE=ON -DGINKGO_BUILD_OMP=ON \ + -DGINKGO_BUILD_MPI=${BUILD_MPI} -DGINKGO_BUILD_CUDA=${BUILD_CUDA} \ + -DGINKGO_BUILD_HIP=${BUILD_HIP} -DGINKGO_BUILD_SYCL=${BUILD_SYCL} \ + -DGINKGO_MIXED_PRECISION=ON -DGINKGO_FORCE_GPU_AWARE_MPI=ON \ + -DGINKGO_BUILD_TESTS=ON -DGINKGO_FAST_TESTS=ON -DGINKGO_BUILD_EXTLIB_EXAMPLE=OFF \ + -DGINKGO_BUILD_BENCHMARKS=ON -DGINKGO_BENCHMARK_ENABLE_TUNING=ON \ + -DGINKGO_DEVEL_TOOLS=OFF -DGINKGO_WITH_CLANG_TIDY=ON -DGINKGO_WITH_IWYU=ON \ + -DGINKGO_CHECK_CIRCULAR_DEPS=ON -DGINKGO_WITH_CCACHE=ON \ + -DGINKGO_BUILD_PAPI_SDE=OFF -DGINKGO_BUILD_HWLOC=ON \ + -DGINKGO_BUILD_TESTS=ON -DGINKGO_BUILD_EXAMPLES=ON \ + -DGINKGO_BUILD_DOC=ON + dependencies: [] + .build_template: stage: build extends: @@ -23,35 +66,8 @@ - mkdir -p ${CI_JOB_NAME} && cd ${CI_JOB_NAME} - mkdir install_prefix - export INSTALL_PREFIX=`pwd`/install_prefix - - if [ -n "${CUDA_ARCH}" ]; then - export CUDA_ARCH_STR=-DGINKGO_CUDA_ARCHITECTURES=${CUDA_ARCH}; - fi - - if [[ "${MPI_AS_ROOT}" == "ON" ]];then - export OMPI_ALLOW_RUN_AS_ROOT=1; - export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1; - fi - - if [[ "${BUILD_MPI}" == "ON" ]]; then - MPI_STR=-DGINKGO_MPI_EXEC_SUFFIX=${MPI_SUFFIX}; - fi - - export CXX=${CXX_COMPILER} CUDAHOSTCXX=${CXX_COMPILER} CUDACXX=${CUDA_COMPILER} - - cmake ${CI_PROJECT_DIR}${CI_PROJECT_DIR_SUFFIX} - -GNinja - -DCMAKE_BUILD_TYPE=${BUILD_TYPE} - -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} - -DCMAKE_CXX_FLAGS="${CXX_FLAGS}" -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} - ${EXTRA_CMAKE_FLAGS} ${CUDA_ARCH_STR} - -DGINKGO_DEVEL_TOOLS=OFF -DGINKGO_BUILD_REFERENCE=${BUILD_REFERENCE} - -DGINKGO_BUILD_OMP=${BUILD_OMP} -DGINKGO_BUILD_CUDA=${BUILD_CUDA} - -DGINKGO_BUILD_HIP=${BUILD_HIP} -DGINKGO_BUILD_SYCL=${BUILD_SYCL} - -DGINKGO_BUILD_MPI=${BUILD_MPI} ${MPI_STR} - -DGINKGO_BUILD_HWLOC=${BUILD_HWLOC} - -DGINKGO_BUILD_PAPI_SDE=${BUILD_PAPI_SDE} - -DGINKGO_BUILD_TESTS=ON -DGINKGO_BUILD_EXAMPLES=ON - -DGINKGO_FAST_TESTS=${FAST_TESTS} - -DGINKGO_TEST_NONDEFAULT_STREAM=${NONDEFAULT_STREAM} - -DGINKGO_MIXED_PRECISION=${MIXED_PRECISION} - -DGINKGO_CONFIG_LOG_DETAILED=${CONFIG_LOG} - -DGINKGO_DPCPP_SINGLE_MODE=${DPCPP_SINGLE_MODE} + - *environment_script + - cmake -S ${CI_PROJECT_DIR}${CI_PROJECT_DIR_SUFFIX} -B . --preset ${CI_CMAKE_PRESET} -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} - ninja -j${NUM_CORES} -l${CI_LOAD_LIMIT} install - awk '!/^#/ { print ($2 - $1)/1000 " " $4 }' .ninja_log | sort -nr dependencies: [] @@ -64,36 +80,8 @@ - mkdir -p ${CI_JOB_NAME} && cd ${CI_JOB_NAME} - mkdir install_prefix - export INSTALL_PREFIX=`pwd`/install_prefix - - if [ -n "${CUDA_ARCH}" ]; then - export CUDA_ARCH_STR=-DGINKGO_CUDA_ARCHITECTURES=${CUDA_ARCH}; - fi - - if [ -n "${SYCL_DEVICE_TYPE}" ]; then export SYCL_DEVICE_TYPE; fi - - if [ -n "${SYCL_DEVICE_FILTER}" ]; then export SYCL_DEVICE_FILTER; fi - - if [ -n "${ONEAPI_DEVICE_SELECTOR}" ]; then export ONEAPI_DEVICE_SELECTOR; fi - - if [[ "${MPI_AS_ROOT}" == "ON" ]];then - export OMPI_ALLOW_RUN_AS_ROOT=1; - export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1; - fi - - if [[ "${BUILD_MPI}" == "ON" ]]; then - MPI_STR=-DGINKGO_MPI_EXEC_SUFFIX=${MPI_SUFFIX}; - fi - - export CXX=${CXX_COMPILER} CUDAHOSTCXX=${CXX_COMPILER} CUDACXX=${CUDA_COMPILER} - - cmake ${CI_PROJECT_DIR}${CI_PROJECT_DIR_SUFFIX} - -GNinja -DCMAKE_BUILD_TYPE=${BUILD_TYPE} - -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} - -DCMAKE_CXX_FLAGS="${CXX_FLAGS}" -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} - ${EXTRA_CMAKE_FLAGS} ${CUDA_ARCH_STR} - -DGINKGO_DEVEL_TOOLS=OFF -DGINKGO_BUILD_REFERENCE=${BUILD_REFERENCE} - -DGINKGO_BUILD_OMP=${BUILD_OMP} -DGINKGO_BUILD_CUDA=${BUILD_CUDA} - -DGINKGO_BUILD_HIP=${BUILD_HIP} -DGINKGO_BUILD_SYCL=${BUILD_SYCL} - -DGINKGO_BUILD_MPI=${BUILD_MPI} ${MPI_STR} - -DGINKGO_BUILD_HWLOC=${BUILD_HWLOC} - -DGINKGO_BUILD_PAPI_SDE=${BUILD_PAPI_SDE} - -DGINKGO_BUILD_TESTS=ON -DGINKGO_BUILD_EXAMPLES=ON - -DGINKGO_FAST_TESTS=${FAST_TESTS} - -DGINKGO_MIXED_PRECISION=${MIXED_PRECISION} - -DGINKGO_CONFIG_LOG_DETAILED=${CONFIG_LOG} - -DGINKGO_DPCPP_SINGLE_MODE=${DPCPP_SINGLE_MODE} + - *environment_script + - cmake -S ${CI_PROJECT_DIR}${CI_PROJECT_DIR_SUFFIX} -B . --preset ${CI_CMAKE_PRESET} -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} - ninja -j${NUM_CORES} -l${CI_LOAD_LIMIT} install - awk '!/^#/ { print ($2 - $1)/1000 " " $4 }' .ninja_log | sort -nr - | @@ -104,9 +92,31 @@ - pushd test/test_install - ninja install - popd + - | + if [ "$(get_cache_val GINKGO_RUN_EXAMPLES)" == "ON" ]; then + export EX_ARG="reference" + ninja run_all_examples + ninja validate_all_examples + if [ "$(get_cache_val GINKGO_BUILD_OMP)" == "ON" ]; then + export EX_ARG="omp" + ninja run_all_examples + ninja validate_all_examples + fi + if [ "$(get_cache_val GINKGO_BUILD_CUDA)" == "ON" ]; then + export EX_ARG="cuda" + ninja run_all_examples + ninja validate_all_examples + fi + if [ "$(get_cache_val GINKGO_BUILD_HIP)" == "ON" ]; then + export EX_ARG="hip" + ninja run_all_examples + ninja validate_all_examples + fi + fi - if [ -n "${SYCL_DEVICE_TYPE}" ]; then unset SYCL_DEVICE_TYPE; fi - if [ -n "${SYCL_DEVICE_FILTER}" ]; then unset SYCL_DEVICE_FILTER; fi - - if [[ "${BUILD_SHARED_LIBS}" == "ON" || "${BUILD_HIP}" != "ON" ]]; then + - if [ "$(get_cache_val GINKGO_EXPORT_BUILD_DIR)" == "ON" ]; then ninja test_exportbuild; fi + - if [[ "$(get_cache_val BUILD_SHARED_LIBS)" == "ON" || "$(get_cache_val GINKGO_BUILD_HIP)" != "ON" ]]; then PKG_CONFIG_PATH=${INSTALL_PREFIX}/lib/pkgconfig:$PKG_CONFIG_PATH LD_LIBRARY_PATH=${INSTALL_PREFIX}/lib:$LD_LIBRARY_PATH ninja test_pkgconfig; fi dependencies: [] From e4c1dba8e912dbdd63fc43b483c4b856f91ccd5c Mon Sep 17 00:00:00 2001 From: Marcel Koch Date: Tue, 30 Jan 2024 16:52:34 +0000 Subject: [PATCH 08/18] fixup! add CI presets --- CMakePresets.json | 2 +- CMakeCIPresets.json => cmake/presets/ci.json | 32 +++++++++++--------- 2 files changed, 19 insertions(+), 15 deletions(-) rename CMakeCIPresets.json => cmake/presets/ci.json (95%) diff --git a/CMakePresets.json b/CMakePresets.json index cbf3b783990..faea25b3c7f 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -1,6 +1,6 @@ { "version": 4, - "include": ["CMakeCIPresets.json"], + "include": ["cmake/presets/ci.json"], "configurePresets": [ { "name": "base", diff --git a/CMakeCIPresets.json b/cmake/presets/ci.json similarity index 95% rename from CMakeCIPresets.json rename to cmake/presets/ci.json index 5b2863bb47e..87049517d49 100644 --- a/CMakeCIPresets.json +++ b/cmake/presets/ci.json @@ -11,7 +11,7 @@ }, "cacheVariables": { "CMAKE_CXX_FLAGS": "", - "GINKGO_BUILD_SHARED_LIBS": "ON", + "BUILD_SHARED_LIBS": "ON", "GINKGO_BUILD_REFERENCE": "ON", "GINKGO_BUILD_OMP": "OFF", "GINKGO_BUILD_CUDA": "OFF", @@ -177,7 +177,7 @@ "base-ci" ], "cacheVariables": { - "GINKGO_BUILD_SHARED_LIBS": "OFF" + "BUILD_SHARED_LIBS": "OFF" } }, { @@ -221,7 +221,7 @@ ], "cacheVariables": { "GINKGO_FAST_TESTS": "ON", - "GINKGO_BUILD_SHARED_LIBS": "OFF" + "BUILD_SHARED_LIBS": "OFF" } }, { @@ -256,7 +256,7 @@ "base-ci" ], "cacheVariables": { - "GINKGO_BUILD_SHARED_LIBS": "OFF", + "BUILD_SHARED_LIBS": "OFF", "GINKGO_RUN_EXAMPLES": "ON" } }, @@ -307,7 +307,7 @@ "ci-hip+omp-clang-nompi-release" ], "cacheVariables": { - "GINKGO_BUILD_SHARED_LIBS": "OFF", + "BUILD_SHARED_LIBS": "OFF", "GINKGO_RUN_EXAMPLES": "ON" } }, @@ -340,7 +340,7 @@ ], "cacheVariables": { "GINKGO_FAST_TESTS": "ON", - "GINKGO_BUILD_SHARED_LIBS": "OFF" + "BUILD_SHARED_LIBS": "OFF" } }, { @@ -359,7 +359,7 @@ "ci-ref-msvc-nompi-release" ], "cacheVariables": { - "GINKGO_BUILD_SHARED_LIBS": "OFF" + "BUILD_SHARED_LIBS": "OFF" } }, { @@ -372,7 +372,7 @@ "base-ci" ], "cacheVariables": { - "GINKGO_BUILD_SHARED_LIBS": "OFF", + "BUILD_SHARED_LIBS": "OFF", "GINKGO_FAST_TESTS": "ON" } }, @@ -398,6 +398,7 @@ "enable-debug", "base-ci" ], + "generator": "Unix Makefiles", "cacheVariables": { "GINKGO_MIXED_PRECISION": "OFF" } @@ -408,7 +409,7 @@ "ci-omp-clang-nompi-debug-nomixed" ], "cacheVariables": { - "GINKGO_BUILD_SHARED_LIBS": "OFF" + "BUILD_SHARED_LIBS": "OFF" } }, { @@ -420,8 +421,9 @@ "enable-release", "base-ci" ], + "generator": "Unix Makefiles", "cacheVariables": { - "GINKGO_BUILD_SHARED_LIBS": "OFF" + "BUILD_SHARED_LIBS": "OFF" } }, { @@ -448,7 +450,7 @@ "ci-omp-gcc-nompi-release" ], "cacheVariables": { - "GINKGO_BUILD_SHARED_LIBS": "OFF" + "BUILD_SHARED_LIBS": "OFF" } }, { @@ -474,7 +476,7 @@ "base-ci" ], "cacheVariables": { - "GINKGO_BUILD_SHARED_LIBS": "OFF" + "BUILD_SHARED_LIBS": "OFF" } }, { @@ -495,7 +497,8 @@ "enable-mpi", "enable-release", "base-ci" - ] + ], + "generator": "Unix Makefiles" }, { "name": "ci-sycl-dpcpp-nompi-release-static-singlemode", @@ -503,7 +506,7 @@ "ci-sycl-dpcpp-nompi-release-singlemode" ], "cacheVariables": { - "GINKGO_BUILD_SHARED_LIBS": "OFF" + "BUILD_SHARED_LIBS": "OFF" } }, { @@ -511,6 +514,7 @@ "inherits": [ "ci-sycl-icpx-nompi-release-singlemode" ], + "generator": "Unix Makefiles", "cacheVariables": { "GINKGO_MIXED_PRECISION": "OFF" } From 2735b8ef0912bd61f7742a107cc4f75f9ed22a43 Mon Sep 17 00:00:00 2001 From: Marcel Koch Date: Tue, 30 Jan 2024 16:53:37 +0000 Subject: [PATCH 09/18] fixup! add base CMakePresets.json --- CMakePresets.json | 54 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 46 insertions(+), 8 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index faea25b3c7f..2740e2860e2 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -5,9 +5,37 @@ { "name": "base", "hidden": true, - "generator": "Ninja", "binaryDir": "${sourceDir}/build-${presetName}" }, + { + "name": "base-dev", + "hidden": true, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "GINKGO_DEVEL_TOOLS": "ON", + "CMAKE_EXPORT_COMPILE_COMMANDS": "ON", + "CMAKE_COLOR_DIAGNOSTICS": "ON", + "CMAKE_LINK_DEPENDS_NO_SHARED": "ON" + }, + "warnings": { + "dev": true, + "deprecated": true, + "uninitialized": true + } + }, + { + "name": "base-dev-gcc-like", + "hidden": true, + "generator": "Ninja", + "cacheVariables": { + "CMAKE_CXX_FLAGS": "$env{CXXFLAGS} -g -fno-omit-frame-pointer -Wpedantic -Wall -Wextra -Wconversion -Wunused" + }, + "condition": { + "type": "notEquals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } + }, { "name": "release", "inherits": "base", @@ -19,19 +47,29 @@ } }, { - "name": "develop", - "inherits": "base", + "name": "develop-gcc", + "inherits": ["base", "base-dev", "base-dev-gcc-like"], "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug", - "CMAKE_CXX_FLAGS": "$env{CXXFLAGS} -Wpedantic" + "CMAKE_CXX_COMPILER": "g++" + } + }, + { + "name": "develop-clang", + "inherits": ["base", "base-dev", "base-dev-gcc-like"], + "cacheVariables": { + "CMAKE_CXX_COMPILER": "clang++" } }, { "name": "develop-msvc", - "inherits": "base", + "inherits": ["base", "base-dev"], "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug", - "CMAKE_CXX_FLAGS": "$env{CXXFLAGS} /permissive-" + "CMAKE_CXX_FLAGS": "$env{CXXFLAGS} /permissive- /Oy-" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" } } ] From 7703c52062189b437b789c112f27a26c2f167847 Mon Sep 17 00:00:00 2001 From: Marcel Koch Date: Tue, 30 Jan 2024 16:54:31 +0000 Subject: [PATCH 10/18] fixup! use cmake presets in gitlab ci --- .gitlab/scripts.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.gitlab/scripts.yml b/.gitlab/scripts.yml index af32f61701f..30195e9f1b9 100644 --- a/.gitlab/scripts.yml +++ b/.gitlab/scripts.yml @@ -37,12 +37,6 @@ script: - mkdir -p ${CI_JOB_NAME} && cd ${CI_JOB_NAME} - *environment_script - - | - apt update - apt install -y python3-pip python3-venv doxygen - python3 -m pip install pipx - pipx install pre-commit - export PATH=$HOME/.local/bin:$PATH - | cmake -S ${CI_PROJECT_DIR}${CI_PROJECT_DIR_SUFFIX} -B . \ -DGINKGO_BUILD_REFERENCE=ON -DGINKGO_BUILD_OMP=ON \ @@ -55,7 +49,7 @@ -DGINKGO_CHECK_CIRCULAR_DEPS=ON -DGINKGO_WITH_CCACHE=ON \ -DGINKGO_BUILD_PAPI_SDE=OFF -DGINKGO_BUILD_HWLOC=ON \ -DGINKGO_BUILD_TESTS=ON -DGINKGO_BUILD_EXAMPLES=ON \ - -DGINKGO_BUILD_DOC=ON + -DGINKGO_BUILD_DOC=OFF dependencies: [] .build_template: From fd5326a8badcb7450d2a8752a03e8209357c8e09 Mon Sep 17 00:00:00 2001 From: Marcel Koch Date: Tue, 13 Aug 2024 17:07:57 +0200 Subject: [PATCH 11/18] fixup! add CI presets --- cmake/presets/ci.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/presets/ci.json b/cmake/presets/ci.json index 87049517d49..d9dfdc4965f 100644 --- a/cmake/presets/ci.json +++ b/cmake/presets/ci.json @@ -512,7 +512,7 @@ { "name": "ci-sycl-icpx-nompi-release-singlemode-nomixed", "inherits": [ - "ci-sycl-icpx-nompi-release-singlemode" + "ci-sycl-icpx-nompi-release-shared-singlemode" ], "generator": "Unix Makefiles", "cacheVariables": { From c5f535daa9352e1aa5c9f0cd21266675c0ab1ab8 Mon Sep 17 00:00:00 2001 From: Marcel Koch Date: Tue, 13 Aug 2024 17:08:04 +0200 Subject: [PATCH 12/18] fixup! add base CMakePresets.json --- CMakePresets.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 2740e2860e2..e9a5aee3fc0 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -19,8 +19,7 @@ }, "warnings": { "dev": true, - "deprecated": true, - "uninitialized": true + "deprecated": true } }, { @@ -64,6 +63,7 @@ "name": "develop-msvc", "inherits": ["base", "base-dev"], "cacheVariables": { + "CMAKE_CXX_COMPILER": "msvc", "CMAKE_CXX_FLAGS": "$env{CXXFLAGS} /permissive- /Oy-" }, "condition": { From 947fc6c9be71bb32d8ccb1654ec88e98ddaf1a94 Mon Sep 17 00:00:00 2001 From: Marcel Koch Date: Tue, 13 Aug 2024 17:23:02 +0200 Subject: [PATCH 13/18] fixup! use cmake presets in gitlab ci --- .gitlab/scripts.yml | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/.gitlab/scripts.yml b/.gitlab/scripts.yml index 30195e9f1b9..cd00478ee3e 100644 --- a/.gitlab/scripts.yml +++ b/.gitlab/scripts.yml @@ -86,27 +86,6 @@ - pushd test/test_install - ninja install - popd - - | - if [ "$(get_cache_val GINKGO_RUN_EXAMPLES)" == "ON" ]; then - export EX_ARG="reference" - ninja run_all_examples - ninja validate_all_examples - if [ "$(get_cache_val GINKGO_BUILD_OMP)" == "ON" ]; then - export EX_ARG="omp" - ninja run_all_examples - ninja validate_all_examples - fi - if [ "$(get_cache_val GINKGO_BUILD_CUDA)" == "ON" ]; then - export EX_ARG="cuda" - ninja run_all_examples - ninja validate_all_examples - fi - if [ "$(get_cache_val GINKGO_BUILD_HIP)" == "ON" ]; then - export EX_ARG="hip" - ninja run_all_examples - ninja validate_all_examples - fi - fi - if [ -n "${SYCL_DEVICE_TYPE}" ]; then unset SYCL_DEVICE_TYPE; fi - if [ -n "${SYCL_DEVICE_FILTER}" ]; then unset SYCL_DEVICE_FILTER; fi - if [ "$(get_cache_val GINKGO_EXPORT_BUILD_DIR)" == "ON" ]; then ninja test_exportbuild; fi From beadd1bbe1dd6da8daf9f82de050f29f4152b51a Mon Sep 17 00:00:00 2001 From: Marcel Koch Date: Tue, 13 Aug 2024 17:26:40 +0200 Subject: [PATCH 14/18] fixup! add CI presets --- cmake/presets/ci.json | 1 - 1 file changed, 1 deletion(-) diff --git a/cmake/presets/ci.json b/cmake/presets/ci.json index d9dfdc4965f..716768d869b 100644 --- a/cmake/presets/ci.json +++ b/cmake/presets/ci.json @@ -417,7 +417,6 @@ "inherits": [ "enable-openmp", "enable-clang", - "enable-mpi", "enable-release", "base-ci" ], From 93374ceeceec9ad9f53b6448f0f4498a31c8f6ce Mon Sep 17 00:00:00 2001 From: Marcel Koch Date: Wed, 14 Aug 2024 08:58:48 +0200 Subject: [PATCH 15/18] fixup! add CI presets --- cmake/presets/ci.json | 1 - 1 file changed, 1 deletion(-) diff --git a/cmake/presets/ci.json b/cmake/presets/ci.json index 716768d869b..2d05008aacd 100644 --- a/cmake/presets/ci.json +++ b/cmake/presets/ci.json @@ -394,7 +394,6 @@ "inherits": [ "enable-openmp", "enable-clang", - "enable-mpi", "enable-debug", "base-ci" ], From 583ab2f279ef30cf94d72636ce29ac82a2c897d3 Mon Sep 17 00:00:00 2001 From: Marcel Koch Date: Wed, 14 Aug 2024 09:02:48 +0200 Subject: [PATCH 16/18] fixup! add CI presets --- cmake/presets/ci.json | 90 +++++++++++++++++++++---------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/cmake/presets/ci.json b/cmake/presets/ci.json index 2d05008aacd..f0d2c5475c1 100644 --- a/cmake/presets/ci.json +++ b/cmake/presets/ci.json @@ -135,7 +135,7 @@ } }, { - "name": "ci-cuda-msvc-nompi-release", + "name": "ci/cuda/msvc/nompi/release", "inherits": [ "enable-cuda", "enable-msvc", @@ -144,7 +144,7 @@ ] }, { - "name": "ci-cuda+omp-gcc-mpi-release-shared", + "name": "ci/cuda+omp/gcc/mpi/release/shared", "inherits": [ "enable-cuda", "enable-openmp", @@ -154,7 +154,7 @@ ] }, { - "name": "ci-cuda+omp-gcc-mpi-debug-fasttest-nondefault_stream", + "name": "ci/cuda+omp/gcc/mpi/debug/fasttest/nondefault_stream", "inherits": [ "enable-cuda", "enable-openmp", @@ -168,7 +168,7 @@ } }, { - "name": "ci-cuda+omp-clang-nompi-release-static", + "name": "ci/cuda+omp/clang/nompi/release/static", "inherits": [ "enable-cuda", "enable-openmp", @@ -181,7 +181,7 @@ } }, { - "name": "ci-cuda+omp-clang-nompi-release-fasttest-shared", + "name": "ci/cuda+omp/clang/nompi/release/fasttest/shared", "inherits": [ "enable-cuda", "enable-openmp", @@ -196,7 +196,7 @@ } }, { - "name": "ci-cuda+omp-gcc-nompi-debug-fasttest", + "name": "ci/cuda+omp/gcc/nompi/debug/fasttest", "inherits": [ "enable-cuda", "enable-openmp", @@ -211,7 +211,7 @@ } }, { - "name": "ci-cuda+omp-nvhpc-nompi-release-static-fasttest", + "name": "ci/cuda+omp/nvhpc/nompi/release/static/fasttest", "inherits": [ "enable-cuda", "enable-openmp", @@ -225,7 +225,7 @@ } }, { - "name": "ci-cuda+omp-nvhpc-nompi-debug-fasttest", + "name": "ci/cuda+omp/nvhpc/nompi/debug/fasttest", "inherits": [ "enable-cuda", "enable-openmp", @@ -238,7 +238,7 @@ } }, { - "name": "ci-cuda-msvc-nompi-release-shared", + "name": "ci/cuda/msvc/nompi/release/shared", "inherits": [ "enable-cuda", "enable-msvc", @@ -247,7 +247,7 @@ ] }, { - "name": "ci-hip+omp-gcc-nompi-debug-static", + "name": "ci/hip+omp/gcc/nompi/debug/static", "inherits": [ "enable-hip", "enable-openmp", @@ -261,7 +261,7 @@ } }, { - "name": "ci-hip+omp-gcc-nompi-release-fasttest-nondefault_stream", + "name": "ci/hip+omp/gcc/nompi/release/fasttest/nondefault_stream", "inherits": [ "enable-hip", "enable-openmp", @@ -276,7 +276,7 @@ } }, { - "name": "ci-hip+omp-clang-nompi-debug", + "name": "ci/hip+omp/clang/nompi/debug", "inherits": [ "enable-hip", "enable-openmp", @@ -289,7 +289,7 @@ } }, { - "name": "ci-hip+omp-clang-nompi-release", + "name": "ci/hip+omp/clang/nompi/release", "inherits": [ "enable-hip", "enable-openmp", @@ -302,9 +302,9 @@ } }, { - "name": "ci-hip+omp-clang-nompi-release-static", + "name": "ci/hip+omp/clang/nompi/release/static", "inherits": [ - "ci-hip+omp-clang-nompi-release" + "ci/hip+omp/clang/nompi/release" ], "cacheVariables": { "BUILD_SHARED_LIBS": "OFF", @@ -312,7 +312,7 @@ } }, { - "name": "ci-hip-gcc-nompi-release", + "name": "ci/hip/gcc/nompi/release", "inherits": [ "enable-hip", "enable-gcc", @@ -324,7 +324,7 @@ } }, { - "name": "ci-ref-clang-nompi-release", + "name": "ci/ref/clang/nompi/release", "inherits": [ "enable-clang", "enable-release", @@ -332,7 +332,7 @@ ] }, { - "name": "ci-ref-gcc-nompi-debug-static-fasttest", + "name": "ci/ref/gcc/nompi/debug/static/fasttest", "inherits": [ "enable-clang", "enable-release", @@ -344,7 +344,7 @@ } }, { - "name": "ci-ref-msvc-nompi-release", + "name": "ci/ref/msvc/nompi/release", "generator": "Visual Studio 17 2022", "inherits": [ "enable-msvc", @@ -353,17 +353,17 @@ ] }, { - "name": "ci-ref-msvc-nompi-release-static", + "name": "ci/ref/msvc/nompi/release/static", "generator": "Visual Studio 17 2022", "inherits": [ - "ci-ref-msvc-nompi-release" + "ci/ref/msvc/nompi/release" ], "cacheVariables": { "BUILD_SHARED_LIBS": "OFF" } }, { - "name": "ci-omp-clang-mpi-debug-static-fasttest", + "name": "ci/omp/clang/mpi/debug/static/fasttest", "inherits": [ "enable-openmp", "enable-clang", @@ -377,7 +377,7 @@ } }, { - "name": "ci-omp-clang-mpi-glibcxx+debug-release", + "name": "ci/omp/clang/mpi/glibcxx+debug/release", "inherits": [ "enable-openmp", "enable-clang", @@ -390,7 +390,7 @@ } }, { - "name": "ci-omp-clang-nompi-debug-nomixed", + "name": "ci/omp/clang/nompi/debug/nomixed", "inherits": [ "enable-openmp", "enable-clang", @@ -403,16 +403,16 @@ } }, { - "name": "ci-omp-clang-nompi-debug-static-nomixed", + "name": "ci/omp/clang/nompi/debug/static/nomixed", "inherits": [ - "ci-omp-clang-nompi-debug-nomixed" + "ci/omp/clang/nompi/debug/nomixed" ], "cacheVariables": { "BUILD_SHARED_LIBS": "OFF" } }, { - "name": "ci-omp-clang-nompi-release-static", + "name": "ci/omp/clang/nompi/release/static", "inherits": [ "enable-openmp", "enable-clang", @@ -425,16 +425,16 @@ } }, { - "name": "ci-omp-clang-nompi-release-static-nomixed", + "name": "ci/omp/clang/nompi/release/static/nomixed", "inherits": [ - "ci-omp-clang-nompi-release-static" + "ci/omp/clang/nompi/release/static" ], "cacheVariables": { "GINKGO_MIXED_PRECISION": "OFF" } }, { - "name": "ci-omp-gcc-nompi-release", + "name": "ci/omp/gcc/nompi/release", "inherits": [ "enable-openmp", "enable-gcc", @@ -443,16 +443,16 @@ ] }, { - "name": "ci-omp-gcc-nompi-release-static", + "name": "ci/omp/gcc/nompi/release/static", "inherits": [ - "ci-omp-gcc-nompi-release" + "ci/omp/gcc/nompi/release" ], "cacheVariables": { "BUILD_SHARED_LIBS": "OFF" } }, { - "name": "ci-omp-gcc-mpi-release-nomixed", + "name": "ci/omp/gcc/mpi/release/nomixed", "inherits": [ "enable-openmp", "enable-clang", @@ -465,7 +465,7 @@ } }, { - "name": "ci-omp-mingwgcc-nompi-release-static", + "name": "ci/omp/mingwgcc/nompi/release/static", "generator": "MinGW Makefiles", "inherits": [ "enable-openmp", @@ -478,7 +478,7 @@ } }, { - "name": "ci-sycl-icpx-nompi-release-shared-singlemode", + "name": "ci/sycl/icpx/nompi/release/shared/singlemode", "inherits": [ "enable-sycl", "enable-intel", @@ -488,7 +488,7 @@ ] }, { - "name": "ci-sycl-dpcpp-nompi-release-singlemode", + "name": "ci/sycl/dpcpp/nompi/release/singlemode", "inherits": [ "enable-sycl", "enable-dpcpp", @@ -499,18 +499,18 @@ "generator": "Unix Makefiles" }, { - "name": "ci-sycl-dpcpp-nompi-release-static-singlemode", + "name": "ci/sycl/dpcpp/nompi/release/static/singlemode", "inherits": [ - "ci-sycl-dpcpp-nompi-release-singlemode" + "ci/sycl/dpcpp/nompi/release/singlemode" ], "cacheVariables": { "BUILD_SHARED_LIBS": "OFF" } }, { - "name": "ci-sycl-icpx-nompi-release-singlemode-nomixed", + "name": "ci/sycl/icpx/nompi/release/singlemode/nomixed", "inherits": [ - "ci-sycl-icpx-nompi-release-shared-singlemode" + "ci/sycl/icpx/nompi/release/shared/singlemode" ], "generator": "Unix Makefiles", "cacheVariables": { @@ -518,7 +518,7 @@ } }, { - "name": "ci-warnings", + "name": "ci/warnings", "inherits": [ "enable-cuda", "enable-hip", @@ -530,7 +530,7 @@ } }, { - "name": "ci-no_circular_deps", + "name": "ci/no_circular_deps", "inherits": [ "enable-cuda", "enable-hip", @@ -542,14 +542,14 @@ } }, { - "name": "ci-subdir_build", + "name": "ci/subdir_build", "inherits": [ "enable-openmp", "base-ci" ] }, { - "name": "ci-clang_tidy", + "name": "ci/clang_tidy", "inherits": [ "enable-cuda", "enable-hip", @@ -561,7 +561,7 @@ } }, { - "name": "ci-iwyu", + "name": "ci/iwyu", "inherits": [ "enable-cuda", "enable-openmp", From 8c6a5c733447552ff7f154334193ced1d09232f0 Mon Sep 17 00:00:00 2001 From: Marcel Koch Date: Wed, 14 Aug 2024 09:12:08 +0200 Subject: [PATCH 17/18] fixup! use cmake presets in gitlab ci --- .github/workflows/intel.yml | 4 +- .github/workflows/osx.yml | 4 +- .github/workflows/windows-mingw.yml | 2 +- .github/workflows/windows-msvc-cuda.yml | 2 +- .github/workflows/windows-msvc-ref.yml | 4 +- .gitlab-ci.yml | 62 ++++++++++++------------- 6 files changed, 39 insertions(+), 39 deletions(-) diff --git a/.github/workflows/intel.yml b/.github/workflows/intel.yml index b3105067148..814bb2e33ba 100644 --- a/.github/workflows/intel.yml +++ b/.github/workflows/intel.yml @@ -21,8 +21,8 @@ jobs: fail-fast: false matrix: config: - - { preset: "ci-sycl-dpcpp-nompi-release-singlemode" } - - { preset: "ci-sycl-icpx-nompi-release-singlemode-nomixed" } + - { preset: "ci/sycl/dpcpp/nompi/release/singlemode" } + - { preset: "ci/sycl/icpx/nompi/release/singlemode/nomixed" } name: ${{ matrix.config.preset }} runs-on: [gpu_intel] diff --git a/.github/workflows/osx.yml b/.github/workflows/osx.yml index b593a19f966..3d9f36c13b3 100644 --- a/.github/workflows/osx.yml +++ b/.github/workflows/osx.yml @@ -27,8 +27,8 @@ jobs: fail-fast: false matrix: config: - - { preset: "ci-omp-clang-nompi-debug-nomixed" } - - { preset: "ci-omp-clang-nompi-release-static" } + - { preset: "ci/omp/clang/nompi/debug/nomixed" } + - { preset: "ci/omp/clang/nompi/release/static" } name: ${{ matrix.config.preset }} runs-on: [macos-latest] diff --git a/.github/workflows/windows-mingw.yml b/.github/workflows/windows-mingw.yml index b789b76a0ae..31adbba8a4d 100644 --- a/.github/workflows/windows-mingw.yml +++ b/.github/workflows/windows-mingw.yml @@ -28,7 +28,7 @@ jobs: fail-fast: false matrix: config: - - { preset: "ci-omp-mingwgcc-nompi-release-static" } + - { preset: "ci/omp/mingwgcc/nompi/release/static" } name: ${{ matrix.config.preset }} runs-on: [windows-latest] steps: diff --git a/.github/workflows/windows-msvc-cuda.yml b/.github/workflows/windows-msvc-cuda.yml index c45da57b231..5f7f8db984b 100644 --- a/.github/workflows/windows-msvc-cuda.yml +++ b/.github/workflows/windows-msvc-cuda.yml @@ -28,7 +28,7 @@ jobs: fail-fast: false matrix: config: - - {version: "latest", preset: "ci-cuda-msvc-nompi-release"} + - {version: "latest", preset: "ci/cuda/msvc/nompi/release"} name: ${{ matrix.config.preset }} (only compile) runs-on: [windows-2019] diff --git a/.github/workflows/windows-msvc-ref.yml b/.github/workflows/windows-msvc-ref.yml index 52ad7ae8e30..308af1aa1b0 100644 --- a/.github/workflows/windows-msvc-ref.yml +++ b/.github/workflows/windows-msvc-ref.yml @@ -30,8 +30,8 @@ jobs: config: # Debug shared exceeds symbol limit # - {shared: "ON", build_type: "Debug", name: "reference/debug/shared"} - - { preset: "ci-ref-msvc-nompi-release-static" } - - { preset: "ci-ref-msvc-nompi-release" } + - { preset: "ci/ref/msvc/nompi/release/static" } + - { preset: "ci/ref/msvc/nompi/release" } # Debug static needs too much storage # - {shared: "OFF", build_type: "Debug", name: "reference/debug/static"} name: ${{ matrix.config.preset }} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3f15c3399fb..05861872d37 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -123,7 +123,7 @@ build/cuda110/mvapich2/gcc/cuda/debug/shared: - .quick_test_condition - .use_gko-cuda110-mvapich2-gnu9-llvm9-intel2020 variables: - CI_CMAKE_PRESET: "ci-cuda+omp-gcc-mpi-debug-fasttest-nondefault_stream" + CI_CMAKE_PRESET: "ci/cuda+omp/gcc/mpi/debug/fasttest/nondefault_stream" CUDA_ARCH: 80 USE_NAME: "cuda110-mvapich2-gcc-${CI_PIPELINE_ID}" KEEP_CONTAINER: "ON" @@ -151,7 +151,7 @@ build/cuda110/nompi/clang/cuda/release/static: - .full_test_condition - .use_gko-cuda110-mvapich2-gnu9-llvm9-intel2020 variables: - CI_CMAKE_PRESET: "ci-cuda+omp-clang-nompi-release-static" + CI_CMAKE_PRESET: "ci/cuda+omp/clang/nompi/release/static" CUDA_ARCH: 80 USE_NAME: "cuda110-nompi-clang-${CI_PIPELINE_ID}" KEEP_CONTAINER: "ON" @@ -179,7 +179,7 @@ build/cuda110/nompi/clang/cuda/release/shared: - .quick_test_condition - .use_gko-cuda110-mvapich2-gnu9-llvm9-intel2020 variables: - CI_CMAKE_PRESET: "ci-cuda+omp-clang-nompi-release-fasttest-shared" + CI_CMAKE_PRESET: "ci/cuda+omp/clang/nompi/release/fasttest/shared" CUDA_ARCH: 52 @@ -191,7 +191,7 @@ build/cuda114/nompi/gcc/cuda/debug/shared: - .quick_test_condition - .use_gko_cuda114-openmpi-gnu10-llvm12 variables: - CI_CMAKE_PRESET: "ci-cuda+omp-gcc-nompi-debug-fasttest" + CI_CMAKE_PRESET: "ci/cuda+omp/gcc/nompi/debug/fasttest" # nvhpc and friends @@ -202,7 +202,7 @@ build/nvhpc233/cuda120/nompi/nvcpp/release/static: - .quick_test_condition - .use_gko_nvhpc233-cuda120-openmpi-gnu12-llvm16 variables: - CI_CMAKE_PRESET: "ci-cuda+omp-nvhpc-nompi-release-static-fasttest" + CI_CMAKE_PRESET: "ci/cuda+omp/nvhpc/nompi/release/static/fasttest" build/nvhpc227/cuda117/nompi/nvcpp/debug/shared: extends: @@ -211,7 +211,7 @@ build/nvhpc227/cuda117/nompi/nvcpp/debug/shared: - .quick_test_condition - .use_gko_nvhpc227-cuda117-openmpi-gnu11-llvm14 variables: - CI_CMAKE_PRESET: "ci-cuda+omp-nvhpc-nompi-debug-fasttest" + CI_CMAKE_PRESET: "ci/cuda+omp/nvhpc/nompi/debug/fasttest" # ROCm 4.5 and friends build/amd/nompi/gcc/rocm45/release/shared: @@ -221,7 +221,7 @@ build/amd/nompi/gcc/rocm45/release/shared: - .quick_test_condition - .use_gko-rocm45-nompi-gnu8-llvm8 variables: - CI_CMAKE_PRESET: "ci-hip+omp-gcc-nompi-release-fasttest-nondefault_stream" + CI_CMAKE_PRESET: "ci/hip+omp/gcc/nompi/release/fasttest/nondefault_stream" build/amd/nompi/clang/rocm45/release/static: extends: @@ -230,7 +230,7 @@ build/amd/nompi/clang/rocm45/release/static: - .full_test_condition - .use_gko-rocm45-nompi-gnu8-llvm8 variables: - CI_CMAKE_PRESET: "ci-hip+omp-clang-nompi-release-static" + CI_CMAKE_PRESET: "ci/hip+omp/clang/nompi/release/static" build/amd/nompi/clang/rocm45/debug/shared: extends: @@ -239,7 +239,7 @@ build/amd/nompi/clang/rocm45/debug/shared: - .quick_test_condition - .use_gko-rocm45-nompi-gnu8-llvm8 variables: - CI_CMAKE_PRESET: "ci-hip+omp-clang-nompi-debug" + CI_CMAKE_PRESET: "ci/hip+omp/clang/nompi/debug" # ROCm 5.1.4 and friends build/amd/nompi/gcc/rocm514/debug/static: @@ -249,7 +249,7 @@ build/amd/nompi/gcc/rocm514/debug/static: - .full_test_condition - .use_gko-rocm514-nompi-gnu11-llvm11 variables: - CI_CMAKE_PRESET: "ci-hip+omp-gcc-nompi-debug-static" + CI_CMAKE_PRESET: "ci/hip+omp/gcc/nompi/debug/static" build/amd/nompi/clang/rocm514/release/shared: extends: @@ -258,7 +258,7 @@ build/amd/nompi/clang/rocm514/release/shared: - .quick_test_condition - .use_gko-rocm514-nompi-gnu11-llvm11 variables: - CI_CMAKE_PRESET: "ci-hip+omp-clang-nompi-release" + CI_CMAKE_PRESET: "ci/hip+omp/clang/nompi/release" # without omp build/amd/nompi/gcc/rocm514_wo_omp/release/shared: @@ -268,7 +268,7 @@ build/amd/nompi/gcc/rocm514_wo_omp/release/shared: - .full_test_condition - .use_gko-rocm514-nompi-gnu11-llvm11 variables: - CI_CMAKE_PRESET: "ci-hip-gcc-nompi-release" + CI_CMAKE_PRESET: "ci/hip/gcc/nompi/release" # no cuda but latest gcc and clang build/nocuda/nompi/gcc/core/debug/static: @@ -278,7 +278,7 @@ build/nocuda/nompi/gcc/core/debug/static: - .quick_test_condition - .use_gko-nocuda-nompi-gnu9-llvm8 variables: - CI_CMAKE_PRESET: "ci-ref-gcc-nompi-debug-static-fasttest" + CI_CMAKE_PRESET: "ci/ref/gcc/nompi/debug/static/fasttest" build/nocuda/nompi/clang/core/release/shared: extends: @@ -287,7 +287,7 @@ build/nocuda/nompi/clang/core/release/shared: - .quick_test_condition - .use_gko-nocuda-nompi-gnu9-llvm8 variables: - CI_CMAKE_PRESET: "ci-ref-clang-nompi-release" + CI_CMAKE_PRESET: "ci/ref/clang/nompi/release" build/nocuda/nompi/gcc/omp/release/shared: extends: @@ -296,7 +296,7 @@ build/nocuda/nompi/gcc/omp/release/shared: - .quick_test_condition - .use_gko-nocuda-nompi-gnu9-llvm8 variables: - CI_CMAKE_PRESET: "ci-omp-gcc-nompi-release" + CI_CMAKE_PRESET: "ci/omp/gcc/nompi/release" build/nocuda/openmpi/clang/omp/debug/static: extends: @@ -305,7 +305,7 @@ build/nocuda/openmpi/clang/omp/debug/static: - .full_test_condition - .use_gko-nocuda-openmpi-gnu9-llvm8 variables: - CI_CMAKE_PRESET: "ci-omp-clang-mpi-debug-static-fasttest" + CI_CMAKE_PRESET: "ci/omp/clang/mpi/debug/static/fasttest" build/nocuda/openmpi/clang/omp/glibcxx-debug-release/shared: extends: @@ -314,7 +314,7 @@ build/nocuda/openmpi/clang/omp/glibcxx-debug-release/shared: - .quick_test_condition - .use_gko-nocuda-nompi-gnu9-llvm8 variables: - CI_CMAKE_PRESET: "ci-omp-clang-mpi-glibcxx+debug-release" + CI_CMAKE_PRESET: "ci/omp/clang/mpi/glibcxx+debug/release" # nocuda with old compiler build/nocuda/nompi/gcc/omp/release/static: @@ -324,7 +324,7 @@ build/nocuda/nompi/gcc/omp/release/static: - .quick_test_condition - .use_gko-nocuda-nompi-gnu9-llvm8 variables: - CI_CMAKE_PRESET: "ci-omp-gcc-nompi-release-static" + CI_CMAKE_PRESET: "ci/omp/gcc/nompi/release/static" build/nocuda-nomixed/nompi/clang/omp/release/static: extends: @@ -333,7 +333,7 @@ build/nocuda-nomixed/nompi/clang/omp/release/static: - .full_test_condition - .use_gko-nocuda-nompi-gnu9-llvm8 variables: - CI_CMAKE_PRESET: "ci-omp-clang-nompi-release-static-nomixed" + CI_CMAKE_PRESET: "ci/omp/clang/nompi/release/static/nomixed" build/nocuda-nomixed/openmpi/gcc/omp/release/shared: extends: @@ -342,7 +342,7 @@ build/nocuda-nomixed/openmpi/gcc/omp/release/shared: - .quick_test_condition - .use_gko-nocuda-nompi-gnu9-llvm8 variables: - CI_CMAKE_PRESET: "ci-omp-gcc-mpi-release-nomixed" + CI_CMAKE_PRESET: "ci/omp/gcc/mpi/release/nomixed" build/nocuda-nomixed/nompi/clang/omp/debug/static: extends: @@ -351,7 +351,7 @@ build/nocuda-nomixed/nompi/clang/omp/debug/static: - .full_test_condition - .use_gko-nocuda-nompi-gnu9-llvm8 variables: - CI_CMAKE_PRESET: "ci-omp-clang-nompi-debug-static-nomixed" + CI_CMAKE_PRESET: "ci/omp/clang/nompi/debug/static/nomixed" # spack oneapi 2023.1 build/icpx20231/igpu/release/shared: @@ -361,7 +361,7 @@ build/icpx20231/igpu/release/shared: - .quick_test_condition - .use_gko-oneapi20231-igpu variables: - CI_CMAKE_PRESET: "ci-sycl-icpx-nompi-release-shared-singlemode" + CI_CMAKE_PRESET: "ci/sycl/icpx/nompi/release/shared/singlemode" ONEAPI_DEVICE_SELECTOR: "opencl:gpu" # TODO: Enable when debug shared library size issues are fixed @@ -388,7 +388,7 @@ build/icpx/igpu/release/static: - .full_test_condition - .use_gko-oneapi-igpu variables: - CI_CMAKE_PRESET: "ci-sycl-dpcpp-nompi-release-static-singlemode" + CI_CMAKE_PRESET: "ci/sycl/dpcpp/nompi/release/static/singlemode" ONEAPI_DEVICE_SELECTOR: "*:gpu" # windows jobs @@ -402,7 +402,7 @@ build/windows-cuda/release/shared: - if (Test-Path install) { rm -r -fo install } - mkdir build - mkdir install - - cmake -B build --preset "ci-cuda-msvc-nompi-release-shared" "-DCMAKE_INSTALL_PREFIX=$pwd\install" . + - cmake -B build --preset "ci/cuda/msvc/nompi/release/shared" "-DCMAKE_INSTALL_PREFIX=$pwd\install" . - cmake --build build --config Release -j16 # we disable these tests until the triangular solver issues are resolved # - ctest --test-dir build -C Release --no-tests=error --output-on-failure @@ -421,7 +421,7 @@ build/windows/release/shared: - if (Test-Path install) { rm -r -fo install } - mkdir build - mkdir install - - cmake -B build --preset "ci-ref-msvc-nompi-release" "-DCMAKE_INSTALL_PREFIX=$pwd\install" . + - cmake -B build --preset "ci/ref/msvc/nompi/release" "-DCMAKE_INSTALL_PREFIX=$pwd\install" . - cmake --build build --config Release -j16 - ctest --test-dir build -C Release --no-tests=error --output-on-failure -j16 - $env:PATH+=";$pwd/install/bin" @@ -439,7 +439,7 @@ warnings: - .full_test_condition - .use_gko-cuda110-mvapich2-gnu9-llvm9-intel2020 variables: - CI_CMAKE_PRESET: "ci-warnings" + CI_CMAKE_PRESET: "ci/warnings" allow_failure: yes # Ensure kernel modules do not depend on core @@ -451,7 +451,7 @@ no-circular-deps: - .quick_test_condition - .use_gko-cuda110-mvapich2-gnu9-llvm9-intel2020 variables: - CI_CMAKE_PRESET: "ci-no_circular_deps" + CI_CMAKE_PRESET: "ci/no_circular_deps" allow_failure: no # Ensure Ginkgo builds from a subdirectory @@ -463,7 +463,7 @@ subdir-build: - .full_test_condition - .use_gko-nocuda-nompi-gnu9-llvm8 variables: - CI_CMAKE_PRESET: "ci-subdir_build" + CI_CMAKE_PRESET: "ci/subdir_build" allow_failure: no # Run clang-tidy and iwyu @@ -475,7 +475,7 @@ clang-tidy: - .full_test_condition - .use_gko-cuda110-mvapich2-gnu9-llvm9-intel2020 variables: - CI_CMAKE_PRESET: "ci-clang_tidy" + CI_CMAKE_PRESET: "ci/clang_tidy" allow_failure: yes iwyu: @@ -486,7 +486,7 @@ iwyu: - .full_test_condition - .use_gko-cuda110-mvapich2-gnu9-llvm9-intel2020 variables: - CI_CMAKE_PRESET: "ci-iwyu" + CI_CMAKE_PRESET: "ci/iwyu" allow_failure: yes # Code analysis, coverage and reporting tool @@ -678,7 +678,7 @@ benchmark-cuda-spmv-build: - .benchmark-spmv-cuda-rules stage: benchmark-build variables: - CI_CMAKE_PRESET: "ci-cuda+omp-gcc-mpi-release-shared" + CI_CMAKE_PRESET: "ci/cuda+omp/gcc/mpi/release/shared" CUDA_ARCH: 80 USE_NAME: "benchmark-cuda-spmv-${CI_PIPELINE_ID}" KEEP_CONTAINER: "ON" From a5d4575cef171b222aa09bfc0e7ca5ad23337024 Mon Sep 17 00:00:00 2001 From: Marcel Koch Date: Wed, 14 Aug 2024 09:25:14 +0200 Subject: [PATCH 18/18] fixup! use cmake presets in gitlab ci --- .github/workflows/osx.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/osx.yml b/.github/workflows/osx.yml index 3d9f36c13b3..001297ea5f5 100644 --- a/.github/workflows/osx.yml +++ b/.github/workflows/osx.yml @@ -55,7 +55,7 @@ jobs: mkdir install export INSTALL_PREFIX=`pwd`/install cd build - cmake -S .. -B . --preset ${{ matrix.config.preset }} -DCMAKE_PREFIX_PATH=/opt/homebrew/opt/libomp/ + cmake -S .. -B . --preset ${{ matrix.config.preset }} -DCMAKE_PREFIX_PATH=/opt/homebrew/opt/libomp/ -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} cmake --build . -j8 ctest -j10 --output-on-failure