docs + ci: update README, add ci-cpp Docker image, use container in workflow

README:
- Remove stale Boost mention (unused dep, removed yesterday)
- Document three build modes (tests-only / WITH_VIEWER / WITH_CGAL)
  with a comparison table and per-mode cmake commands
- Add project structure overview
- Fix C++20 → C++17 (actual standard used)
- Fix clone URL and getting-started commands
- Add CI section with Dockerfile build instructions

CI:
- Add .gitea/docker/Dockerfile.ci-cpp — ubuntu:22.04 with cmake,
  g++, git, and Node.js 20 pre-installed (Node.js needed for
  actions/checkout@v4 inside containers)
- Update cpp-tests.yml to use ci-cpp container instead of installing
  build tools on every run; add JUnit XML output and summary step

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Tarik Moussa
2026-05-09 21:49:44 +02:00
parent cd7b7a8fd8
commit e59f79a8e2
3 changed files with 121 additions and 42 deletions

View File

@@ -0,0 +1,16 @@
FROM ubuntu:22.04
# Node.js 20 from NodeSource (Ubuntu Jammy ships v12 which is too old
# for actions/checkout@v4 — static class blocks require Node.js >= 16).
RUN apt-get update -qq && \
apt-get install -y --no-install-recommends \
curl ca-certificates && \
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y --no-install-recommends \
nodejs \
cmake \
g++ \
git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /workspace

View File

@@ -11,27 +11,32 @@ on:
jobs:
test:
runs-on: eulernest
container:
image: git.eulernest.eu/conformallab/ci-cpp:latest
steps:
- uses: actions/checkout@v4
- name: Install build tools
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends \
cmake \
g++ \
git \
ca-certificates
- name: Configure (Release, tests enabled)
run: |
cmake -S code -B build \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING=ON
- name: Configure (tests-only mode)
run: cmake -S code -B build -DCMAKE_BUILD_TYPE=Release
- name: Build test binary
run: cmake --build build --target conformallab_tests -j$(nproc)
- name: Run tests
run: ctest --test-dir build -R conformallab_tests --output-on-failure
run: >
ctest --test-dir build
--output-on-failure
--output-junit test-results.xml
- name: Show test summary
if: always()
run: |
if [ -f test-results.xml ]; then
total=$(grep -o 'tests="[0-9]*"' test-results.xml | grep -o '[0-9]*' | head -1)
failed=$(grep -o 'failures="[0-9]*"' test-results.xml | grep -o '[0-9]*' | head -1)
skipped=$(grep -o 'skipped="[0-9]*"' test-results.xml | grep -o '[0-9]*' | head -1)
passed=$(( ${total:-0} - ${failed:-0} - ${skipped:-0} ))
echo ""
echo "TOTAL: ${total:-0} | PASSED: $passed | FAILED: ${failed:-0} | SKIPPED: ${skipped:-0}"
fi

112
README.md
View File

