make [1]: *** read jobs pipe: Resource temporarily unavailable. Stop

Viewed 519

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?

1 Answers

I had this exact same error on nested makes. The issue ended up being hardware. I added a CPU temperature throttle background job to keep the CPU cores below 85C and the errors went away.

My system is a core-i9 10850K with a very small water cooler. During the heavy parts of the compile, the core temps were throttled from the stock 5GHz down to about 3.8GHz. Without the throttle, core temps actually hit 100C.

Related