Skip to content

Commit 3088b98

Browse files
committed
docker: fix OpenMPI parallel build
Change make -j ${nproc} to make -j $(nproc) in Dockerfile.cpu. ${nproc} expands to empty string (variable doesn't exist), causing single-threaded builds. $(nproc) executes the nproc command to use all available CPU cores. This reduces OpenMPI build time from ~15-20 mins to ~5-8 mins on 4-core ARM64 runners.
1 parent 6a70760 commit 3088b98

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

docker/Dockerfile.cpu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ RUN cd /tmp && mkdir openmpi && \
4545
../configure --prefix=/opt/openmpi/ \
4646
--disable-mpi-fortran \
4747
--enable-mca-no-build=btl-uct --enable-mpi1-compatibility && \
48-
make -j ${nproc} && \
48+
make -j $(nproc) && \
4949
make install && \
5050
cd /tmp && rm -rf /tmp/openmpi
5151

0 commit comments

Comments
 (0)