[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;
- 31/64: Remove redundant stuff, (continued)
- 31/64: Remove redundant stuff, Ludovic Courtès, 2015/01/05
- 24/64: Show position info in Boolean operations, Ludovic Courtès, 2015/01/05
- 38/64: Fix test evaluation, Ludovic Courtès, 2015/01/05
- 34/64: Add docbook icons to the distribution, Ludovic Courtès, 2015/01/05
- 37/64: Bump date, Ludovic Courtès, 2015/01/05
- 39/64: nix-env: Minor change to '--delete-generations Nd' semantics, Ludovic Courtès, 2015/01/05
- 33/64: If a .drv cannot be parsed, show its path, Ludovic Courtès, 2015/01/05
- 40/64: trunk -> master, Ludovic Courtès, 2015/01/05
- 17/64: Pass position information to primop calls, Ludovic Courtès, 2015/01/05
- 32/64: Simplify quick start section, Ludovic Courtès, 2015/01/05
- 43/64: Set build-max-jobs to the number of available cores by default,
Ludovic Courtès <=
- 41/64: doc fix: swap 'import' and 'export', Ludovic Courtès, 2015/01/05
- 28/64: Ensure that systemd units to into lib, not lib64, Ludovic Courtès, 2015/01/05
- 36/64: Bump version to 1.8, Ludovic Courtès, 2015/01/05
- 44/64: Install an Upstart service, Ludovic Courtès, 2015/01/05
- 45/64: Set up directories and permissions for multi-user install automatically, Ludovic Courtès, 2015/01/05
- 46/64: Simplify multi-user installation instructions, Ludovic Courtès, 2015/01/05
- 49/64: Add ubuntu 14.04, Ludovic Courtès, 2015/01/05
- 48/64: Don't install Upstart job on Fedora, Ludovic Courtès, 2015/01/05
- 51/64: Really fix the RPM builds, Ludovic Courtès, 2015/01/05
- 50/64: Fix RPM build, Ludovic Courtès, 2015/01/05