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"