google / google/or-tools

cmake: update build instructions to recommend parallel build (faster)

Open
#4,215 1 comment 0 reactions 1 assignee Claimed by @Mizux View on GitHub
Doc: Optimization Site Feature Request
Dominant language
C++
Stars
14.1k
Forks
2.5k
Avg merge
8h 39m
Merged PRs (30d)
72

Description

applies to: C++ / CP-SAT, Routing, Linear Solver. Tested on ARM 64 platform (Pi 5)

on some platforms the default cmake build is single threaded and does not expand to fill available cores. current versions of cmake accept a flag "--parallel " which passes platform-specific flags down to the compile steps.

multicore compilation can finish substantially faster. for example, a scratch build on the Pi 5 (ARM 64) building with "cmake --build build" runs on a single core and takes 134 minutes. Running "cmake --build build --parallel 4" runs on all four cores and takes 68 minutes.

recommended solution is to update the cmake build documentation file to inform about this option.

there is also a way to make multicore default, but that assumes all users will prefer it.

reference: https://cmake.org/cmake/help/latest/manual/cmake.1.html#cmdoption-cmake-build-j

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.