From a22109dd60ab350e666109421c410e0734651666 Mon Sep 17 00:00:00 2001 From: Robin Holzinger Date: Mon, 6 May 2024 00:35:48 +0200 Subject: [PATCH] force llvm std lib --- .github/actions/environment_clang.yaml | 5 ----- .github/workflows/build_dependencies.yaml | 7 +++---- .github/workflows/workflow.yaml | 13 +++++-------- CMakeLists.txt | 4 ++-- 4 files changed, 10 insertions(+), 19 deletions(-) delete mode 100644 .github/actions/environment_clang.yaml diff --git a/.github/actions/environment_clang.yaml b/.github/actions/environment_clang.yaml deleted file mode 100644 index 71b36c372..000000000 --- a/.github/actions/environment_clang.yaml +++ /dev/null @@ -1,5 +0,0 @@ -name: modyn-ci-tools -channels: - - conda-forge -dependencies: - - cmake diff --git a/.github/workflows/build_dependencies.yaml b/.github/workflows/build_dependencies.yaml index e73a59ab9..69a5560ab 100644 --- a/.github/workflows/build_dependencies.yaml +++ b/.github/workflows/build_dependencies.yaml @@ -50,7 +50,7 @@ jobs: with: environment-name: clang cache-environment: true - create-args: ccache clang=${{matrix.compiler.version}} libclang=${{matrix.compiler.version}} clang-tools=${{matrix.compiler.version}} + create-args: clang=${{matrix.compiler.version}} libclang=${{matrix.compiler.version}} clang-tools=${{matrix.compiler.version}} # gcc_linux-64=${{matrix.compiler.version}} gxx_linux-64=${{matrix.compiler.version}} - name: Create build and artifact directories @@ -60,9 +60,6 @@ jobs: - name: Configure CMake working-directory: ${{github.workspace}}/cmake/build - # fdebug-prefix-map is for ccache to not have absolute paths interfere with caching, see https://ccache.dev/manual/3.6.html#_compiling_in_different_directories - # -DCMAKE_CXX_FLAGS="${{ matrix.compiler.cxx == 'clang++' && '-stdlib=libc++ -std=c++20' || ''}} -fdebug-prefix-map=${{github.workspace}}/build=." - # -DCMAKE_EXE_LINKER_FLAGS="${{ matrix.compiler.cxx == 'clang++' && '-stdlib=libc++ -lc++abi' || ''}}" run: > cmake -G "Unix Makefiles" @@ -70,6 +67,8 @@ jobs: -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_COMPILER=${{matrix.compiler.c}} -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} + -DCMAKE_CXX_FLAGS="${{ matrix.compiler.cxx == 'clang++' && '-stdlib=libc++ -std=c++20' || ''}} -fdebug-prefix-map=${{github.workspace}}/build=." + -DCMAKE_CXX_STANDARD_LIBRARIES="${{ matrix.compiler.cxx == 'clang++' && '-lc++ -lc++abi' || ''}}" -DgRPC_PROTOBUF_PROVIDER=module -DABSL_ENABLE_INSTALL=On -DgRPC_INSTALL=ON diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 1791521a7..680121a44 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -152,7 +152,6 @@ jobs: - name: Install clang environment uses: mamba-org/setup-micromamba@v1 with: - environment-file: .github/actions/environment_clang.yaml cache-environment: true create-args: clang-18 clang-tools clang-format-18 @@ -208,19 +207,14 @@ jobs: # gcc-12 causes a false-positive memory error in release (https://github.com/google/googletest/issues/4108) - compiler: { c: gcc, cxx: g++, version: 12 } build-type: Release - env: - CC: ${{matrix.compiler.c}}-${{matrix.compiler.version}} - CXX: ${{matrix.compiler.cxx}}-${{matrix.compiler.version}} - # CCACHE_BASEDIR: ${{github.workspace}} steps: - uses: actions/checkout@v4 - name: Install clang environment uses: mamba-org/setup-micromamba@v1 with: - environment-file: .github/actions/environment_clang.yaml cache-environment: true - create-args: ccache clang=${{matrix.compiler.version}} libclang=${{matrix.compiler.version}} clang-tools=${{matrix.compiler.version}} + create-args: clang=${{matrix.compiler.version}} libclang=${{matrix.compiler.version}} clang-tools=${{matrix.compiler.version}} # gcc_linux-64=${{matrix.compiler.version}} gxx_linux-64=${{matrix.compiler.version}} - name: Setup pre-built grpc binaries @@ -242,13 +236,16 @@ jobs: - name: Configure CMake working-directory: ${{github.workspace}}/build - # fdebug-prefix-map is for ccache to not have absolute paths interfere with caching, see https://ccache.dev/manual/3.6.html#_compiling_in_different_directories # -DCMAKE_CXX_COMPILER_LAUNCHER=ccache # -DCMAKE_CXX_FLAGS="-fdebug-prefix-map=${{github.workspace}}/build=." run: > cmake ${{github.workspace}} -DCMAKE_PREFIX_PATH=${{github.workspace}}/install -DCMAKE_BUILD_TYPE=${{matrix.build-type}} + -DCMAKE_C_COMPILER=${{matrix.compiler.c}} + -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} + -DCMAKE_CXX_FLAGS="${{ matrix.compiler.cxx == 'clang++' && '-stdlib=libc++ -std=c++20' || ''}} -fdebug-prefix-map=${{github.workspace}}/build=." + -DCMAKE_CXX_STANDARD_LIBRARIES="${{ matrix.compiler.cxx == 'clang++' && '-lc++ -lc++abi' || ''}}" -DMODYN_TRY_LOCAL_GRPC=ON -DMODYN_BUILD_PLAYGROUND=ON -DMODYN_BUILD_TESTS=ON diff --git a/CMakeLists.txt b/CMakeLists.txt index d047d47b3..185f1ce0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,8 +53,8 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") list(APPEND MODYN_COMPILE_OPTIONS "-Wshadow-all" "-Wno-shadow-field-in-constructor") # Without this, we get compilation errors for the chrono header. We need to set this globally - # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++20") - # set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -lc++abi") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++20") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=stdlibc++ -lc++abi") endif() if (${MODYN_TEST_COVERAGE})