I am facing this problem for a while:
make [1]: *** read jobs pipe: Resource temporarily unavailable. Stop.
I have a top-level makefile that "calls" additional cmake and make based on the rules.
target A is a relatively small code (C/C++). target B is much bigger.
The issue happens mainly during the building target B but not always. I use make 3.82.
I have tried with make 4.3 and it occurs always.
Here is a skeleton of my build system:
MAKEFLAGS = --jobs=10 --max-load=20
<target A>:
+. /usr/share/Modules/init/bash &&
module load <target> &&
cmake --build <project buildsystem> --target <target A>
<target B>: <target A>
+. /usr/share/Modules/init/bash &&
module load <target> &&
make -C <path> <target B> &&
cmake --build <project buildsystem> --target <target B>
/usr/share/Modules/init/bash
The Modules package and the module command are initialized when a shell-specific initialization script is sourced into the shell. The script creates the module command as either an alias or function and creates Modules environment variables.
https://modules.readthedocs.io/en/latest/module.html
(--max-load is equal the number of cores on the build sever. --jobs is half of it.)
I have verified the MAKEFLAGS passes correctly (I have checked the number of gcc/g++ processes during build) and I don't have this warning:
warning: -jN forced in submake: disabling jobserver mode.
Host OS: RedHat 7.6
cmake: 3.16.4
How can I solve this issue?