From 74af81d2e54e515ab6ea7712553be973c046343a Mon Sep 17 00:00:00 2001 From: agw Date: Wed, 2 Sep 2026 21:30:00 +0200 Subject: [PATCH] Compile R packages with less parallelism: OpenMx was OOM-killed The retry loop converged 6 -> 10 -> 10 bundles and stalled. The cause was not a race after all: g++: fatal error: Killed signal terminated program cc1plus OpenMx instantiates enough Eigen templates that a single cc1plus needs several GB, and at -j5 on an 8GB runner the kernel killed it every time - which is why both retries stopped at exactly 10/22 rather than creeping forward. That in turn blocked jaspFactor, jaspSem, mxsem and semPlot. R packages now compile at -j2 (R_JOBS) independently of the -j used for the C++ build, and the runner VM was given 16GB. --- build/build-jasp.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/build/build-jasp.sh b/build/build-jasp.sh index 91ab7aa..7b41022 100755 --- a/build/build-jasp.sh +++ b/build/build-jasp.sh @@ -260,6 +260,15 @@ PY # Retrying is the cheap fix: renv skips what is already installed, so each pass # starts from more complete state and converges. Passes are capped so a genuine # failure cannot loop forever. +# OpenMx instantiates enough Eigen templates that a single cc1plus can take +# several GB. At the top-level -j the compiler gets OOM-killed +# ("g++: fatal error: Killed signal terminated program cc1plus"), which is not +# a race — it stalls at the same module count on every retry. Compile R packages +# with less parallelism than the C++ build uses. +R_JOBS="${R_JOBS:-2}" +export MAKEFLAGS="-j${R_JOBS}" +log "compiling R packages with -j${R_JOBS} (OpenMx needs the headroom)" + EXPECTED_MODULES=22 for attempt in 1 2 3; do log "module build pass ${attempt}/3"