From a7068c61efcb03b35b819f4f259e02fd17a7a454 Mon Sep 17 00:00:00 2001 From: FrancoisCarouge Date: Mon, 30 Sep 2024 18:28:28 -0700 Subject: [PATCH] update --- .github/workflows/pipeline.yml | 27 +++++- CMakeLists.txt | 20 +--- benchmark/CMakeLists.txt | 6 +- sample/CMakeLists.txt | 7 +- support/CMakeLists.txt | 6 -- support/std.ixx | 162 --------------------------------- test/CMakeLists.txt | 11 +-- 7 files changed, 35 insertions(+), 204 deletions(-) delete mode 100644 support/std.ixx diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 10703ca7b..7b540cc1c 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -18,7 +18,9 @@ jobs: matrix: include: - { os: 'ubuntu-latest', cxx: 'clang++-18', cc: 'clang-18', generator: 'Ninja', packages: 'clang-18' } + - { os: 'ubuntu-latest', cxx: 'clang++-19', cc: 'clang-19', generator: 'Ninja', packages: 'clang-19' } - { os: 'ubuntu-latest', cxx: 'g++-13', cc: 'gcc-13', generator: 'Ninja', packages: 'g++-13' } + - { os: 'ubuntu-latest', cxx: 'g++-14', cc: 'gcc-14', generator: 'Ninja', packages: 'g++-14' } - { os: 'windows-latest', cxx: 'cl', cc: 'cl', generator: 'Ninja', config: 'Debug' } - { os: 'windows-latest', cxx: 'cl', cc: 'cl', generator: 'Ninja', config: 'Release' } name: '${{ matrix.os }} / ${{ matrix.cxx }} / ${{ matrix.generator }} / ${{ matrix.config }}' @@ -32,23 +34,40 @@ jobs: uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: 'Install: MSVC' uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 - - name: 'Install: GCC' + - name: 'Install: GCC 13' if: ${{ matrix.cxx == 'g++-13' }} run: | sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt update sudo apt upgrade - sudo apt install '${{ matrix.packages }}' - - name: 'Install: Clang' + sudo apt install '${{ matrix.packages }}' ninja-build + - name: 'Install: GCC 14' + if: ${{ matrix.cxx == 'g++-14' }} + run: | + sudo add-apt-repository ppa:ubuntu-toolchain-r/test + sudo apt update + sudo apt upgrade + sudo apt install '${{ matrix.packages }}' ninja-build + - name: 'Install: Clang 18' if: ${{ matrix.cxx == 'clang++-18' }} run: | sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt update sudo apt upgrade - sudo apt install g++-13 ninja + sudo apt install g++-13 ninja-build wget https://apt.llvm.org/llvm.sh chmod +x llvm.sh sudo ./llvm.sh 18 all + - name: 'Install: Clang 19' + if: ${{ matrix.cxx == 'clang++-19' }} + run: | + sudo add-apt-repository ppa:ubuntu-toolchain-r/test + sudo apt update + sudo apt upgrade + sudo apt install g++-13 ninja-build + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 19 all - name: 'Configure' env: CXX: '${{ matrix.cxx }}' diff --git a/CMakeLists.txt b/CMakeLists.txt index 385a29318..190b8dd5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,31 +46,15 @@ project( VERSION "0.4.0") set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_CXX_MODULE_STD ON) set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD ON) set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON) set(CPACK_PACKAGE_CHECKSUM "SHA512") set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md") set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE.txt") set(CPACK_SOURCE_GENERATOR "TBZ2") -# set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD 20) - -# if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") include("cmake/gcc_modules.cmake") -# endif() set(CMAKE_CXX_STANDARD 23) set(CXX_SCAN_FOR_MODULES TRUE) - -# message(STATUS "CMAKE VERSION: " ${CMAKE_VERSION}) - -# if(${CMAKE_VERSION} VERSION_EQUAL "3.25") -# set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API -# "3c375311-a3c9-4396-a187-3227ef642046") elseif(${CMAKE_VERSION} VERSION_EQUAL -# "3.26") set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API -# "2182bf5c-ef0d-489a-91da-49dbc3090d2a") elseif(${CMAKE_VERSION} VERSION_EQUAL -# "3.27") set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API -# "aa1f7df0-828a-4fcd-9afc-2dc80491aca7") endif() - -# set(CMAKE_CXX_STANDARD 20) set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API -# "aa1f7df0-828a-4fcd-9afc-2dc80491aca7") -# set(CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP 1) include(CMakePackageConfigHelpers) include(CPack) diff --git a/benchmark/CMakeLists.txt b/benchmark/CMakeLists.txt index 2f5656374..ea1bec718 100644 --- a/benchmark/CMakeLists.txt +++ b/benchmark/CMakeLists.txt @@ -62,7 +62,7 @@ foreach(BENCHMARK "baseline.cpp" "predict_1x1x0.cpp" "predict_1x1x1.cpp" target_link_libraries( kalman_benchmark_${NAME}_driver PRIVATE benchmark::benchmark benchmark::benchmark_main kalman - kalman_options kalman_std) + kalman_options) separate_arguments(TEST_COMMAND UNIX_COMMAND $ENV{COMMAND}) add_test( NAME kalman_benchmark_${NAME} @@ -84,7 +84,7 @@ foreach(BACKEND IN ITEMS "eigen" "naive") target_link_libraries( kalman_benchmark_predict_${BACKEND}_${STATE_SIZE}x1x${INPUT_SIZE}_driver PRIVATE benchmark::benchmark benchmark::benchmark_main kalman - kalman_linalg_${BACKEND} kalman_options kalman_std) + kalman_linalg_${BACKEND} kalman_options) separate_arguments(TEST_COMMAND UNIX_COMMAND $ENV{COMMAND}) add_test( NAME kalman_benchmark_predict_${BACKEND}_${STATE_SIZE}x1x${INPUT_SIZE} @@ -111,7 +111,7 @@ foreach(BACKEND IN ITEMS "eigen") target_link_libraries( kalman_benchmark_update_${BACKEND}_${STATE_SIZE}x${OUTPUT_SIZE}x0_driver PRIVATE benchmark::benchmark benchmark::benchmark_main kalman - kalman_linalg_${BACKEND} kalman_options kalman_std) + kalman_linalg_${BACKEND} kalman_options) separate_arguments(TEST_COMMAND UNIX_COMMAND $ENV{COMMAND}) add_test( NAME kalman_benchmark_update_${BACKEND}_${STATE_SIZE}x${OUTPUT_SIZE}x0 diff --git a/sample/CMakeLists.txt b/sample/CMakeLists.txt index df4f4ee0d..e3168a41f 100644 --- a/sample/CMakeLists.txt +++ b/sample/CMakeLists.txt @@ -41,7 +41,7 @@ foreach(SAMPLE "kf_1x1x0_building_height.cpp" "kf_1x1x0_liquid_temperature.cpp" get_filename_component(NAME ${SAMPLE} NAME_WE) add_executable(kalman_sample_${NAME}_driver ${SAMPLE}) target_link_libraries(kalman_sample_${NAME}_driver PRIVATE kalman kalman_main - kalman_options kalman_std) + kalman_options) separate_arguments(TEST_COMMAND UNIX_COMMAND $ENV{COMMAND}) add_test(NAME kalman_sample_${NAME} COMMAND ${TEST_COMMAND} $) @@ -53,7 +53,7 @@ foreach(BACKEND IN ITEMS "eigen" "naive") add_executable(kalman_sample_${BACKEND}_${NAME}_driver ${SAMPLE}) target_link_libraries( kalman_sample_${BACKEND}_${NAME}_driver - PRIVATE kalman kalman_main kalman_linalg_${BACKEND} kalman_options kalman_std) + PRIVATE kalman kalman_main kalman_linalg_${BACKEND} kalman_options) separate_arguments(TEST_COMMAND UNIX_COMMAND $ENV{COMMAND}) add_test(NAME kalman_sample_${BACKEND}_${NAME} COMMAND ${TEST_COMMAND} @@ -68,8 +68,7 @@ foreach(BACKEND IN ITEMS "eigen") add_executable(kalman_sample_${BACKEND}_${NAME}_driver ${SAMPLE}) target_link_libraries( kalman_sample_${BACKEND}_${NAME}_driver - PRIVATE kalman kalman_main kalman_linalg_${BACKEND} kalman_options - kalman_std) + PRIVATE kalman kalman_main kalman_linalg_${BACKEND} kalman_options) separate_arguments(TEST_COMMAND UNIX_COMMAND $ENV{COMMAND}) add_test(NAME kalman_sample_${BACKEND}_${NAME} COMMAND ${TEST_COMMAND} diff --git a/support/CMakeLists.txt b/support/CMakeLists.txt index 24662a826..a533e91a7 100644 --- a/support/CMakeLists.txt +++ b/support/CMakeLists.txt @@ -147,9 +147,3 @@ if(NOT CPP_LIB_GENERATOR) FILE_SET "kalman_generator_headers" DESTINATION "include/fcarouge") endif() - -add_library(kalman_std) -target_compile_features(kalman_std PUBLIC cxx_std_23) -# target_link_libraries(kalman_std PRIVATE kalman_options) -target_sources(kalman_std PUBLIC FILE_SET cxx_modules TYPE CXX_MODULES FILES - "std.ixx") diff --git a/support/std.ixx b/support/std.ixx deleted file mode 100644 index dc77d7cc0..000000000 --- a/support/std.ixx +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -// In a module-file, the optional `module;` must appear first; see [cpp.pre]. -module; - -// This named module expects to be built with classic headers, not header units. -#define _BUILD_STD_MODULE - -// The subset of "C headers" [tab:c.headers] corresponding to -// the "C++ headers for C library facilities" [tab:headers.cpp.c] -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -export module std; - -#pragma warning(push) -#pragma warning(disable : 5244) // '#include ' in the purview of module 'std' appears erroneous. - -// "C++ library headers" [tab:headers.cpp] -#include -#if _HAS_STATIC_RTTI -#include -#endif // _HAS_STATIC_RTTI -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if _HAS_CXX23 -#include -#endif // _HAS_CXX23 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if _HAS_CXX23 -//! @todo Include when available. -// #include -#endif // _HAS_CXX23 -#include -#include -#include -#include -#include -#include -#include -#include -#if _HAS_CXX23 -#include -#endif // _HAS_CXX23 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if _HAS_CXX23 -#include -#endif // _HAS_CXX23 -#include -#include -#if _HAS_CXX23 -#include -#endif // _HAS_CXX23 -#include -#if _HAS_CXX23 -#include -#endif // _HAS_CXX23 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// "C++ headers for C library facilities" [tab:headers.cpp.c] -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#pragma warning(pop) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 6da9ef56d..9e7098dae 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -48,7 +48,7 @@ foreach( get_filename_component(NAME ${TEST} NAME_WE) add_executable(kalman_test_${NAME}_driver ${TEST}) target_link_libraries(kalman_test_${NAME}_driver - PRIVATE kalman kalman_main kalman_options kalman_print kalman_std) + PRIVATE kalman kalman_main kalman_options kalman_print) separate_arguments(TEST_COMMAND UNIX_COMMAND $ENV{COMMAND}) add_test(NAME kalman_test_${NAME} COMMAND ${TEST_COMMAND} $) @@ -80,8 +80,7 @@ foreach(BACKEND IN ITEMS "eigen" "lazy" "naive") add_executable(kalman_test_${BACKEND}_${NAME}_driver ${TEST}) target_link_libraries( kalman_test_${BACKEND}_${NAME}_driver - PRIVATE kalman kalman_main kalman_linalg_${BACKEND} kalman_options - kalman_std) + PRIVATE kalman kalman_main kalman_linalg_${BACKEND} kalman_options) separate_arguments(TEST_COMMAND UNIX_COMMAND $ENV{COMMAND}) add_test(NAME kalman_test_${BACKEND}_${NAME} COMMAND ${TEST_COMMAND} @@ -108,8 +107,7 @@ foreach(BACKEND IN ITEMS "eigen") add_executable(kalman_test_${BACKEND}_${NAME}_driver ${TEST}) target_link_libraries( kalman_test_${BACKEND}_${NAME}_driver - PRIVATE kalman kalman_main kalman_linalg_${BACKEND} kalman_options - kalman_std) + PRIVATE kalman kalman_main kalman_linalg_${BACKEND} kalman_options) separate_arguments(TEST_COMMAND UNIX_COMMAND $ENV{COMMAND}) add_test(NAME kalman_test_${BACKEND}_${NAME} COMMAND ${TEST_COMMAND} @@ -123,8 +121,7 @@ foreach(BACKEND IN ITEMS "lazy") add_executable(kalman_test_${BACKEND}_${NAME}_driver ${TEST}) target_link_libraries( kalman_test_${BACKEND}_${NAME}_driver - PRIVATE kalman kalman_main kalman_linalg_${BACKEND} kalman_options - kalman_std) + PRIVATE kalman kalman_main kalman_linalg_${BACKEND} kalman_options) separate_arguments(TEST_COMMAND UNIX_COMMAND $ENV{COMMAND}) add_test(NAME kalman_test_${BACKEND}_${NAME} COMMAND ${TEST_COMMAND}