From b25bc752b06c7588519b71c0c588972fc9dcf057 Mon Sep 17 00:00:00 2001 From: Moritz Heinemann Date: Mon, 1 Jul 2024 19:05:09 +0200 Subject: [PATCH 01/20] Always build with Ninja on Linux --- azure-pipelines.yml | 33 +++++---------------------------- 1 file changed, 5 insertions(+), 28 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index abe073f36b..57b5bb8056 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -32,15 +32,12 @@ jobs: matrix: 'VS2019 Release': configuration: Release - generator: 'Visual Studio 16 2019' cmakeExtraArgs: '$(defaultConfig)' 'VS2019 Debug': configuration: Debug - generator: 'Visual Studio 16 2019' cmakeExtraArgs: '$(defaultConfig)' 'VS2019 Release (nonGL)': configuration: Release - generator: 'Visual Studio 16 2019' cmakeExtraArgs: '$(nonGlConfig)' timeoutInMinutes: 720 @@ -61,7 +58,7 @@ jobs: - task: CMake@1 displayName: 'CMake Configure' inputs: - cmakeArgs: '.. -G"$(generator)" -A"x64" $(cmakeExtraArgs)' + cmakeArgs: '.. -G "Visual Studio 16 2019" -A"x64" $(cmakeExtraArgs)' - task: CMake@1 displayName: 'CMake Build' inputs: @@ -74,43 +71,23 @@ jobs: strategy: matrix: - ## Temporarily disabled until more CI machines are available! - #'GCC11 / Make / Release': - # dockerImage: megamol_ci_ubuntu - # cCompiler: gcc-11 - # cxxCompiler: g++-11 - # configuration: Release - # generator: 'Unix Makefiles' - # cmakeExtraArgs: '$(defaultConfig)' - 'GCC11 / Make / Debug': + 'GCC11 / Debug': dockerImage: megamol_ci_ubuntu cCompiler: gcc-11 cxxCompiler: g++-11 configuration: Debug - generator: 'Unix Makefiles' cmakeExtraArgs: '$(defaultConfig)' - ## Temporarily disabled until more CI machines are available! - #'GCC11 / Ninja / Release': - # dockerImage: megamol_ci_ubuntu - # cCompiler: gcc-11 - # cxxCompiler: g++-11 - # configuration: Release - # generator: 'Ninja' - # cmakeExtraArgs: '$(defaultConfig)' - ## Temporarily changed to Ninja instead of Make until more CI machines are available! - 'Clang14 / Ninja / Release': + 'Clang14 / Release': dockerImage: megamol_ci_ubuntu cCompiler: clang-14 cxxCompiler: clang++-14 configuration: Release - generator: 'Ninja' cmakeExtraArgs: '$(defaultConfig)' - 'GCC11 / Ninja / Release (nonGL)': + 'GCC11 / Release (nonGL)': dockerImage: megamol_ci_ubuntu cCompiler: gcc-11 cxxCompiler: g++-11 configuration: Release - generator: 'Ninja' cmakeExtraArgs: '$(nonGlConfig)' timeoutInMinutes: 720 @@ -134,7 +111,7 @@ jobs: - task: CMake@1 displayName: 'CMake Configure' inputs: - cmakeArgs: '.. -G"$(generator)" -DCMAKE_C_COMPILER=$(cCompiler) -DCMAKE_CXX_COMPILER=$(cxxCompiler) -DCMAKE_BUILD_TYPE=$(configuration) $(cmakeExtraArgs)' + cmakeArgs: '.. -G Ninja -DCMAKE_C_COMPILER=$(cCompiler) -DCMAKE_CXX_COMPILER=$(cxxCompiler) -DCMAKE_BUILD_TYPE=$(configuration) $(cmakeExtraArgs)' - task: CMake@1 displayName: 'CMake Build' inputs: From bb530005371d0aa7d14f7838eb9f6da2bea136fa Mon Sep 17 00:00:00 2001 From: Moritz Heinemann Date: Mon, 1 Jul 2024 19:30:39 +0200 Subject: [PATCH 02/20] Build with GitHub Actions --- .github/workflows/build.yml | 61 +++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..79686a791f --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,61 @@ +name: Build + +on: + push: + branches: [master] + pull_request: + branches: [master] + +env: + MM_DEFAULT_CONFIG: >- + -DMEGAMOL_VCPKG_DOWNLOAD_CACHE=ON + -DMEGAMOL_WARNING_LEVEL="Off" + -DMEGAMOL_PLUGIN_MEGAMOL101_GL=ON + -DMEGAMOL_PLUGIN_IMAGESERIES=ON + -DMEGAMOL_PLUGIN_IMAGESERIES_GL=ON + -DMEGAMOL_USE_CGAL=ON + -DMEGAMOL_USE_PROFILING=ON + -DMEGAMOL_USE_STACKTRACE=ON + -DMEGAMOL_USE_TRACY=ON + -DMEGAMOL_USE_VTKM=OFF + +jobs: + windows: + strategy: + fail-fast: false + matrix: + configuration: [Release] + name: "Windows-Build (${{ matrix.configuration }})" + runs-on: windows-2022 + steps: + - uses: actions/checkout@v4 + - name: Configure + run: >- + cmake -S . -B ${{ github.workspace }}/build -G "Visual Studio 17 2022" + ${{ env.MM_DEFAULT_CONFIG }} + - name: Build + run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.configuration }} --parallel 2 + linux: + strategy: + fail-fast: false + matrix: + docker_image: [megamol_ci_ubuntu] + compiler: + - cc: clang-14 + cxx: clang++-14 + configuration: [Release] + name: "Linux-Build (${{ matrix.compiler.cc }}, ${{ matrix.configuration }})" + runs-on: ubuntu-22.04 + container: + image: ghcr.io/unistuttgart-visus/${{ matrix.docker_image }}:master + steps: + - uses: actions/checkout@v4 + - name: Configure + run: >- + cmake -S . -B ${{ github.workspace }}/build -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} + ${{ env.MM_DEFAULT_CONFIG }} + - name: Build + run: cmake --build ${{ github.workspace }}/build + env: + CC: ${{ matrix.compiler.cc }} + CXX: ${{ matrix.compiler.cxx }} From 58d61ec5a4fab4ec36cd5ba25f44a85afa189bd9 Mon Sep 17 00:00:00 2001 From: Moritz Heinemann Date: Mon, 8 Jul 2024 18:10:17 +0200 Subject: [PATCH 03/20] rename file --- .github/workflows/{vcpkg_cache.yml => vcpkg.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{vcpkg_cache.yml => vcpkg.yml} (100%) diff --git a/.github/workflows/vcpkg_cache.yml b/.github/workflows/vcpkg.yml similarity index 100% rename from .github/workflows/vcpkg_cache.yml rename to .github/workflows/vcpkg.yml From 6162c881737877c2aec862e29458f165f871b37b Mon Sep 17 00:00:00 2001 From: Moritz Heinemann Date: Mon, 8 Jul 2024 18:58:03 +0200 Subject: [PATCH 04/20] vtk-m vcpkg ci build --- .github/workflows/vcpkg.yml | 2 ++ cmake/vcpkg_triplets/x64-linux-dynamic.cmake | 12 ++++++++++++ cmake/vcpkg_triplets/x64-linux.cmake | 5 +++++ cmake/vcpkg_triplets/x64-windows-static.cmake | 5 +++++ cmake/vcpkg_triplets/x64-windows.cmake | 5 +++++ 5 files changed, 29 insertions(+) create mode 100644 cmake/vcpkg_triplets/x64-linux-dynamic.cmake diff --git a/.github/workflows/vcpkg.yml b/.github/workflows/vcpkg.yml index 475658ca58..40b5749c89 100644 --- a/.github/workflows/vcpkg.yml +++ b/.github/workflows/vcpkg.yml @@ -28,6 +28,7 @@ jobs: -DMEGAMOL_USE_OSPRAY=ON -DMEGAMOL_USE_STACKTRACE=ON -DMEGAMOL_USE_TRACY=ON + -DMEGAMOL_USE_VTKM=ON env: VCPKG_BINARY_SOURCES: "clear;http,https://vcpkg-cache.megamol.org/{triplet}-{name}-{sha},readwrite,Authorization: Token ${{ secrets.CACHING_SERVER_SECRET }}" linux: @@ -58,6 +59,7 @@ jobs: -DMEGAMOL_USE_OSPRAY=ON -DMEGAMOL_USE_STACKTRACE=ON -DMEGAMOL_USE_TRACY=ON + -DMEGAMOL_USE_VTKM=ON env: CC: ${{ matrix.compiler.cc }} CXX: ${{ matrix.compiler.cxx }} diff --git a/cmake/vcpkg_triplets/x64-linux-dynamic.cmake b/cmake/vcpkg_triplets/x64-linux-dynamic.cmake new file mode 100644 index 0000000000..96281a5071 --- /dev/null +++ b/cmake/vcpkg_triplets/x64-linux-dynamic.cmake @@ -0,0 +1,12 @@ +set(VCPKG_TARGET_ARCHITECTURE x64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE dynamic) + +set(VCPKG_CMAKE_SYSTEM_NAME Linux) + +set(VCPKG_FIXUP_ELF_RPATH ON) + +# Debug build is very large, i.e., runs into GitHub Actions runner limits. +if (PORT EQUAL "vtk-m") + set(VCPKG_BUILD_TYPE release) +endif () diff --git a/cmake/vcpkg_triplets/x64-linux.cmake b/cmake/vcpkg_triplets/x64-linux.cmake index be799b594e..985b9a4697 100644 --- a/cmake/vcpkg_triplets/x64-linux.cmake +++ b/cmake/vcpkg_triplets/x64-linux.cmake @@ -7,3 +7,8 @@ set(VCPKG_CMAKE_SYSTEM_NAME Linux) if (PORT EQUAL "tbb") set(VCPKG_LIBRARY_LINKAGE dynamic) endif () + +# Debug build is very large, i.e., runs into GitHub Actions runner limits. +if (PORT EQUAL "vtk-m") + set(VCPKG_BUILD_TYPE release) +endif () diff --git a/cmake/vcpkg_triplets/x64-windows-static.cmake b/cmake/vcpkg_triplets/x64-windows-static.cmake index 16974a476f..b47109cbdb 100644 --- a/cmake/vcpkg_triplets/x64-windows-static.cmake +++ b/cmake/vcpkg_triplets/x64-windows-static.cmake @@ -7,3 +7,8 @@ set(VCPKG_DISABLE_COMPILER_TRACKING ON) if (PORT EQUAL "tbb") set(VCPKG_LIBRARY_LINKAGE dynamic) endif () + +# Debug build is very large, i.e., runs into GitHub Actions runner limits. +if (PORT EQUAL "vtk-m") + set(VCPKG_BUILD_TYPE release) +endif () diff --git a/cmake/vcpkg_triplets/x64-windows.cmake b/cmake/vcpkg_triplets/x64-windows.cmake index 07d640a35b..b5fddd64c5 100644 --- a/cmake/vcpkg_triplets/x64-windows.cmake +++ b/cmake/vcpkg_triplets/x64-windows.cmake @@ -3,3 +3,8 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE dynamic) set(VCPKG_DISABLE_COMPILER_TRACKING ON) + +# Debug build is very large, i.e., runs into GitHub Actions runner limits. +if (PORT EQUAL "vtk-m") + set(VCPKG_BUILD_TYPE release) +endif () From 439491944ac5fae20e7e0a9f5a2894ec85cf263b Mon Sep 17 00:00:00 2001 From: Moritz Heinemann Date: Tue, 9 Jul 2024 17:18:17 +0200 Subject: [PATCH 05/20] refactor vcpkg cache action --- .github/workflows/vcpkg.yml | 119 +++++++++++++++++------------ cmake/megamol_feature_option.cmake | 5 +- 2 files changed, 74 insertions(+), 50 deletions(-) diff --git a/.github/workflows/vcpkg.yml b/.github/workflows/vcpkg.yml index 5597a87312..f7761d4e35 100644 --- a/.github/workflows/vcpkg.yml +++ b/.github/workflows/vcpkg.yml @@ -8,59 +8,80 @@ on: workflow_dispatch: jobs: - windows: + vcpkg_cache: # Skip on PR from forked repo as no secrets are available. if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} strategy: fail-fast: false matrix: - opengl: [ON, OFF] - name: "Windows (OpenGL-${{ matrix.opengl }})" - runs-on: windows-2019 - steps: - - uses: actions/checkout@v3 - - name: Configure - run: >- - cmake -S . -B ${{ github.workspace }}/build -G "Visual Studio 16 2019" - -DMEGAMOL_STOP_AFTER_VCPKG=ON - -DMEGAMOL_USE_CGAL=ON - -DMEGAMOL_USE_OPENGL=${{ matrix.opengl }} - -DMEGAMOL_USE_OSPRAY=ON - -DMEGAMOL_USE_STACKTRACE=ON - -DMEGAMOL_USE_TRACY=ON - -DMEGAMOL_USE_VTKM=ON - env: - VCPKG_BINARY_SOURCES: "clear;http,https://vcpkg-cache.megamol.org/{triplet}-{name}-{sha},readwrite,Authorization: Token ${{ secrets.CACHING_SERVER_SECRET }}" - linux: - # Skip on PR from forked repo as no secrets are available. - if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} - strategy: - fail-fast: false - matrix: - docker_image: [megamol_ci_ubuntu] - compiler: - - cc: clang-18 - cxx: clang++-18 - - cc: gcc-13 - cxx: g++-13 - opengl: [ON, OFF] - name: "${{ matrix.docker_image }} (${{ matrix.compiler.cc }}, OpenGL-${{ matrix.opengl }})" - runs-on: ubuntu-22.04 + job: + - name: 'Windows' + os: 'windows-2022' + container: '' + generator: 'Visual Studio 17 2022' + cc: '' + cxx: '' + - name: 'Ubuntu-GCC' + os: 'ubuntu-24.04' + container: 'ghcr.io/unistuttgart-visus/megamol_ci_ubuntu:master' + generator: 'Ninja' + cc: 'gcc-13' + cxx: 'g++-13' + - name: 'Ubuntu-Clang' + os: 'ubuntu-24.04' + container: 'ghcr.io/unistuttgart-visus/megamol_ci_ubuntu:master' + generator: 'Ninja' + cc: 'clang-18' + cxx: 'clang++-18' + name: "Vcpkg-${{ matrix.job.name }}" + runs-on: ${{ matrix.job.os }} container: - image: ghcr.io/unistuttgart-visus/${{ matrix.docker_image }}:master + image: ${{ matrix.job.container }} steps: - - uses: actions/checkout@v3 - - name: Configure - run: >- - cmake -S . -B ${{ github.workspace }}/build -G "Unix Makefiles" - -DMEGAMOL_STOP_AFTER_VCPKG=ON - -DMEGAMOL_USE_CGAL=ON - -DMEGAMOL_USE_OPENGL=${{ matrix.opengl }} - -DMEGAMOL_USE_OSPRAY=ON - -DMEGAMOL_USE_STACKTRACE=ON - -DMEGAMOL_USE_TRACY=ON - -DMEGAMOL_USE_VTKM=ON - env: - CC: ${{ matrix.compiler.cc }} - CXX: ${{ matrix.compiler.cxx }} - VCPKG_BINARY_SOURCES: "clear;http,https://vcpkg-cache.megamol.org/{triplet}-{name}-{sha},readwrite,Authorization: Token ${{ secrets.CACHING_SERVER_SECRET }}" + - uses: actions/checkout@v4 + with: + show-progress: false + - name: Download Vcpkg + # Download vcpkg in advance, to download only once. MegaMol will detect the vcpkg directory in the repo root + # folder automatically. + run: | + version=$(LC_ALL=C.UTF-8 grep -oP 'set\(MEGAMOL_VCPKG_VERSION "\K[^"]+' CMakeLists.txt) + git clone https://github.com/microsoft/vcpkg.git vcpkg + cd vcpkg && git reset --hard $version && cd .. + shell: bash + - name: Find MegaMol Feature Options + run: | + import json + with open('vcpkg.json') as f: + features = json.load(f)['features'] + features = [f.upper().replace('-', '_') for f in features if 'dependencies' in features[f]] + with open('MEGAMOL_FEATURES', 'w') as f: + f.write(' '.join(features)) + shell: python3 {0} + - name: Build Vcpkg Ports + # Vcpkg ports may are required with different feature sets, based on the MegaMol features, e.g., `megamol` + # requires `a` and `megamol[foo]` requires `a[bar]`. We need to build both `a` and `a[foo]` for the cache. The + # problem extents to all transitive dependencies. Because we cannot try to build all possible combinations of + # enabled MegaMol features, we use the following heuristic to hopefully cover most cases: 1. MegaMol with no + # features, 2. MegaMol with all features, 3. For every feature MegaMol with only this feature enabled. + run: | + echo "::group::Build Cache No Features" + cmake -S . -B "$GITHUB_WORKSPACE/build" -G "${{ matrix.job.generator }}" -DMEGAMOL_STOP_AFTER_VCPKG=ON -DMEGAMOL_DISABLE_ALL_FEATURES=ON + rm -rf "$GITHUB_WORKSPACE/build" + echo "::endgroup::" + echo "::group::Build Cache All Features" + cmake -S . -B "$GITHUB_WORKSPACE/build" -G "${{ matrix.job.generator }}" -DMEGAMOL_STOP_AFTER_VCPKG=ON -DMEGAMOL_ENABLE_ALL_FEATURES=ON + rm -rf "$GITHUB_WORKSPACE/build" + echo "::endgroup::" + features=$( Date: Tue, 9 Jul 2024 18:08:15 +0200 Subject: [PATCH 06/20] add feature ignore list --- .github/workflows/vcpkg.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vcpkg.yml b/.github/workflows/vcpkg.yml index f7761d4e35..406adb66ed 100644 --- a/.github/workflows/vcpkg.yml +++ b/.github/workflows/vcpkg.yml @@ -21,18 +21,21 @@ jobs: generator: 'Visual Studio 17 2022' cc: '' cxx: '' + ignore_features: 'MPI POWER' - name: 'Ubuntu-GCC' os: 'ubuntu-24.04' container: 'ghcr.io/unistuttgart-visus/megamol_ci_ubuntu:master' generator: 'Ninja' cc: 'gcc-13' cxx: 'g++-13' + ignore_features: 'POWER' - name: 'Ubuntu-Clang' os: 'ubuntu-24.04' container: 'ghcr.io/unistuttgart-visus/megamol_ci_ubuntu:master' generator: 'Ninja' cc: 'clang-18' cxx: 'clang++-18' + ignore_features: 'POWER' name: "Vcpkg-${{ matrix.job.name }}" runs-on: ${{ matrix.job.os }} container: @@ -55,6 +58,8 @@ jobs: with open('vcpkg.json') as f: features = json.load(f)['features'] features = [f.upper().replace('-', '_') for f in features if 'dependencies' in features[f]] + ignored = '${{ matrix.job.ignore_features }}'.split() + features = [f for f in features if f not in ignored] with open('MEGAMOL_FEATURES', 'w') as f: f.write(' '.join(features)) shell: python3 {0} @@ -66,17 +71,24 @@ jobs: # features, 2. MegaMol with all features, 3. For every feature MegaMol with only this feature enabled. run: | echo "::group::Build Cache No Features" - cmake -S . -B "$GITHUB_WORKSPACE/build" -G "${{ matrix.job.generator }}" -DMEGAMOL_STOP_AFTER_VCPKG=ON -DMEGAMOL_DISABLE_ALL_FEATURES=ON + cmake -S . -B "$GITHUB_WORKSPACE/build" -G "${{ matrix.job.generator }}" \ + -DMEGAMOL_STOP_AFTER_VCPKG=ON \ + -DMEGAMOL_DISABLE_ALL_FEATURES=ON rm -rf "$GITHUB_WORKSPACE/build" echo "::endgroup::" echo "::group::Build Cache All Features" - cmake -S . -B "$GITHUB_WORKSPACE/build" -G "${{ matrix.job.generator }}" -DMEGAMOL_STOP_AFTER_VCPKG=ON -DMEGAMOL_ENABLE_ALL_FEATURES=ON + cmake -S . -B "$GITHUB_WORKSPACE/build" -G "${{ matrix.job.generator }}" \ + -DMEGAMOL_STOP_AFTER_VCPKG=ON \ + -DMEGAMOL_ENABLE_ALL_FEATURES=ON \ + $(echo "${{ matrix.job.ignore_features }}" | sed -e 's/\([^ ]*\)/-DMEGAMOL_USE_\1=OFF/g') rm -rf "$GITHUB_WORKSPACE/build" echo "::endgroup::" features=$( Date: Tue, 9 Jul 2024 19:52:26 +0200 Subject: [PATCH 07/20] add ignored features --- .github/workflows/vcpkg.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vcpkg.yml b/.github/workflows/vcpkg.yml index 406adb66ed..dda25fabf9 100644 --- a/.github/workflows/vcpkg.yml +++ b/.github/workflows/vcpkg.yml @@ -28,14 +28,14 @@ jobs: generator: 'Ninja' cc: 'gcc-13' cxx: 'g++-13' - ignore_features: 'POWER' + ignore_features: 'CUESDK VR_INTEROP POWER' - name: 'Ubuntu-Clang' os: 'ubuntu-24.04' container: 'ghcr.io/unistuttgart-visus/megamol_ci_ubuntu:master' generator: 'Ninja' cc: 'clang-18' cxx: 'clang++-18' - ignore_features: 'POWER' + ignore_features: 'CUESDK VR_INTEROP POWER' name: "Vcpkg-${{ matrix.job.name }}" runs-on: ${{ matrix.job.os }} container: From 419615f2e3e94ea02c719f10e58e2b113c7747b0 Mon Sep 17 00:00:00 2001 From: Moritz Heinemann Date: Tue, 9 Jul 2024 19:54:24 +0200 Subject: [PATCH 08/20] merge build and vcpkg yml --- .github/workflows/build.yml | 61 ------------------------------------- .github/workflows/vcpkg.yml | 54 +++++++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 62 deletions(-) delete mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 79686a791f..0000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Build - -on: - push: - branches: [master] - pull_request: - branches: [master] - -env: - MM_DEFAULT_CONFIG: >- - -DMEGAMOL_VCPKG_DOWNLOAD_CACHE=ON - -DMEGAMOL_WARNING_LEVEL="Off" - -DMEGAMOL_PLUGIN_MEGAMOL101_GL=ON - -DMEGAMOL_PLUGIN_IMAGESERIES=ON - -DMEGAMOL_PLUGIN_IMAGESERIES_GL=ON - -DMEGAMOL_USE_CGAL=ON - -DMEGAMOL_USE_PROFILING=ON - -DMEGAMOL_USE_STACKTRACE=ON - -DMEGAMOL_USE_TRACY=ON - -DMEGAMOL_USE_VTKM=OFF - -jobs: - windows: - strategy: - fail-fast: false - matrix: - configuration: [Release] - name: "Windows-Build (${{ matrix.configuration }})" - runs-on: windows-2022 - steps: - - uses: actions/checkout@v4 - - name: Configure - run: >- - cmake -S . -B ${{ github.workspace }}/build -G "Visual Studio 17 2022" - ${{ env.MM_DEFAULT_CONFIG }} - - name: Build - run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.configuration }} --parallel 2 - linux: - strategy: - fail-fast: false - matrix: - docker_image: [megamol_ci_ubuntu] - compiler: - - cc: clang-14 - cxx: clang++-14 - configuration: [Release] - name: "Linux-Build (${{ matrix.compiler.cc }}, ${{ matrix.configuration }})" - runs-on: ubuntu-22.04 - container: - image: ghcr.io/unistuttgart-visus/${{ matrix.docker_image }}:master - steps: - - uses: actions/checkout@v4 - - name: Configure - run: >- - cmake -S . -B ${{ github.workspace }}/build -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} - ${{ env.MM_DEFAULT_CONFIG }} - - name: Build - run: cmake --build ${{ github.workspace }}/build - env: - CC: ${{ matrix.compiler.cc }} - CXX: ${{ matrix.compiler.cxx }} diff --git a/.github/workflows/vcpkg.yml b/.github/workflows/vcpkg.yml index dda25fabf9..0577b46433 100644 --- a/.github/workflows/vcpkg.yml +++ b/.github/workflows/vcpkg.yml @@ -1,4 +1,4 @@ -name: Vcpkg Cache +name: Build on: push: @@ -7,6 +7,19 @@ on: branches: [ master ] workflow_dispatch: +env: + MM_DEFAULT_CONFIG: >- + -DMEGAMOL_VCPKG_DOWNLOAD_CACHE=ON + -DMEGAMOL_WARNING_LEVEL="Off" + -DMEGAMOL_PLUGIN_MEGAMOL101_GL=ON + -DMEGAMOL_PLUGIN_IMAGESERIES=ON + -DMEGAMOL_PLUGIN_IMAGESERIES_GL=ON + -DMEGAMOL_USE_CGAL=ON + -DMEGAMOL_USE_PROFILING=ON + -DMEGAMOL_USE_STACKTRACE=ON + -DMEGAMOL_USE_TRACY=ON + -DMEGAMOL_USE_VTKM=OFF + jobs: vcpkg_cache: # Skip on PR from forked repo as no secrets are available. @@ -97,3 +110,42 @@ jobs: CC: ${{ matrix.job.cc }} CXX: ${{ matrix.job.cxx }} VCPKG_BINARY_SOURCES: "clear;http,https://vcpkg-cache.megamol.org/{triplet}-{name}-{sha},readwrite,Authorization: Token ${{ secrets.CACHING_SERVER_SECRET }}" + build_windows: + strategy: + fail-fast: false + matrix: + configuration: [Release] + name: "Windows-Build (${{ matrix.configuration }})" + runs-on: windows-2022 + steps: + - uses: actions/checkout@v4 + - name: Configure + run: >- + cmake -S . -B ${{ github.workspace }}/build -G "Visual Studio 17 2022" + ${{ env.MM_DEFAULT_CONFIG }} + - name: Build + run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.configuration }} --parallel 2 + build_linux: + strategy: + fail-fast: false + matrix: + docker_image: [megamol_ci_ubuntu] + compiler: + - cc: clang-14 + cxx: clang++-14 + configuration: [Release] + name: "Linux-Build (${{ matrix.compiler.cc }}, ${{ matrix.configuration }})" + runs-on: ubuntu-22.04 + container: + image: ghcr.io/unistuttgart-visus/${{ matrix.docker_image }}:master + steps: + - uses: actions/checkout@v4 + - name: Configure + run: >- + cmake -S . -B ${{ github.workspace }}/build -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} + ${{ env.MM_DEFAULT_CONFIG }} + - name: Build + run: cmake --build ${{ github.workspace }}/build + env: + CC: ${{ matrix.compiler.cc }} + CXX: ${{ matrix.compiler.cxx }} From 44780a1fc1e7ad7fff2bbde8aaf3b631111536b3 Mon Sep 17 00:00:00 2001 From: Moritz Heinemann Date: Tue, 9 Jul 2024 19:55:25 +0200 Subject: [PATCH 09/20] rename files --- .github/workflows/{vcpkg.yml => build.yml} | 0 .github/workflows/{style_check.yml => checks.yml} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{vcpkg.yml => build.yml} (100%) rename .github/workflows/{style_check.yml => checks.yml} (100%) diff --git a/.github/workflows/vcpkg.yml b/.github/workflows/build.yml similarity index 100% rename from .github/workflows/vcpkg.yml rename to .github/workflows/build.yml diff --git a/.github/workflows/style_check.yml b/.github/workflows/checks.yml similarity index 100% rename from .github/workflows/style_check.yml rename to .github/workflows/checks.yml From 39e533574eeaf7c977c1ef5d4f05cc27c5ee7c37 Mon Sep 17 00:00:00 2001 From: Moritz Heinemann Date: Tue, 9 Jul 2024 19:56:56 +0200 Subject: [PATCH 10/20] Merge CI checks --- .github/workflows/checks.yml | 16 +++++++++++++++- .github/workflows/shader_check.yml | 23 ----------------------- 2 files changed, 15 insertions(+), 24 deletions(-) delete mode 100644 .github/workflows/shader_check.yml diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 23e6a0c241..c50cbdf485 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -1,4 +1,4 @@ -name: Style-Check +name: Checks on: push: @@ -33,3 +33,17 @@ jobs: - uses: actions/checkout@v3 - name: Run plugin check run: .ci/check_plugins.sh + shader_check: + name: Shader-Check + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Download glslang + run: | + mkdir bin + wget "https://github.com/KhronosGroup/glslang/releases/download/main-tot/glslang-main-linux-Release.zip" + unzip -j "glslang-main-linux-Release.zip" "bin/glslang" -d ./bin + rm "glslang-main-linux-Release.zip" + echo "./bin" >> $GITHUB_PATH + - name: Run shader check + run: .ci/check_shaders.sh diff --git a/.github/workflows/shader_check.yml b/.github/workflows/shader_check.yml deleted file mode 100644 index 827c5946ea..0000000000 --- a/.github/workflows/shader_check.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Shader-Check - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - shader_check: - name: Shader-Check - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - name: Download glslang - run: | - mkdir bin - wget "https://github.com/KhronosGroup/glslang/releases/download/main-tot/glslang-main-linux-Release.zip" - unzip -j "glslang-main-linux-Release.zip" "bin/glslang" -d ./bin - rm "glslang-main-linux-Release.zip" - echo "./bin" >> $GITHUB_PATH - - name: Run shader check - run: .ci/check_shaders.sh From 559495645f2a863e48a15e340f1d866d560b9a8a Mon Sep 17 00:00:00 2001 From: Moritz Heinemann Date: Tue, 9 Jul 2024 20:18:52 +0200 Subject: [PATCH 11/20] build all configurations with github actions --- .github/workflows/build.yml | 73 +++++++++++++++++++++++++++---------- 1 file changed, 54 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0577b46433..6c366be119 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,11 @@ env: -DMEGAMOL_USE_PROFILING=ON -DMEGAMOL_USE_STACKTRACE=ON -DMEGAMOL_USE_TRACY=ON - -DMEGAMOL_USE_VTKM=OFF + -DMEGAMOL_USE_VTKM=ON + MM_NO_GL_CONFIG: >- + -DMEGAMOL_VCPKG_DOWNLOAD_CACHE=ON + -DMEGAMOL_WARNING_LEVEL="Off" + -DMEGAMOL_USE_OPENGL=OFF jobs: vcpkg_cache: @@ -111,41 +115,72 @@ jobs: CXX: ${{ matrix.job.cxx }} VCPKG_BINARY_SOURCES: "clear;http,https://vcpkg-cache.megamol.org/{triplet}-{name}-{sha},readwrite,Authorization: Token ${{ secrets.CACHING_SERVER_SECRET }}" build_windows: + if: ${{ always() }} + needs: vcpkg_cache strategy: fail-fast: false matrix: - configuration: [Release] - name: "Windows-Build (${{ matrix.configuration }})" + job: + - name: Release + configuration: Release + options: ${{ env.MM_DEFAULT_CONFIG }} + - name: Debug + configuration: Debug + options: ${{ env.MM_DEFAULT_CONFIG }} + - name: Release-No-GL + configuration: Release + options: ${{ env.MM_NO_GL_CONFIG }} + name: "Windows (${{ matrix.job.name }})" runs-on: windows-2022 steps: - uses: actions/checkout@v4 + with: + show-progress: false - name: Configure run: >- - cmake -S . -B ${{ github.workspace }}/build -G "Visual Studio 17 2022" - ${{ env.MM_DEFAULT_CONFIG }} + cmake -S . -B $GITHUB_WORKSPACE/build -G "Visual Studio 17 2022" + ${{ matrix.job.options }} - name: Build - run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.configuration }} --parallel 2 + run: cmake --build $GITHUB_WORKSPACE/build --config ${{ matrix.job.configuration }} --parallel 2 build_linux: + if: ${{ always() }} + needs: vcpkg_cache strategy: fail-fast: false matrix: - docker_image: [megamol_ci_ubuntu] - compiler: - - cc: clang-14 - cxx: clang++-14 - configuration: [Release] - name: "Linux-Build (${{ matrix.compiler.cc }}, ${{ matrix.configuration }})" - runs-on: ubuntu-22.04 + job: + - name: 'GCC13 Debug' + container: megamol_ci_ubuntu + cc: gcc-13 + cxx: g++-13 + configuration: Debug + options: ${{ env.MM_DEFAULT_CONFIG }} + - name: 'Clang18 Release' + container: megamol_ci_ubuntu + cc: clang-18 + cxx: clang++-18 + configuration: Release + options: ${{ env.MM_DEFAULT_CONFIG }} + - name: 'GCC13 Release No-GL' + container: megamol_ci_ubuntu + cc: gcc-13 + cxx: g++-13 + configuration: Release + options: ${{ env.MM_NO_GL_CONFIG }} + name: "Linux (${{ matrix.job.name }})" + runs-on: ubuntu-24.04 container: - image: ghcr.io/unistuttgart-visus/${{ matrix.docker_image }}:master + image: ghcr.io/unistuttgart-visus/${{ matrix.job.container }}:master steps: - uses: actions/checkout@v4 + with: + show-progress: false - name: Configure run: >- - cmake -S . -B ${{ github.workspace }}/build -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} - ${{ env.MM_DEFAULT_CONFIG }} + cmake -S . -B $GITHUB_WORKSPACE/build -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.job.configuration }} + ${{ matrix.job.options }} - name: Build - run: cmake --build ${{ github.workspace }}/build + run: cmake --build $GITHUB_WORKSPACE/build env: - CC: ${{ matrix.compiler.cc }} - CXX: ${{ matrix.compiler.cxx }} + CC: ${{ matrix.job.cc }} + CXX: ${{ matrix.job.cxx }} From 81a1fe038dcb33dbf48ee6a3dee8fd0c8292f775 Mon Sep 17 00:00:00 2001 From: Moritz Heinemann Date: Tue, 9 Jul 2024 20:33:21 +0200 Subject: [PATCH 12/20] fix github yml --- .github/workflows/build.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6c366be119..aa239df403 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -123,13 +123,13 @@ jobs: job: - name: Release configuration: Release - options: ${{ env.MM_DEFAULT_CONFIG }} + no-gl: false - name: Debug configuration: Debug - options: ${{ env.MM_DEFAULT_CONFIG }} + no-gl: false - name: Release-No-GL configuration: Release - options: ${{ env.MM_NO_GL_CONFIG }} + no-gl: true name: "Windows (${{ matrix.job.name }})" runs-on: windows-2022 steps: @@ -139,7 +139,7 @@ jobs: - name: Configure run: >- cmake -S . -B $GITHUB_WORKSPACE/build -G "Visual Studio 17 2022" - ${{ matrix.job.options }} + ${{ matrix.job.no-gl && env.MM_NO_GL_CONFIG || env.MM_DEFAULT_CONFIG }} - name: Build run: cmake --build $GITHUB_WORKSPACE/build --config ${{ matrix.job.configuration }} --parallel 2 build_linux: @@ -154,19 +154,19 @@ jobs: cc: gcc-13 cxx: g++-13 configuration: Debug - options: ${{ env.MM_DEFAULT_CONFIG }} + no-gl: false - name: 'Clang18 Release' container: megamol_ci_ubuntu cc: clang-18 cxx: clang++-18 configuration: Release - options: ${{ env.MM_DEFAULT_CONFIG }} + no-gl: false - name: 'GCC13 Release No-GL' container: megamol_ci_ubuntu cc: gcc-13 cxx: g++-13 configuration: Release - options: ${{ env.MM_NO_GL_CONFIG }} + no-gl: true name: "Linux (${{ matrix.job.name }})" runs-on: ubuntu-24.04 container: @@ -178,7 +178,7 @@ jobs: - name: Configure run: >- cmake -S . -B $GITHUB_WORKSPACE/build -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.job.configuration }} - ${{ matrix.job.options }} + ${{ matrix.job.no-gl && env.MM_NO_GL_CONFIG || env.MM_DEFAULT_CONFIG }} - name: Build run: cmake --build $GITHUB_WORKSPACE/build env: From aee83f739d0a4fa3559064c97c705dfb1ea133ef Mon Sep 17 00:00:00 2001 From: Moritz Heinemann Date: Wed, 10 Jul 2024 12:14:35 +0200 Subject: [PATCH 13/20] update actions --- .github/workflows/checks.yml | 18 ++++++++++++------ .github/workflows/docker.yml | 12 +++++++----- .github/workflows/style_check_comment.yml | 6 +++--- .github/workflows/style_fix.yml | 12 +++++++----- 4 files changed, 29 insertions(+), 19 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index c50cbdf485..eb7a81ab44 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -9,9 +9,11 @@ on: jobs: style_check: name: Style-Check - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + with: + show-progress: false - name: Install clang-format run: .ci/install-clang-format.sh - name: Run format check @@ -28,16 +30,20 @@ jobs: path: pr/ plugin_check: name: Plugin-Check - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + with: + show-progress: false - name: Run plugin check run: .ci/check_plugins.sh shader_check: name: Shader-Check - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + with: + show-progress: false - name: Download glslang run: | mkdir bin diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 651cdff7ab..c85fab413e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -20,26 +20,28 @@ jobs: - dockerfile_dir: oraclelinux image_name: megamol_ci_oraclelinux name: Docker-Build - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 permissions: contents: read packages: write steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + show-progress: false - name: Docker login - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Docker metadata id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ matrix.config.image_name }} - name: Docker build/push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v6 with: context: .ci/docker/${{ matrix.config.dockerfile_dir }} push: true diff --git a/.github/workflows/style_check_comment.yml b/.github/workflows/style_check_comment.yml index 15d84f2897..6beca8069a 100644 --- a/.github/workflows/style_check_comment.yml +++ b/.github/workflows/style_check_comment.yml @@ -11,11 +11,11 @@ jobs: style_check_comment: name: Style-Check-Comment if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'failure' }} - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: # https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ - name: Download artifact - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: script: | var artifacts = await github.rest.actions.listWorkflowRunArtifacts({ @@ -39,7 +39,7 @@ jobs: }); - run: unzip pr.zip - name: Comment - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: script: | var fs = require('fs'); diff --git a/.github/workflows/style_fix.yml b/.github/workflows/style_fix.yml index 303a50c53c..bb0b3d6892 100644 --- a/.github/workflows/style_fix.yml +++ b/.github/workflows/style_fix.yml @@ -8,11 +8,11 @@ jobs: style_fix: name: Style-Fix if: ${{ github.event.issue.pull_request && github.event.comment.body == '/format' }} - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Get PR Info id: pr-info - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: script: | const pr = await github.rest.pulls.get({ @@ -23,18 +23,20 @@ jobs: core.setOutput('REPO', pr.data.head.repo.full_name); core.setOutput('REF', pr.data.head.ref); # Checkout master - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: master path: master token: ${{ secrets.PAT_MEGAMOLSERVICE }} + show-progress: false # Checkout PR repo/branch - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: repository: ${{ steps.pr-info.outputs.REPO }} ref: ${{ steps.pr-info.outputs.REF }} path: pr token: ${{ secrets.PAT_MEGAMOLSERVICE }} + show-progress: false - name: Install clang-format run: master/.ci/install-clang-format.sh - name: Fix style @@ -55,7 +57,7 @@ jobs: fi - name: Comment if: ${{ failure() }} - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: script: | await github.rest.issues.createComment({ From bcbe11cd0cdead7de1983e1db40e56058639c09f Mon Sep 17 00:00:00 2001 From: Moritz Heinemann Date: Wed, 10 Jul 2024 14:42:57 +0200 Subject: [PATCH 14/20] build with ninja on windows --- .github/workflows/build.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aa239df403..50ec0ec03a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -133,12 +133,21 @@ jobs: name: "Windows (${{ matrix.job.name }})" runs-on: windows-2022 steps: + - name: Install Ninja + run: | + $ninjaPath = "$env:RUNNER_WORKSPACE\ninja" + New-Item -ItemType Directory -Force -Path $ninjaPath + Invoke-WebRequest -Uri "https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-win.zip" -OutFile "$ninjaPath\ninja.zip" + Expand-Archive -Path "$ninjaPath\ninja.zip" -DestinationPath $ninjaPath + Remove-Item "$ninjaPath\ninja.zip" -Force + echo "$ninjaPath" | Out-File -Append -FilePath $env:GITHUB_PATH + shell: pwsh - uses: actions/checkout@v4 with: show-progress: false - name: Configure run: >- - cmake -S . -B $GITHUB_WORKSPACE/build -G "Visual Studio 17 2022" + cmake -S . -B $GITHUB_WORKSPACE/build -G "Ninja" ${{ matrix.job.no-gl && env.MM_NO_GL_CONFIG || env.MM_DEFAULT_CONFIG }} - name: Build run: cmake --build $GITHUB_WORKSPACE/build --config ${{ matrix.job.configuration }} --parallel 2 From fe4e70b14365affff4d4e5d9f5ae8e870d0d5867 Mon Sep 17 00:00:00 2001 From: Moritz Heinemann Date: Wed, 10 Jul 2024 16:19:39 +0200 Subject: [PATCH 15/20] use third party actions for msvc env and ninja --- .github/workflows/build.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 50ec0ec03a..f581a667b6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -133,18 +133,13 @@ jobs: name: "Windows (${{ matrix.job.name }})" runs-on: windows-2022 steps: - - name: Install Ninja - run: | - $ninjaPath = "$env:RUNNER_WORKSPACE\ninja" - New-Item -ItemType Directory -Force -Path $ninjaPath - Invoke-WebRequest -Uri "https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-win.zip" -OutFile "$ninjaPath\ninja.zip" - Expand-Archive -Path "$ninjaPath\ninja.zip" -DestinationPath $ninjaPath - Remove-Item "$ninjaPath\ninja.zip" -Force - echo "$ninjaPath" | Out-File -Append -FilePath $env:GITHUB_PATH - shell: pwsh - uses: actions/checkout@v4 with: show-progress: false + - uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 + - uses: seanmiddleditch/gha-setup-ninja@96bed6edff20d1dd61ecff9b75cc519d516e6401 # v5 + with: + destination: $RUNNER_WORKSPACE/ninja-build - name: Configure run: >- cmake -S . -B $GITHUB_WORKSPACE/build -G "Ninja" From cb9174ef8c678e2c7ab55eb4d69acf65d1c4addd Mon Sep 17 00:00:00 2001 From: Moritz Heinemann Date: Wed, 10 Jul 2024 16:57:57 +0200 Subject: [PATCH 16/20] consistent naming --- .github/workflows/build.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f581a667b6..d81ff9b308 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -121,16 +121,16 @@ jobs: fail-fast: false matrix: job: - - name: Release + - name: 'Release' configuration: Release no-gl: false - - name: Debug + - name: 'Debug' configuration: Debug no-gl: false - - name: Release-No-GL + - name: 'Release-No-GL' configuration: Release no-gl: true - name: "Windows (${{ matrix.job.name }})" + name: "Windows-${{ matrix.job.name }}" runs-on: windows-2022 steps: - uses: actions/checkout@v4 @@ -153,25 +153,25 @@ jobs: fail-fast: false matrix: job: - - name: 'GCC13 Debug' + - name: 'GCC-Debug' container: megamol_ci_ubuntu cc: gcc-13 cxx: g++-13 configuration: Debug no-gl: false - - name: 'Clang18 Release' + - name: 'Clang-Release' container: megamol_ci_ubuntu cc: clang-18 cxx: clang++-18 configuration: Release no-gl: false - - name: 'GCC13 Release No-GL' + - name: 'GCC-Release-No-GL' container: megamol_ci_ubuntu cc: gcc-13 cxx: g++-13 configuration: Release no-gl: true - name: "Linux (${{ matrix.job.name }})" + name: "Linux-${{ matrix.job.name }}" runs-on: ubuntu-24.04 container: image: ghcr.io/unistuttgart-visus/${{ matrix.job.container }}:master From 5c9e917436bb827dbffd9a4524de7e28b5e9ec83 Mon Sep 17 00:00:00 2001 From: Moritz Heinemann Date: Wed, 10 Jul 2024 17:03:10 +0200 Subject: [PATCH 17/20] default enable imageseries --- .github/workflows/build.yml | 2 -- azure-pipelines.yml | 2 -- plugins/imageseries/CMakeLists.txt | 4 ++-- plugins/imageseries_gl/CMakeLists.txt | 4 ++-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d81ff9b308..c5ddac77a1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,8 +12,6 @@ env: -DMEGAMOL_VCPKG_DOWNLOAD_CACHE=ON -DMEGAMOL_WARNING_LEVEL="Off" -DMEGAMOL_PLUGIN_MEGAMOL101_GL=ON - -DMEGAMOL_PLUGIN_IMAGESERIES=ON - -DMEGAMOL_PLUGIN_IMAGESERIES_GL=ON -DMEGAMOL_USE_CGAL=ON -DMEGAMOL_USE_PROFILING=ON -DMEGAMOL_USE_STACKTRACE=ON diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 36967eaee6..d7924565d8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -10,8 +10,6 @@ variables: -DMEGAMOL_VCPKG_DOWNLOAD_CACHE=ON -DMEGAMOL_WARNING_LEVEL="Off" -DMEGAMOL_PLUGIN_MEGAMOL101_GL=ON - -DMEGAMOL_PLUGIN_IMAGESERIES=ON - -DMEGAMOL_PLUGIN_IMAGESERIES_GL=ON -DMEGAMOL_USE_CGAL=ON -DMEGAMOL_USE_PROFILING=ON -DMEGAMOL_USE_STACKTRACE=ON diff --git a/plugins/imageseries/CMakeLists.txt b/plugins/imageseries/CMakeLists.txt index 91230d3f3d..e7a051e188 100644 --- a/plugins/imageseries/CMakeLists.txt +++ b/plugins/imageseries/CMakeLists.txt @@ -1,10 +1,10 @@ # MegaMol -# Copyright (c) 2021-2023, MegaMol Dev Team +# Copyright (c) 2021, MegaMol Dev Team # All rights reserved. # megamol_plugin(imageseries - BUILD_DEFAULT OFF + BUILD_DEFAULT ON DEPENDS_PLUGINS mmstd ) diff --git a/plugins/imageseries_gl/CMakeLists.txt b/plugins/imageseries_gl/CMakeLists.txt index 2ad3b0fc68..9658dd6cdb 100644 --- a/plugins/imageseries_gl/CMakeLists.txt +++ b/plugins/imageseries_gl/CMakeLists.txt @@ -1,10 +1,10 @@ # MegaMol -# Copyright (c) 2021-2023, MegaMol Dev Team +# Copyright (c) 2021, MegaMol Dev Team # All rights reserved. # megamol_plugin(imageseries_gl - BUILD_DEFAULT OFF + BUILD_DEFAULT ON DEPENDS_FEATURES opengl DEPENDS_PLUGINS From 6943e4b2efbcc2836c21b803db4164acd2bf324a Mon Sep 17 00:00:00 2001 From: Moritz Heinemann Date: Wed, 10 Jul 2024 19:40:49 +0200 Subject: [PATCH 18/20] remove azure pipelines --- .ci/check-pr-labels-step-bash.yml | 13 ---- .ci/check-pr-labels-step-pwsh.yml | 14 ---- azure-pipelines.yml | 116 ------------------------------ 3 files changed, 143 deletions(-) delete mode 100644 .ci/check-pr-labels-step-bash.yml delete mode 100644 .ci/check-pr-labels-step-pwsh.yml delete mode 100644 azure-pipelines.yml diff --git a/.ci/check-pr-labels-step-bash.yml b/.ci/check-pr-labels-step-bash.yml deleted file mode 100644 index 402b6fb266..0000000000 --- a/.ci/check-pr-labels-step-bash.yml +++ /dev/null @@ -1,13 +0,0 @@ -steps: -- bash: | - if [[ -n "${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}" ]]; then - label="no ci build" - url="https://api.github.com/repos/UniStuttgart-VISUS/megamol/issues/${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}/labels" - curl -s "${url}" | grep -q "\"${label}\"" - exit_code=$? - if [[ $exit_code -eq 0 ]]; then - echo "##[error]Cancel build! Was requested by setting the '${label}' label on the pull request." - exit 1 - fi - fi - displayName: 'Check PR label' diff --git a/.ci/check-pr-labels-step-pwsh.yml b/.ci/check-pr-labels-step-pwsh.yml deleted file mode 100644 index 982a3d8ec2..0000000000 --- a/.ci/check-pr-labels-step-pwsh.yml +++ /dev/null @@ -1,14 +0,0 @@ -steps: -- powershell: | - if ($Env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER) { - $label = "no ci build" - $url = "https://api.github.com/repos/UniStuttgart-VISUS/megamol/issues/$Env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER/labels" - $response = Invoke-RestMethod -Uri $url - foreach($element in $response) { - if ($element.name -eq $label) { - echo "##[error]Cancel build! Was requested by setting the '$label' label on the pull request." - exit 1 - } - } - } - displayName: 'Check PR label' diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index d7924565d8..0000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,116 +0,0 @@ - -trigger: -- master - -pr: -- master - -variables: - defaultConfig: >- - -DMEGAMOL_VCPKG_DOWNLOAD_CACHE=ON - -DMEGAMOL_WARNING_LEVEL="Off" - -DMEGAMOL_PLUGIN_MEGAMOL101_GL=ON - -DMEGAMOL_USE_CGAL=ON - -DMEGAMOL_USE_PROFILING=ON - -DMEGAMOL_USE_STACKTRACE=ON - -DMEGAMOL_USE_TRACY=ON - -DMEGAMOL_USE_VTKM=ON - nonGlConfig: >- - -DMEGAMOL_VCPKG_DOWNLOAD_CACHE=ON - -DMEGAMOL_WARNING_LEVEL="Off" - -DMEGAMOL_USE_OPENGL=OFF - -jobs: -- job: Windows - variables: - VCPKG_DEFAULT_BINARY_CACHE: '$(Agent.BuildDirectory)\vcpkg_cache\archives' - X_VCPKG_REGISTRIES_CACHE: '$(Agent.BuildDirectory)\vcpkg_cache\registries' - - strategy: - matrix: - 'VS2019 Release': - configuration: Release - cmakeExtraArgs: '$(defaultConfig)' - 'VS2019 Debug': - configuration: Debug - cmakeExtraArgs: '$(defaultConfig)' - 'VS2019 Release (nonGL)': - configuration: Release - cmakeExtraArgs: '$(nonGlConfig)' - - timeoutInMinutes: 720 - - pool: - name: 'default' - demands: - - Agent.OS -equals Windows_NT - - cmake - - VisualStudio_16.0 - - steps: - - template: .ci/check-pr-labels-step-pwsh.yml - - powershell: | - New-Item -ItemType "directory" -Path "$Env:VCPKG_DEFAULT_BINARY_CACHE" -Force - New-Item -ItemType "directory" -Path "$Env:X_VCPKG_REGISTRIES_CACHE" -Force - displayName: 'Setup vcpkg cache directories' - - task: CMake@1 - displayName: 'CMake Configure' - inputs: - cmakeArgs: '.. -G "Visual Studio 16 2019" -A"x64" $(cmakeExtraArgs)' - - task: CMake@1 - displayName: 'CMake Build' - inputs: - cmakeArgs: '--build . --config $(configuration)' - -- job: Linux - variables: - VCPKG_DEFAULT_BINARY_CACHE: '$(Agent.BuildDirectory)/vcpkg_cache/archives' - X_VCPKG_REGISTRIES_CACHE: '$(Agent.BuildDirectory)/vcpkg_cache/registries' - - strategy: - matrix: - 'GCC13 / Debug': - dockerImage: megamol_ci_ubuntu - cCompiler: gcc-13 - cxxCompiler: g++-13 - configuration: Debug - cmakeExtraArgs: '$(defaultConfig)' - 'Clang18 / Release': - dockerImage: megamol_ci_ubuntu - cCompiler: clang-18 - cxxCompiler: clang++-18 - configuration: Release - cmakeExtraArgs: '$(defaultConfig)' - 'GCC13 / Release (nonGL)': - dockerImage: megamol_ci_ubuntu - cCompiler: gcc-13 - cxxCompiler: g++-13 - configuration: Release - cmakeExtraArgs: '$(nonGlConfig)' - - timeoutInMinutes: 720 - - pool: - name: 'default' - demands: - - Agent.OS -equals Linux - - docker - - container: ghcr.io/unistuttgart-visus/$(dockerImage):master - - steps: - - template: .ci/check-pr-labels-step-bash.yml - - bash: | - mkdir -p $VCPKG_DEFAULT_BINARY_CACHE - mkdir -p $X_VCPKG_REGISTRIES_CACHE - displayName: 'Setup vcpkg cache directories' - - bash: echo "##vso[task.setvariable variable=numberOfCpuCores]$(nproc)" - displayName: 'Bash get number of CPU cores' - - task: CMake@1 - displayName: 'CMake Configure' - inputs: - cmakeArgs: '.. -G Ninja -DCMAKE_C_COMPILER=$(cCompiler) -DCMAKE_CXX_COMPILER=$(cxxCompiler) -DCMAKE_BUILD_TYPE=$(configuration) $(cmakeExtraArgs)' - - task: CMake@1 - displayName: 'CMake Build' - inputs: - cmakeArgs: '--build . --parallel $(numberOfCpuCores)' From a8de4b503ef8602f500c10492e75522225a35496 Mon Sep 17 00:00:00 2001 From: Moritz Heinemann Date: Wed, 10 Jul 2024 20:04:15 +0200 Subject: [PATCH 19/20] update to clang-format-17 --- .ci/check_format.sh | 6 +++--- .ci/install-clang-format.sh | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.ci/check_format.sh b/.ci/check_format.sh index c7c38b45a9..582da1fe1c 100755 --- a/.ci/check_format.sh +++ b/.ci/check_format.sh @@ -89,17 +89,17 @@ while read -r file; do if [[ "$is_cpp" == true ]]; then # ClangFormat if [[ "$_fix" == true ]]; then - clang-format-16 -i "$file" + clang-format-17 -i "$file" else # Workaround "set -e" and store exit code format_exit_code=0 - output="$(clang-format-16 --dry-run --Werror "$file" 2>&1)" || format_exit_code=$? + output="$(clang-format-17 --dry-run --Werror "$file" 2>&1)" || format_exit_code=$? if [[ $format_exit_code -ne 0 ]]; then EXIT_CODE=1 echo "::error::ClangFormat found issues in: $file" #echo "$output" # Show detailed diff. Requires ClangFormat to run again, but should mostly affect only a few files. - clang-format-16 "$file" | diff --color=always -u "$file" - || true + clang-format-17 "$file" | diff --color=always -u "$file" - || true fi fi diff --git a/.ci/install-clang-format.sh b/.ci/install-clang-format.sh index 164a537d78..9fd38c381e 100755 --- a/.ci/install-clang-format.sh +++ b/.ci/install-clang-format.sh @@ -3,5 +3,5 @@ set -e set -o pipefail wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc -sudo add-apt-repository --yes "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" -sudo apt-get install -y clang-format-16 +sudo add-apt-repository --yes "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-17 main" +sudo apt-get install -y clang-format-17 From 1a451c2cde0a7d26c66661acb77062193b37e42b Mon Sep 17 00:00:00 2001 From: Moritz Heinemann Date: Wed, 10 Jul 2024 20:05:11 +0200 Subject: [PATCH 20/20] run format --- plugins/datatools/src/ParticleNeighborhoodGraph.cpp | 2 +- plugins/protein_cuda/src/quicksurf/WKFThreads.cpp | 2 +- vislib/include/vislib/math/AbstractMatrix.h | 2 +- vislib/include/vislib/math/AbstractMatrixImpl.h | 4 ++-- vislib/src/sys/sysfunctions.cpp | 10 +++++----- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/plugins/datatools/src/ParticleNeighborhoodGraph.cpp b/plugins/datatools/src/ParticleNeighborhoodGraph.cpp index 326a530fbb..f0634565b9 100644 --- a/plugins/datatools/src/ParticleNeighborhoodGraph.cpp +++ b/plugins/datatools/src/ParticleNeighborhoodGraph.cpp @@ -245,7 +245,7 @@ void ParticleNeighborhoodGraph::calcData(geocalls::MultiParticleDataCall* data) float bboxCentY = bboxCent.Y(); float bboxCentZ = bboxCent.Z(); -#define _COORD(x, y, z) ((x) + ((y) + ((z) *y_size)) * x_size) +#define _COORD(x, y, z) ((x) + ((y) + ((z) * y_size)) * x_size) std::vector grid(d.get_count()); std::vector gridCell(x_size * y_size * z_size); diff --git a/plugins/protein_cuda/src/quicksurf/WKFThreads.cpp b/plugins/protein_cuda/src/quicksurf/WKFThreads.cpp index 3db35999e5..13cf28a5df 100644 --- a/plugins/protein_cuda/src/quicksurf/WKFThreads.cpp +++ b/plugins/protein_cuda/src/quicksurf/WKFThreads.cpp @@ -254,7 +254,7 @@ static void wkf_cpuid(unsigned int eax, unsigned int ecx, unsigned int* abcd) { #if defined(_MSC_VER) __cpuidex((int*) abcd, eax, ecx); #else - // uint32_t ebx, edx; + // uint32_t ebx, edx; unsigned int ebx = 0, edx = 0; #if defined(__i386__) && defined(__PIC__) /* in case of PIC under 32-bit EBX cannot be clobbered */ diff --git a/vislib/include/vislib/math/AbstractMatrix.h b/vislib/include/vislib/math/AbstractMatrix.h index 7a82f4dc1a..6be1664b86 100644 --- a/vislib/include/vislib/math/AbstractMatrix.h +++ b/vislib/include/vislib/math/AbstractMatrix.h @@ -177,7 +177,7 @@ unsigned int AbstractMatrix::FindEigenvalues( */ template T AbstractMatrix::Determinant() const { -#define A(r, c) a[(r) *D + (c)] +#define A(r, c) a[(r) * D + (c)] double a[D * D]; // input matrix for algorithm double f; // Multiplication factor. double max; // Row pivotising. diff --git a/vislib/include/vislib/math/AbstractMatrixImpl.h b/vislib/include/vislib/math/AbstractMatrixImpl.h index 408adf4af7..3c9e4b62b9 100644 --- a/vislib/include/vislib/math/AbstractMatrixImpl.h +++ b/vislib/include/vislib/math/AbstractMatrixImpl.h @@ -778,7 +778,7 @@ Vector AbstractMatrixImpl::GetRow(const int row) const { template class C> bool AbstractMatrixImpl::Invert() { -#define A(r, c) a[(r) *2 * D + (c)] +#define A(r, c) a[(r) * 2 * D + (c)] double a[2 * D * D]; // input matrix for algorithm double f; // Multiplication factor. double max; // Row pivotising. @@ -1382,7 +1382,7 @@ unsigned int AbstractMatrixImpl::findEigenvaluesSym( if (((outEigenvalues == NULL) && (outEigenvectors == NULL)) || (size == 0)) return 0; -#define A(r, c) a[(r) *D + (c)] +#define A(r, c) a[(r) * D + (c)] double a[D * D]; // input matrix for algorithm double d[D]; // diagonal elements double e[D]; // off-diagonal elements diff --git a/vislib/src/sys/sysfunctions.cpp b/vislib/src/sys/sysfunctions.cpp index 92673dda0d..893a277a4d 100644 --- a/vislib/src/sys/sysfunctions.cpp +++ b/vislib/src/sys/sysfunctions.cpp @@ -319,7 +319,7 @@ bool vislib::sys::ReadTextFile( } break; case TEXTFF_UNICODE: #ifdef _WIN32 - CASE_TEXTFF_UNICODE : + CASE_TEXTFF_UNICODE: #endif /* _WIN32 */ { vislib::StringW tmp; @@ -402,7 +402,7 @@ bool vislib::sys::ReadTextFile( } break; case TEXTFF_UNICODE: #ifdef _WIN32 - CASE_TEXTFF_UNICODE : + CASE_TEXTFF_UNICODE: #endif /* _WIN32 */ { wchar_t* src = outStr.AllocateBuffer(static_cast((len / sizeof(wchar_t)) + sizeof(wchar_t))); @@ -615,7 +615,7 @@ bool vislib::sys::WriteTextFile( goto CASE_TEXTFF_ASCII; break; case TEXTFF_ASCII: - CASE_TEXTFF_ASCII : { + CASE_TEXTFF_ASCII: { // no BOM possible StringA::Size len = text.Length(); return (static_cast(file.Write(text.PeekBuffer(), len)) == len); @@ -697,7 +697,7 @@ bool vislib::sys::WriteTextFile( break; case TEXTFF_UNICODE: #ifdef _WIN32 - CASE_TEXTFF_UNICODE : + CASE_TEXTFF_UNICODE: #endif /* _WIN32 */ { #ifdef _WIN32 @@ -710,7 +710,7 @@ bool vislib::sys::WriteTextFile( return (static_cast(file.Write(text.PeekBuffer(), len)) == len); } break; case TEXTFF_UTF8: - CASE_TEXTFF_UTF8 : { + CASE_TEXTFF_UTF8: { vislib::StringA bytes; UTF8Encoder::Encode(bytes, text); if (bom != TEXTFF_BOM_NO) {