OpenMP for macOS - Upstream Sync, OpenMP 19.1.5, and Correctness CI

Automated upstream version sync, an OpenMP 19.1.5 runtime bump, and a macOS CI test that verifies real multithreaded OpenMP correctness in C and R.
software-releases
r
Author

James Balamuta

Published

June 23, 2026

The OpenMP Setup, Uninstall, and Check Tools collection sets up, diagnoses, and removes OpenMP on macOS using Apple’s own Xcode Clang toolchain through three dependency-free shell scripts. This update adds an automated upstream-sync mechanism, bumps the bundled OpenMP runtime to 19.1.5, and introduces a macOS correctness CI test that compiles and runs real multithreaded OpenMP code.

For details on the changes, please see the news entry for the toolkit update below.

openmp shell tools news entry

Features

  • Added sync-openmp.sh to keep the pinned version data in sync with the upstream R CRAN macOS tools page (https://mac.r-project.org/openmp/).
    • It parses one record per primary clang tier (clang version, OpenMP version, darwin target, SHA1, Xcode version) and regenerates the GENERATED VERSION CASES and GENERATED HELP VERSIONS blocks in install-openmp.sh plus the GENERATED README TABLE block in README.md.
    • SHA1 resolution is compute-on-change: an unchanged pin reuses its existing SHA1, otherwise the tarball is downloaded and the SHA1 is recomputed.
    • Run ./sync-openmp.sh to write changes, or ./sync-openmp.sh --check for a non-mutating drift check that exits 0 when up to date and 1 (printing DRIFT: run sync-openmp.sh) otherwise.
  • Added a weekly GitHub Actions workflow (Check OpenMP upstream, cron 17 6 * * 1, Mondays 06:17 UTC) that runs sync-openmp.sh, runs the test harness, and opens a PR titled chore: sync OpenMP versions from upstream only when something changed.
  • Bumped the Apple clang 1700.x tier (now shown as the Xcode 16.3-26.3 range) from OpenMP 19.1.0 to 19.1.5 (darwin20, SHA1 5b44175bcbaa334b0c57391482e068ea185c95a2). Other tiers (e.g. 1600.x -> 17.0.6, 1500.x -> 16.0.4) are unchanged.
  • Added test-openmp.sh and a matching OpenMP correctness GitHub Actions workflow that builds against the installed mac.r-project.org runtime and verifies both real multithreading and a deterministic parallel-reduction result; it skips (exit 0) on non-macOS.
    • The C test compiles with clang -Xclang -fopenmp -I/usr/local/include -L/usr/local/lib -lomp, asserts _OPENMP is defined, that a #pragma omp parallel for reduction(+:sum) over i=1..1000000 equals 500000500000, that observed threads exceed one, and that OMP_NUM_THREADS=4 yields exactly four threads.
    • The R test builds a minimal ompcheck package with PKG_CPPFLAGS='-Xclang -fopenmp -I/usr/local/include' and PKG_LIBS='-L/usr/local/lib -lomp', then stopifnot() asserts ompcheck::omp_sum(1e6) equals 1e6*(1e6+1)/2 with more than one observed thread.
    • The workflow runs on a macos-14 and macos-15 matrix (fail-fast: false) via ./install-openmp.sh --yes, r-lib/actions/setup-r@v2, then ./test-openmp.sh. Use ./test-openmp.sh --c-only to skip the R package check.

Internal

  • Fixed the README “Supported Versions” table: the generated-block comment marker previously sat between the separator row and the first data row, which terminated the Markdown table. The header and delimiter rows are now emitted inside the markers so the table renders correctly.

Install and verify as before:

curl -O https://raw.githubusercontent.com/coatless-shell/openmp/main/install-openmp.sh
chmod +x install-openmp.sh
./install-openmp.sh

GitHub repository