On Thu, Jun 18, 2026 at 3:31 PM Ludovic Courtès <[email protected]> wrote:
>
> Hi!
>
> Gabriel Wicki <[email protected]> skribis:
>
> > Brooding over packaging the EDA tool naja and its fork of some `slang`
> > package I noticed that the build was *very* slow.  Checking `top` I
> > figured object files are compiled serially.  A quick search produced¹
> > and wow, build time is N-core times faster now.  Which raises the
> > question: is it possible that cmake-build-system does not set
> > CMAKE_BUILD_PARALLEL_LEVEL by default?
>
> The ‘build’ phase in ‘guix/build/cmake-build-system.scm’ invokes ‘make’
> with ‘-jN’ by default, so it’s building things in parallel (respecting
> the ‘--cores’ option passed to ‘guix-daemon’ or ‘guix’).

The cmake-build-system now uses cmake to build (ninja is faster than
make and can be enabled with #:generator "Ninja"):

(define* (build #:key (make-flags '()) (parallel-build? #t)
                #:allow-other-keys)
  (apply invoke "cmake"
         `("--build"
           "."
           ,@(if parallel-build?
                 `("-j" ,(number->string (parallel-job-count)))
                 ;; When unset CMake defers to the build system.
                 '("-j" "1"))
           ;; Pass the following options to the native tool.
           "--"
           ,@(if parallel-build?
                 ;; Set load average limit for Make and Ninja.
                 `("-l" ,(number->string (total-processor-count)))
                 '())
           ,@make-flags)))

Reply via email to