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.shto 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 CASESandGENERATED HELP VERSIONSblocks ininstall-openmp.shplus theGENERATED README TABLEblock inREADME.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.shto write changes, or./sync-openmp.sh --checkfor a non-mutating drift check that exits0when up to date and1(printingDRIFT: run sync-openmp.sh) otherwise.
- It parses one record per primary clang tier (clang version, OpenMP version, darwin target, SHA1, Xcode version) and regenerates the
- Added a weekly GitHub Actions workflow (
Check OpenMP upstream, cron17 6 * * 1, Mondays 06:17 UTC) that runssync-openmp.sh, runs the test harness, and opens a PR titledchore: sync OpenMP versions from upstreamonly when something changed. - Bumped the Apple clang
1700.xtier (now shown as the Xcode 16.3-26.3 range) from OpenMP 19.1.0 to 19.1.5 (darwin20, SHA15b44175bcbaa334b0c57391482e068ea185c95a2). Other tiers (e.g.1600.x->17.0.6,1500.x->16.0.4) are unchanged. - Added
test-openmp.shand a matchingOpenMP correctnessGitHub Actions workflow that builds against the installedmac.r-project.orgruntime and verifies both real multithreading and a deterministic parallel-reduction result; it skips (exit0) on non-macOS.- The C test compiles with
clang -Xclang -fopenmp -I/usr/local/include -L/usr/local/lib -lomp, asserts_OPENMPis defined, that a#pragma omp parallel for reduction(+:sum)overi=1..1000000equals500000500000, that observed threads exceed one, and thatOMP_NUM_THREADS=4yields exactly four threads. - The R test builds a minimal
ompcheckpackage withPKG_CPPFLAGS='-Xclang -fopenmp -I/usr/local/include'andPKG_LIBS='-L/usr/local/lib -lomp', thenstopifnot()assertsompcheck::omp_sum(1e6)equals1e6*(1e6+1)/2with more than one observed thread. - The workflow runs on a
macos-14andmacos-15matrix (fail-fast: false) via./install-openmp.sh --yes,r-lib/actions/setup-r@v2, then./test-openmp.sh. Use./test-openmp.sh --c-onlyto skip the R package check.
- The C test compiles with
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