@@ -1,46 +1,104 @@
# conformallab++
conformallab++ is a modern C++ reimplementation of the ConformalLab software by Stefan Sechelmann for experiments in discrete conformal geometry and related mesh transformations.
conformallab++ is a modern C++ reimplementation of the [ConformalLab](https://github.com/sechel/conformallab) software by Stefan Sechelmann for experiments in discrete conformal geometry and related mesh transformations.
It builds on wellestablished opensource libraries such as **CGAL**, **Eigen**, and **Boost** for robust geometric data structures and efficient numerical computations, and uses singleheader libraries **CLI11** and **json.hpp** for a lightweight commandline interface and configuration handling. In addition, **libigl**s OpenGL viewer stack based on **GLFW** provides portable windowing and input handling, while the separate **libiglglad** component supplies a generated OpenGL function loader for the required core profile, making interactive visualization easy to integrate.
> **Status:** early prototype stage. API, file formats, and CLI are subject to change.
## Features
## Status
- Discrete conformal geometry utilities (Clausen function, hyper-ideal tetrahedra, surface curves)
- Mesh I/O and conversion using CGAL — optional, only needed for the CLI app
- Linear algebra routines with Eigen
- Interactive mesh viewer using libigl / GLFW — optional
- Lightweight CLI with CLI11 and JSON configuration
This project is in an early prototype stage.
API, file formats and commandline interface are all subject to change.
## Build modes
## Features (placeholder)
The project uses three clearly separated CMake modes so you only pull in what you need.
- Discrete conformal geometry utilities (placeholder)
- Mesh and graph data structures built on CGAL (placeholder)
- Linear algebra and optimization routines using Eigen (placeholder)
- Highlevel operations and helpers based on Boost (placeholder)
- Commandline tools with CLI11 and JSON configuration (placeholder)
| Mode | CMake flag | What gets built |
|------|-----------|-----------------|
| **Tests only** (default, used in CI) | *(none)* | `conformallab_tests` · deps: Eigen + GTest |
| **Viewer** | `-DWITH_VIEWER=ON` | `viewer` library · deps: libigl / GLFW / GLAD + Eigen |
| **Full app** | `-DWITH_CGAL=ON` | `conformallab_core` CLI + viewer · deps: CGAL + libigl / GLFW / GLAD + Eigen |
`-DWITH_CGAL=ON` automatically enables `WITH_VIEWER` because the CLI app uses the viewer library for mesh visualisation.
External dependencies ship as tarballs in `code/deps/tarballs/` and are extracted lazily at CMake configure time — no internet access needed after cloning (GTest is the only exception: fetched from GitHub via FetchContent).
## Prerequisites
| Tool | Minimum version |
|------|----------------|
| C++ compiler (GCC or Clang) | C++17 |
| CMake | 3.20 |
No system-level libraries are required for the default tests-only build. CGAL and libigl are header-only and bundled in the repo.
## Getting started
### Prerequisites
- A C++20 compiler (e.g. `g++` or `clang++`)
- CMake version 3.20
### Clone the repository
```bash
git clone https://codeberg.org/user2595/ConformalLabpp
cd conformallabpp/code
git clone https://codeberg.org/TMoussa/ConformalLabpp
cd ConformalLabpp
```
### Configure and build
### Tests only (CI default)
```bash
cmake -S . -B build && cmake --build build
cmake -S code -B build
cmake --build build --target conformallab_tests -j$(nproc)
ctest --test-dir build --output-on-failure
```
### Run the binare
### Full CLI app (CGAL + viewer)
```bash
./bin/conformallab_core --input ./data/off/simple_cupe.off
cmake -S code -B build -DWITH_CGAL=ON
cmake --build build -j$(nproc)
./code/bin/conformallab_core --input data/off/example.off --show
```
### License
conformallabpp is released under the MIT License (see LICENSE).
### Viewer only (no CGAL)
```bash
cmake -S code -B build -DWITH_VIEWER=ON
cmake --build build --target viewer -j$(nproc)
```
## Project structure
```
code/
├── include/ # Public headers (Clausen, hyper-ideal, mesh utils, …)
├── src/
│ ├── apps/v0/ # conformallab_core CLI app (requires WITH_CGAL)
│ └── viewer/ # simple_viewer (requires WITH_VIEWER)
├── tests/ # GTest unit tests (always built)
└── deps/
├── tarballs/ # Bundled dependency archives
├── eigen-3.4.0/ # Header-only linear algebra (always extracted)
├── CGAL-6.1.1/ # Header-only geometry (extracted with WITH_CGAL)
├── libigl-2.6.0/ # Header-only viewer toolkit (extracted with WITH_VIEWER)
├── glfw-3.4/ # Windowing (extracted with WITH_VIEWER)
├── libigl-glad/ # OpenGL loader (extracted with WITH_VIEWER)
└── single_includes/ # CLI11, json.hpp
```
## CI
Tests run automatically on push to `main`, `dev`, and `claude/**` branches via a self-hosted Gitea Actions runner (`eulernest`, ARM64 Raspberry Pi). The pipeline uses a minimal Docker image (`git.eulernest.eu/conformallab/ci-cpp:latest`) with cmake, g++, git, and Node.js 20 pre-installed.
The Dockerfile for the CI image lives in `.gitea/docker/Dockerfile.ci-cpp`. Build and push it once whenever the image needs updating:
```bash
docker buildx build \
--platform linux/arm64 \
-f .gitea/docker/Dockerfile.ci-cpp \
-t git.eulernest.eu/conformallab/ci-cpp:latest \
--push \
.gitea/docker/
```
## License
conformallab++ is released under the MIT License (see [LICENSE](LICENSE)).