From 6baa800b3d35f083c438571057d92c3d7f9f0a48 Mon Sep 17 00:00:00 2001 From: carlosgonzalez-elemwave Date: Fri, 10 Jul 2026 10:23:51 +0000 Subject: [PATCH 1/5] Tessellator | Environment | #72 | Use testMate to run all tests within vscode test explorer. --- .devcontainer/Dockerfile.base | 5 +- .devcontainer/devcontainer.json | 9 ++- .vscode/settings.dev.json | 4 +- CMakePresets.json | 125 ++++++++++++++++++-------------- 4 files changed, 84 insertions(+), 59 deletions(-) diff --git a/.devcontainer/Dockerfile.base b/.devcontainer/Dockerfile.base index 63abed7..b1f20ad 100644 --- a/.devcontainer/Dockerfile.base +++ b/.devcontainer/Dockerfile.base @@ -21,4 +21,7 @@ RUN apt-get install -y \ libgmp-dev \ libmpfr-dev -WORKDIR /workspace +RUN chown -R ubuntu:ubuntu /home/ubuntu + +USER ubuntu +WORKDIR /home/ubuntu/dev diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index aea4b2d..99b7fce 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,17 +2,18 @@ "name": "Tessellator", "dockerFile": "Dockerfile.base", "context": "..", - "remoteUser": "root", - "workspaceFolder": "/workspace", + "remoteUser": "ubuntu", + "workspaceFolder": "/home/ubuntu/dev", "mounts": [ - "source=${localWorkspaceFolder},target=/workspace,type=bind", + "source=${localWorkspaceFolder},target=/home/ubuntu/dev,type=bind" ], "customizations": { "vscode": { "extensions": [ "ms-vscode.cpptools", "ms-vscode.cmake-tools", - "vadimcn.vscode-lldb" + "vadimcn.vscode-lldb", + "matepek.vscode-catch2-test-adapter" ], "settings": { "cmake.configureOnOpen": false, diff --git a/.vscode/settings.dev.json b/.vscode/settings.dev.json index 7214448..45347a3 100644 --- a/.vscode/settings.dev.json +++ b/.vscode/settings.dev.json @@ -1,5 +1,7 @@ { "cmake.configureOnOpen": false, "cmake.configureOnEdit": false, - "cmake.autoSelectActiveFolder": false + "cmake.autoSelectActiveFolder": false, + "testMate.cpp.test.executables": "{build,build-dbg,Build,BUILD,out,Out,OUT}/**/*{test,Test,TEST}*", + "testMate.cpp.test.workingDirectory": "${workspaceFolder}" } diff --git a/CMakePresets.json b/CMakePresets.json index 322d7c9..8c3893e 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -1,56 +1,75 @@ { - "version": 4, - "configurePresets": [ - { - "name": "default", - "hidden": true, - "binaryDir": "build/", - "cacheVariables": { - "CMAKE_TOOLCHAIN_FILE": { - "type": "FILEPATH", - "value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" + "version": 4, + "configurePresets": [ + { + "name": "default", + "hidden": true, + "binaryDir": "build/", + "cacheVariables": { + "CMAKE_TOOLCHAIN_FILE": { + "type": "FILEPATH", + "value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" + } + } + }, + { + "name": "msbuild", + "displayName": "MSBuild Configure Settings", + "generator": "Visual Studio 17 2022", + "architecture": { + "strategy": "set", + "value": "x64" + }, + "inherits": "default" + }, + { + "name": "gnu", + "displayName": "GNU g++ compiler", + "generator": "Ninja", + "inherits": "default" + }, + { + "name": "docker", + "displayName": "Docker (system libraries)", + "description": "Uses system-installed libraries, skips vcpkg. Optimized for containerized builds.", + "generator": "Ninja", + "binaryDir": "build/", + "cacheVariables": { + "CMAKE_CXX_COMPILER": "g++", + "CMAKE_PREFIX_PATH": "/usr/local", + "CMAKE_FIND_ROOT_PATH": "/usr/local", + "TESSELLATOR_ENABLE_TESTS": "ON", + "TESSELLATOR_ENABLE_CGAL": "OFF" + } + }, + { + "name": "docker-dbg", + "inherits": "docker", + "displayName": "Docker-dbg (system libraries)", + "description": "Uses system-installed libraries, skips vcpkg. Optimized for containerized builds. Debug mode", + "binaryDir": "build-dbg/", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_CXX_COMPILER": "g++", + "CMAKE_PREFIX_PATH": "/usr/local", + "CMAKE_FIND_ROOT_PATH": "/usr/local", + "TESSELLATOR_ENABLE_TESTS": "ON", + "TESSELLATOR_ENABLE_CGAL": "OFF" + } } - } - }, - { - "name": "msbuild", - "displayName": "MSBuild Configure Settings", - "generator": "Visual Studio 17 2022", - "architecture": { - "strategy": "set", - "value": "x64" - }, - "inherits": "default" - }, - { - "name": "gnu", - "displayName": "GNU g++ compiler", - "generator": "Ninja", - "inherits": "default" - }, - { - "name": "docker", - "displayName": "Docker (system libraries)", - "description": "Uses system-installed libraries, skips vcpkg. Optimized for containerized builds.", - "generator": "Ninja", - "binaryDir": "build/", - "cacheVariables": { - "CMAKE_CXX_COMPILER": "g++", - "CMAKE_PREFIX_PATH": "/usr/local", - "CMAKE_FIND_ROOT_PATH": "/usr/local", - "TESSELLATOR_ENABLE_TESTS": "ON", - "TESSELLATOR_ENABLE_CGAL": "OFF" - } - } - ], - "buildPresets": [ - { - "name": "default", - "configurePreset": "default" - }, - { - "name": "docker", - "configurePreset": "docker" - } - ] + ], + "buildPresets": [ + { + "name": "default", + "configurePreset": "default" + }, + { + "name": "docker", + "configurePreset": "docker" + }, + { + "name": "docker-dbg", + "configurePreset": "docker-dbg" + } + ] } \ No newline at end of file From 6cb14dc20a6d6735b24db665871b4970923d8a71 Mon Sep 17 00:00:00 2001 From: carlosgonzalez-elemwave Date: Fri, 10 Jul 2026 11:51:52 +0000 Subject: [PATCH 2/5] Tessellator | Workflow | #72 | Update vpkg binary cache for GitHub actions --- .github/workflows/build-and-release.yml | 14 ++++++++++++-- .github/workflows/build-and-test.yml | 19 ++++++++++++++----- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index e7719cf..fc1e4d2 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -5,7 +5,8 @@ on: branches: - main -env: +env: + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" WINDOWS_FILENAME: opensemba-tessellator-windows-x64.tar.gz LINUX_FILENAME: opensemba-tessellator-linux.tar.gz @@ -27,7 +28,7 @@ jobs: strategy: matrix: preset: [ - {"os": windows-latest, "name": "msbuild", "filename": "windows-x64"}, + {"os": windows-2022, "name": "msbuild", "filename": "windows-x64"}, {"os": ubuntu-latest, "name": "gnu", "filename": "linux"} ] build-type: ["Release"] @@ -59,8 +60,17 @@ jobs: sudo apt-get update sudo apt-get install -y libvtk9-dev + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + - name: Setup vcpkg uses: lukka/run-vcpkg@v11 + with: + doNotCache: false - name: Windows configure and build if: matrix.preset.name=='msbuild' diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 73d442b..66b4fb0 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -5,17 +5,20 @@ on: branches: - main - dev - + concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true + +env: + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" jobs: builds-and-tests: strategy: matrix: preset: [ - {"os": windows-latest, "name": "msbuild"}, + {"os": windows-2022, "name": "msbuild"}, {"os": ubuntu-latest, "name": "gnu"} ] build-type: ["Debug", "Release"] @@ -45,8 +48,17 @@ jobs: sudo apt-get update sudo apt-get install -y libvtk9-dev + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + - name: Setup vcpkg uses: lukka/run-vcpkg@v11 + with: + doNotCache: false - name: Windows configure and build if: matrix.preset.name=='msbuild' @@ -67,6 +79,3 @@ jobs: - name: Ubuntu Run tests if: matrix.preset.name=='gnu' run: build/bin/tessellator_tests - - - \ No newline at end of file From 558b4960750579b339a14066ff75453bddd20696 Mon Sep 17 00:00:00 2001 From: carlosgonzalez-elemwave Date: Mon, 13 Jul 2026 14:37:28 +0000 Subject: [PATCH 3/5] Tessellator | Build | #72 | Update vcpkg version --- .github/workflows/build-and-test.yml | 5 +++++ vcpkg-configuration.json | 2 +- vcpkg.json | 6 +++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 66b4fb0..0b32117 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -48,6 +48,11 @@ jobs: sudo apt-get update sudo apt-get install -y libvtk9-dev + - name: Install prior dependencies in ubuntu + if: matrix.preset.os=='ubuntu-latest' + run: | + sudo apt install autoconf autoconf-archive automake libtool + - name: Export GitHub Actions cache environment variables uses: actions/github-script@v7 with: diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json index 563e537..3abe562 100644 --- a/vcpkg-configuration.json +++ b/vcpkg-configuration.json @@ -1,7 +1,7 @@ { "default-registry": { "kind": "git", - "baseline": "e2e3f654bc45c28f2696ace32d66f28429bb3b28", + "baseline": "cd61e1e26a038e82d6550a3ebbe0fbbfe7da78e3", "repository": "https://github.com/microsoft/vcpkg" }, "registries": [ diff --git a/vcpkg.json b/vcpkg.json index d4ed077..0d944bc 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,5 +1,6 @@ { "dependencies": [ + "libaec", "boost-graph", "boost-program-options", { "name": "vtk", "default-features": false, "platform": "windows"}, @@ -11,5 +12,8 @@ "description": "Enables CGAL features: Offgrid mesher, manifolding, repairer, etc.", "dependencies": ["cgal", "eigen3"] } - } + }, + "overrides": [ + { "name": "libaec", "version": "1.1.3#1" } + ] } From 2b56447f1d06944b23c632989e7436dc41c1be02 Mon Sep 17 00:00:00 2001 From: carlosgonzalez-elemwave Date: Tue, 14 Jul 2026 09:48:06 +0000 Subject: [PATCH 4/5] Tessellator | Build | Implement vcpkg overlay ports --- .github/workflows/build-and-release.yml | 2 -- .github/workflows/build-and-test.yml | 7 ---- overlayPorts/libaec/README.md | 12 +++++++ overlayPorts/libaec/portfile.cmake | 44 +++++++++++++++++++++++++ overlayPorts/libaec/usage | 7 ++++ overlayPorts/libaec/vcpkg.json | 17 ++++++++++ vcpkg-configuration.json | 5 ++- vcpkg.json | 9 ++--- 8 files changed, 87 insertions(+), 16 deletions(-) create mode 100644 overlayPorts/libaec/README.md create mode 100644 overlayPorts/libaec/portfile.cmake create mode 100644 overlayPorts/libaec/usage create mode 100644 overlayPorts/libaec/vcpkg.json diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index fc1e4d2..7d92d77 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -69,8 +69,6 @@ jobs: - name: Setup vcpkg uses: lukka/run-vcpkg@v11 - with: - doNotCache: false - name: Windows configure and build if: matrix.preset.name=='msbuild' diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 0b32117..64b1f67 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -48,11 +48,6 @@ jobs: sudo apt-get update sudo apt-get install -y libvtk9-dev - - name: Install prior dependencies in ubuntu - if: matrix.preset.os=='ubuntu-latest' - run: | - sudo apt install autoconf autoconf-archive automake libtool - - name: Export GitHub Actions cache environment variables uses: actions/github-script@v7 with: @@ -62,8 +57,6 @@ jobs: - name: Setup vcpkg uses: lukka/run-vcpkg@v11 - with: - doNotCache: false - name: Windows configure and build if: matrix.preset.name=='msbuild' diff --git a/overlayPorts/libaec/README.md b/overlayPorts/libaec/README.md new file mode 100644 index 0000000..ca36a07 --- /dev/null +++ b/overlayPorts/libaec/README.md @@ -0,0 +1,12 @@ +Original port: https://github.com/microsoft/vcpkg/tree/fedfb6ae868887a13f8a0ba3b29603bd7eb9f118/ports/libaec + +A different download url is used to avoid connection errors. + +libaec provides CMake targets: +``` Cmake + find_package(libaec CONFIG REQUIRED) + # libaec API + target_link_libraries(main PRIVATE libaec::aec) + # szip compatible API + target_link_libraries(main PRIVATE libaec::sz) +``` \ No newline at end of file diff --git a/overlayPorts/libaec/portfile.cmake b/overlayPorts/libaec/portfile.cmake new file mode 100644 index 0000000..0d22668 --- /dev/null +++ b/overlayPorts/libaec/portfile.cmake @@ -0,0 +1,44 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO Deutsches-Klimarechenzentrum/libaec + REF v${VERSION} + SHA512 57ffa961efe9329928bd6199881ff9f6d1f4072d08f0e11bafe19b09bbc6dbc5e0003e52d83a8ba72a50518bf39935a92838f9a27d002b33ab095d99ffc5a838 + HEAD_REF master +) + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DBUILD_STATIC_LIBS=${BUILD_STATIC} + -Dlibaec_INSTALL_CMAKEDIR=share/${PORT} +) +vcpkg_cmake_install() +vcpkg_copy_pdbs() +vcpkg_cmake_config_fixup() +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/libaec/libaec-config.cmake" + "if(libaec_USE_STATIC_LIBS)" + "if(\"${BUILD_STATIC}\") # forced by vcpkg" +) + +# Compatibility with user's CMake < 3.18 (vcpkg claims support for >= 3.16): +# Make imported targets global so that libaec-config.cmake can create ALIAS targets. +set(_target_file "libaec_shared-targets") +if(BUILD_STATIC) + set(_target_file "libaec_static-targets") +endif() +file(READ "${CURRENT_PACKAGES_DIR}/share/libaec/${_target_file}.cmake" libaec_targets) +string(REGEX REPLACE " (SHARED|STATIC) IMPORTED" " \\1 IMPORTED \${libaec_maybe_global}" libaec_targets "${libaec_targets}") +file(WRITE "${CURRENT_PACKAGES_DIR}/share/libaec/${_target_file}.cmake" "set(libaec_maybe_global \"\") +if(CMAKE_VERSION VERSION_LESS 3.18) + set(libaec_maybe_global \"GLOBAL\") +endif() +${libaec_targets} +" +) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +file(INSTALL "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt") \ No newline at end of file diff --git a/overlayPorts/libaec/usage b/overlayPorts/libaec/usage new file mode 100644 index 0000000..26ebd09 --- /dev/null +++ b/overlayPorts/libaec/usage @@ -0,0 +1,7 @@ +libaec provides CMake targets: + + find_package(libaec CONFIG REQUIRED) + # libaec API + target_link_libraries(main PRIVATE libaec::aec) + # szip compatible API + target_link_libraries(main PRIVATE libaec::sz) \ No newline at end of file diff --git a/overlayPorts/libaec/vcpkg.json b/overlayPorts/libaec/vcpkg.json new file mode 100644 index 0000000..a4f3d55 --- /dev/null +++ b/overlayPorts/libaec/vcpkg.json @@ -0,0 +1,17 @@ +{ + "name": "libaec", + "version": "1.1.6", + "description": "Adaptive Entropy Coding library", + "homepage": "https://gitlab.dkrz.de/k202009/libaec", + "license": "BSD-2-Clause", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} \ No newline at end of file diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json index 3abe562..e1d933f 100644 --- a/vcpkg-configuration.json +++ b/vcpkg-configuration.json @@ -1,7 +1,7 @@ { "default-registry": { "kind": "git", - "baseline": "cd61e1e26a038e82d6550a3ebbe0fbbfe7da78e3", + "baseline": "e2e3f654bc45c28f2696ace32d66f28429bb3b28", "repository": "https://github.com/microsoft/vcpkg" }, "registries": [ @@ -10,5 +10,8 @@ "location": "https://aka.ms/vcpkg-ce-default", "name": "microsoft" } + ], + "overlay-ports" : [ + "./overlayPorts" ] } diff --git a/vcpkg.json b/vcpkg.json index 0d944bc..81aa4bf 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,19 +1,16 @@ { "dependencies": [ - "libaec", "boost-graph", "boost-program-options", { "name": "vtk", "default-features": false, "platform": "windows"}, "nlohmann-json", - "gtest" + "gtest", + { "name": "libiconv", "version>=": "1.19" } ], "features": { "cgal": { "description": "Enables CGAL features: Offgrid mesher, manifolding, repairer, etc.", "dependencies": ["cgal", "eigen3"] } - }, - "overrides": [ - { "name": "libaec", "version": "1.1.3#1" } - ] + } } From 3e27811ea30395223ed51e3d26b4b3f38a5d7acd Mon Sep 17 00:00:00 2001 From: carlosgonzalez-elemwave Date: Tue, 14 Jul 2026 11:37:35 +0000 Subject: [PATCH 5/5] Tessellator | Build | Upgrade --- .github/workflows/build-and-release.yml | 2 ++ .github/workflows/build-and-test.yml | 2 ++ overlayPorts/libaec/portfile.cmake | 2 +- vcpkg.json | 3 +-- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 7d92d77..7c29fb8 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -69,6 +69,8 @@ jobs: - name: Setup vcpkg uses: lukka/run-vcpkg@v11 + with: + vcpkgGitCommitId: eed289f6e06a5e7a5c9e6a729671b0a56af7dd69 - name: Windows configure and build if: matrix.preset.name=='msbuild' diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 64b1f67..4bf49b8 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -57,6 +57,8 @@ jobs: - name: Setup vcpkg uses: lukka/run-vcpkg@v11 + with: + vcpkgGitCommitId: eed289f6e06a5e7a5c9e6a729671b0a56af7dd69 - name: Windows configure and build if: matrix.preset.name=='msbuild' diff --git a/overlayPorts/libaec/portfile.cmake b/overlayPorts/libaec/portfile.cmake index 0d22668..cdd5c9f 100644 --- a/overlayPorts/libaec/portfile.cmake +++ b/overlayPorts/libaec/portfile.cmake @@ -2,7 +2,7 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Deutsches-Klimarechenzentrum/libaec REF v${VERSION} - SHA512 57ffa961efe9329928bd6199881ff9f6d1f4072d08f0e11bafe19b09bbc6dbc5e0003e52d83a8ba72a50518bf39935a92838f9a27d002b33ab095d99ffc5a838 + SHA512 76df7501d1b7d91a43b525ba828f092f18d83f8ab09a9331e5758f93942a9758ad580baca8f9316b92a98639bde2e23cacbc2f33f52d0dd98ce7efe412cf43cd HEAD_REF master ) diff --git a/vcpkg.json b/vcpkg.json index 81aa4bf..d4ed077 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -4,8 +4,7 @@ "boost-program-options", { "name": "vtk", "default-features": false, "platform": "windows"}, "nlohmann-json", - "gtest", - { "name": "libiconv", "version>=": "1.19" } + "gtest" ], "features": { "cgal": {