Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jjacobsohn opened this issue May 2, 2024 · 1 comment
Open
Assignees
Labels
Doc: Optimization Site Issue related to https://developers.google.com/optimization/ or Documentation in general Feature Request Missing Feature/Wrapper
Milestone

Comments

@jjacobsohn
Copy link
Contributor

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

@Mizux
Copy link
Collaborator

Mizux commented May 6, 2024

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

here I'm using -j as well as env var

CMAKE_C_COMPILER_LAUNCHER=ccache
CMAKE_CXX_COMPILER_LAUNCHER=ccache

@Mizux Mizux added the Feature Request Missing Feature/Wrapper label May 6, 2024
@Mizux Mizux self-assigned this May 6, 2024
@Mizux Mizux added the Doc: Optimization Site Issue related to https://developers.google.com/optimization/ or Documentation in general label May 6, 2024
@Mizux Mizux added this to the v10.0 milestone May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Doc: Optimization Site Issue related to https://developers.google.com/optimization/ or Documentation in general Feature Request Missing Feature/Wrapper
Projects
None yet
Development

No branches or pull requests

2 participants