|
scimesh 0.3.4
Headless CPU-only 3D software renderer for scientific mesh visualization
|
To build and check the R package, you will need these:
You must also install all R packages which are suggested by scimesh, see the package DESCRIPTION.
Also make sure you have the basics, in R:
And finally, install tinytex for vignette building:
The C++ tests use Catch2 (amalgamated) and are in cpp_tests/:
Coverage of the C++ core is measured with clang's source-based coverage and reported with llvm-cov. The helper script builds the test suite with instrumentation, runs it and writes a report:
Requirements (Linux): clang, plus llvm-profdata and llvm-cov of the same major version, and cmake. On Debian/Ubuntu: sudo apt install clang llvm.
The report is written to coverage/ (gitignored): coverage/html/index.html for browsing, coverage/lcov.info if you want coverage gutters in your editor (e.g. the VS Code "Coverage Gutters" extension).
Notes:
src/third_party/, whose header-only libraries are inlined into the core) are excluded from the report.obj_io.cpp and transforms.cpp, which are exercised from R instead). A file shown at 0 % is linked but never executed (e.g. ply_io.cpp).Coverage (C++) CI workflow stores the HTML report as an artifact but never fails on low coverage.covr::package_coverage() in R for that. The C++ code inside the R package is a separate build (see src/Makevars) and is not covered by this script.A missing standard header is invisible to almost every build we have: libstdc++ (GCC, i.e. R on Linux and Windows) and libc++ 15+ (Xcode 15+, i.e. the macos-latest CI runner) both pull headers such as <array> in transitively via <functional>. The CRAN macOS builders use the clang 14 / libc++ 14 toolchain, which does not - so such code fails there with a confusing ‘implicit instantiation of undefined template 'std::array<...>’` (this is what broke the CRAN installation of 0.3.4). Compile every translation unit with libc++ 14 to check:
Requirements (Linux): clang plus the libc++ headers of version <= 14. On Debian/Ubuntu: sudo apt install clang-14 libc++-14-dev. The check is -fsyntax-only, so nothing is linked and R is only needed for the two Rcpp binding translation units (they are skipped when R or Rcpp is missing). The script refuses to run with libc++ >= 15, because that standard library cannot reproduce the strict behaviour. The C++ stdlib strictness CI workflow runs this on every push/PR, on the pinned ubuntu-24.04 image (newer Ubuntu releases no longer ship libc++ 14).
The example programs are part of what we ship, so they are built and run:
Both can take a name to run a single example. The Examples CI workflow does this on every push/PR, because the C++ examples are not compiled by any test target - breakage in them would otherwise go unnoticed.
Or via R CMD check:
The C++ API documentation is generated with Doxygen. The configuration is in Doxyfile at the repository root.
Prerequisites: Install Doxygen (and optionally Graphviz for diagrams):
Generate locally:
This produces HTML output in docs/cpp_api/html/. Open docs/cpp_api/html/index.html in a browser to view the docs.
The published API documentation is available at: https://dfsp-spirit.github.io/scimesh/
It is built and deployed automatically via GitHub Actions (.github/workflows/docs.yml) on every push to main.
DESCRIPTION (R package version)CMakeLists.txt — the project(scimesh VERSION ...) line (C++ version, single source of truth)version.h is auto-generated by CMake from this value — no need to edit it manually.Doxyfile — the PROJECT_NUMBER field (version shown in published C++ API docs)devtools::document() to re-generate docs.PROJECT_NUMBER: https://dfsp-spirit.github.io/scimesh/ will show a stale or empty version otherwise.run all tests and make sure they are green:
C++ unit tests:
R unit tests:
R CMD build . to build new package versionR CMD check scimesh_0.1.0.tar.gz, or whatever version you are testing. This must pass without errors/warnings/notes.R CMD check scimesh_0.1.0.tar.gz --as-cran and see what you can do to get as little notes and warnings as possible. Stuff in downstream code is not our problem though, but you may have to discuss that with CRAN team on submit, hf.