bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #64543] Fix "make -j" for Docker container


From: INVALID.NOREPLY
Subject: [bug #64543] Fix "make -j" for Docker container
Date: Thu, 17 Aug 2023 08:33:36 -0400 (EDT)

Follow-up Comment #1, bug #64543 (project make):

[comment #0 original submission:]
> The problem is in fact, that the Make probably uses:
> ```
> cat /proc/cpuinfo
> ```
> 
> mechanism to detect the number of CPUs available to Make.
> 
> 
> However this way will not always work correctly inside of Docker container
which was started using limited set of cores, for example:
> ```
> docker run -it --cpuset-cpus=0,1 ubuntu
> ```
> 
> Following way of detection for available CPUs should be used instead:
> ```
> cat /sys/fs/cgroup/cpuset/cpuset.cpus
> ```

There is no issue in "make" utility.

The problem is in how it was used inside of Docker container by me.

I've used:
```
NUM_CPUS=$(grep -c ^processor /proc/cpuinfo)
make -j$(NUM_CPUS)
```

inside of Docker container, but this was my mistake.

There is no problem when using simply:
```
make -j
```

Dear admins, feel free to close this bug report.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?64543>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]