[all-commits] [llvm/llvm-project] 7b9fa2: [cmake] Option to create Ninja job pools depending...

jusito via All-commits all-commits at lists.llvm.org
Fri Oct 20 10:08:05 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7b9fa2146e977bfc054b17fade851d574fc46afa
      https://github.com/llvm/llvm-project/commit/7b9fa2146e977bfc054b17fade851d574fc46afa
  Author: jusito <17811819+jusito at users.noreply.github.com>
  Date:   2023-10-20 (Fri, 20 Oct 2023)

  Changed paths:
    M llvm/cmake/modules/HandleLLVMOptions.cmake
    M llvm/docs/CMake.rst

  Log Message:
  -----------
  [cmake] Option to create Ninja job pools depending on available resources (#65274)

This PR adds options to let CMake calculate the ninja job pools
depending on free memory and available cores.
You can provide memory requirements for each compile and link job which
is checked against CMake AVAILABLE_PHYSICAL_MEMORY and
NUMBER_OF_LOGICAL_CORES. [This information are available since CMake
3.0](https://cmake.org/cmake/help/v3.0/command/cmake_host_system_information.html).

This is very helpful in CI environments with multiple jobs per
environment or a VM with multiple users.
Its different to LLVM_PARALLEL_LINK_JOBS / LLVM_PARALLEL_COMPILE_JOBS
(or ninja -j 1) because it tries to use the resources more efficient
without being terminated. Only downside currently is that compile and
link jobs can run at the same time so there is an offset for link job
memory suggested which is added to the documentation.

The definitions aren't added as cache because if I understand it
correctly this would break it because values could be outdated.




More information about the All-commits mailing list