guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

43/64: Set build-max-jobs to the number of available cores by default


From: Ludovic Courtès
Subject: 43/64: Set build-max-jobs to the number of available cores by default
Date: Mon, 05 Jan 2015 16:39:06 +0000

civodul pushed a commit to branch nix
in repository guix.

commit de4cdd0d47adc70a4db12397a42c18ee50b4e662
Author: Eelco Dolstra <address@hidden>
Date:   Fri May 2 12:51:43 2014 +0200

    Set build-max-jobs to the number of available cores by default
    
    More zero configuration.
---
 src/libstore/globals.cc |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc
index c359367..739199d 100644
--- a/src/libstore/globals.cc
+++ b/src/libstore/globals.cc
@@ -5,6 +5,7 @@
 
 #include <map>
 #include <algorithm>
+#include <unistd.h>
 
 
 namespace nix {
@@ -29,6 +30,10 @@ Settings::Settings()
     buildVerbosity = lvlError;
     maxBuildJobs = 1;
     buildCores = 1;
+#ifdef _SC_NPROCESSORS_ONLN
+    long res = sysconf(_SC_NPROCESSORS_ONLN);
+    if (res > 0) buildCores = res;
+#endif
     readOnlyMode = false;
     thisSystem = SYSTEM;
     maxSilentTime = 0;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]