makefile - 使 [1] : *** read jobs pipe: Resource temporarily unavailable. 停止

标签 makefile cmake build module

我遇到这个问题有一段时间了:

make [1]: *** 读取作业管道:资源暂时不可用。停止。

我有一个顶级 makefile,它根据规则“调用”额外的 cmake 和 make。

target A 是一个相对较小的代码(C/C++)。 目标 B 更大。

问题主要发生在构建 target B 期间,但并非总是如此。我使用 make 3.82。

我已经尝试使用 make 4.3,它总是出现。

这是我的构建系统的骨架:

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 等于构建服务器上的核心数。--jobs 是它的一半。)

我已经验证了 MAKEFLAGS 是否正确通过(我已经在构建期间检查了 gcc/g++ 进程的数量)并且我没有有这个警告:

警告:-jN 在 submake 中强制:禁用 jobserver 模式。

主机操作系统:RedHat 7.6

cmake: 3.16.4

我该如何解决这个问题?

最佳答案

我在嵌套 make 上遇到了完全相同的错误。问题最终是硬件。我添加了 CPU 温度调节后台作业,以将 CPU 内核保持在 85C 以下,错误消失了。

我的系统是带有非常小水冷器的 core-i9 10850K。在编译的繁重部分,核心温度从标准的 5GHz 降至约 3.8GHz。没有 throttle ,核心温度实际上达到了 100C。

关于makefile - 使 [1] : *** read jobs pipe: Resource temporarily unavailable. 停止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64367956/

相关文章:

c++11 - CMake: ‘sqrtf’ 不是 ‘std’ 的成员

c++ - eclipse CDT :copying library paths from debug to release mode

android - Android Build在 ':app:dexDebug'失败,出现异常(库和应用程序项目)

Emacs:如何编译(运行make)而不按回车进行编译命令查询?

c++ - 编译源代码时出现 cURLcpp 错误

gcc - CMake 相对包含 C++ 中的路径

c - 使用 CMake 从二进制文件中提取库版本

javascript - 导出由 webpack 构建的模块

makefile - GNU 制作 : How to export the SHELL variable to sub-makes?

c++ - Makefile:对 'std::...' 的 undefined reference