From 5744f2d2ddfda8b10413f9d25a976db5242606d1 Mon Sep 17 00:00:00 2001 From: Arseniy Obolenskiy Date: Sat, 14 Jun 2025 15:13:57 +0200 Subject: [PATCH 1/2] Fix debug build and enable CI check for it --- .github/workflows/main.yml | 49 ++++++++++++++++++++++++++++++++++++++ cmake/onetbb.cmake | 7 ++++++ tasks/CMakeLists.txt | 2 +- 3 files changed, 57 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aaf5422e2..14c2f0a57 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -89,6 +89,55 @@ jobs: with: name: ubuntu-gcc-install-${{ matrix.os }} path: ubuntu-gcc-install-${{ matrix.os }}.tar.gz + ubuntu-gcc-build-debug: + needs: + - clang-format + - python-lint + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: ["ubuntu-24.04"] + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Setup environment + run: | + sudo apt-get update + sudo apt-get install --no-install-recommends -y gcc-14 g++-14 ninja-build libmpich-dev libomp-dev valgrind + python3 -m pip install -r requirements.txt + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: ${{ runner.os }}-gcc + create-symlink: true + max-size: 1G + - name: CMake configure + run: > + cmake -S . -B build + -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache + -G Ninja + -D CMAKE_BUILD_TYPE=DEBUG -DCMAKE_INSTALL_PREFIX=install + env: + CC: gcc-14 + CXX: g++-14 + - name: Build project + run: | + cmake --build build --parallel + env: + CC: gcc-14 + CXX: g++-14 + - name: Install project + run: | + cmake --build build --target install + - name: Archive installed package + run: | + tar -czvf ubuntu-gcc-debug-install-${{ matrix.os }}.tar.gz -C install . + - name: Upload installed package + uses: actions/upload-artifact@v4 + with: + name: ubuntu-gcc-debug-install-${{ matrix.os }} + path: ubuntu-gcc-debug-install-${{ matrix.os }}.tar.gz ubuntu-gcc-test: needs: - ubuntu-gcc-build diff --git a/cmake/onetbb.cmake b/cmake/onetbb.cmake index aa6d8b131..174be9865 100644 --- a/cmake/onetbb.cmake +++ b/cmake/onetbb.cmake @@ -25,3 +25,10 @@ ExternalProject_Add(ppc_onetbb ) install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/ppc_onetbb/install/" DESTINATION "${CMAKE_INSTALL_PREFIX}") + +string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_lower) +if(cmake_build_type_lower STREQUAL "debug") + set(PPC_TBB_LIB_NAME tbb_debug) +else() + set(PPC_TBB_LIB_NAME tbb) +endif() diff --git a/tasks/CMakeLists.txt b/tasks/CMakeLists.txt index 4ae9df094..1a74fcade 100644 --- a/tasks/CMakeLists.txt +++ b/tasks/CMakeLists.txt @@ -78,7 +78,7 @@ foreach(TASK_TYPE ${LIST_OF_TASKS}) add_dependencies(${EXEC_FUNC} ppc_onetbb) target_link_directories(${EXEC_FUNC} PUBLIC ${CMAKE_BINARY_DIR}/ppc_onetbb/install/lib) if(NOT MSVC) - target_link_libraries(${EXEC_FUNC} PUBLIC tbb) + target_link_libraries(${EXEC_FUNC} PUBLIC ${PPC_TBB_LIB_NAME}) endif() target_link_directories(stb_image INTERFACE ${CMAKE_SOURCE_DIR}/3rdparty/stb) From b427e06526988e53a01335be1822acdb56e6ca94 Mon Sep 17 00:00:00 2001 From: Arseniy Obolenskiy Date: Sat, 14 Jun 2025 17:47:30 +0200 Subject: [PATCH 2/2] mac + win --- .github/workflows/main.yml | 94 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 14c2f0a57..81e027ac6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -588,6 +588,51 @@ jobs: with: name: macos-clang-sanitizer-install path: macos-clang-sanitizer-install.tar.gz + macos-clang-build-debug: + needs: + - clang-format + - python-lint + runs-on: macOS-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Setup environment + run: | + brew update-reset + brew install ninja mpich llvm + brew install libomp + brew link libomp --overwrite --force + brew install openssl + brew link openssl --overwrite --force + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: ${{ runner.os }}-clang + create-symlink: true + max-size: 1G + - name: CMake configure + run: > + cmake -S . -B build + -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache + -G Ninja -DCMAKE_C_FLAGS="-I$(brew --prefix)/opt/libomp/include" + -DCMAKE_CXX_FLAGS="-I$(brew --prefix)/opt/libomp/include" + -D CMAKE_BUILD_TYPE=DEBUG + -DCMAKE_INSTALL_PREFIX=install + - name: Build project + run: | + cmake --build build --parallel + - name: Install project + run: | + cmake --build build --target install + - name: Archive installed package + run: | + tar -czvf macos-clang-debug-install.tar.gz -C install . + - name: Upload installed package + uses: actions/upload-artifact@v4 + with: + name: macos-clang-debug-install + path: macos-clang-debug-install.tar.gz macos-clang-test: needs: - macos-clang-build @@ -733,6 +778,55 @@ jobs: with: name: windows-msvc-install path: windows-msvc-install.zip + windows-msvc-build-debug: + needs: + - clang-format + - python-lint + runs-on: windows-latest + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v2 + with: + vs-version: 'latest' + - name: Setup MPI + uses: mpi4py/setup-mpi@v1 + with: + mpi: msmpi + - name: Setup ccache + uses: Chocobo1/setup-ccache-action@v1 + with: + windows_compile_environment: msvc + - name: Setup ninja + uses: seanmiddleditch/gha-setup-ninja@v6 + - name: Setup MSVC for Ninja again + uses: ilammy/msvc-dev-cmd@v1 + - name: CMake configure + shell: bash + run: > + cmake -S . -B build -G Ninja -D CMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl + -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache + -D CMAKE_BUILD_TYPE=DEBUG -DCMAKE_INSTALL_PREFIX=install + - name: Build project + shell: bash + run: | + cmake --build build --config Debug --parallel + - name: Install project + run: | + cmake --build build --target install + - name: Archive installed package + run: Compress-Archive -Path install -DestinationPath windows-msvc-debug-install.zip + shell: pwsh + - name: Upload installed package + uses: actions/upload-artifact@v4 + with: + name: windows-msvc-debug-install + path: windows-msvc-debug-install.zip windows-msvc-test: needs: - windows-msvc-build