From c262140556be7c53205cb17fbbd89f42d0b4d2e6 Mon Sep 17 00:00:00 2001 From: Henrik Rusche Date: Fri, 5 Jul 2013 17:15:35 +0200 Subject: [PATCH] Determine NCOMPPROCS automatically --- etc/bashrc | 27 ++++++++++++++------------- etc/cshrc | 2 +- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/etc/bashrc b/etc/bashrc index b2f5a9602..e829b6e14 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -128,7 +128,7 @@ export WM_COMPILER_LIB_ARCH= # Compilation options (architecture, precision, optimised, debug or profiling) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -: ${WM_NCOMPPROCS:=2}; export WM_NCOMPPROCS +: ${WM_NCOMPPROCS:=`grep -c processor /proc/cpuinfo`}; export WM_NCOMPPROCS # WM_ARCH_OPTION = 32 | 64 : ${WM_ARCH_OPTION:=64}; export WM_ARCH_OPTION @@ -227,6 +227,7 @@ Darwin) export WM_ARCH=darwinUnknown ;; esac + case $WM_ARCH_OPTION in 32) export WM_CFLAGS='-m32 -fPIC' @@ -254,21 +255,21 @@ Darwin) # Use Mac-Ports-Compiler instead of Apple-gcc-4.2 case $WM_COMPILER in Gcc43) - export WM_CC='gcc-mp-4.3' - export WM_CXX='g++-mp-4.3' - ;; + export WM_CC='gcc-mp-4.3' + export WM_CXX='g++-mp-4.3' + ;; Gcc44) - export WM_CC='gcc-mp-4.4' - export WM_CXX='g++-mp-4.4' - ;; + export WM_CC='gcc-mp-4.4' + export WM_CXX='g++-mp-4.4' + ;; Gcc45) - export WM_CC='gcc-mp-4.5' - export WM_CXX='g++-mp-4.5' - ;; + export WM_CC='gcc-mp-4.5' + export WM_CXX='g++-mp-4.5' + ;; *) - export WM_COMPILER= - ;; - esac + export WM_COMPILER= + ;; + esac fi ;; diff --git a/etc/cshrc b/etc/cshrc index cd06c92a5..f408acb5b 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -119,7 +119,7 @@ setenv WM_COMPILER_LIB_ARCH # Compilation options (architecture, precision, optimised, debug or profiling) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -setenv WM_NCOMPPROCS 4 +if ( ! $?WM_NCOMPPROCS ) setenv WM_NCOMPPROCS=`grep -c processor /proc/cpuinfo` # WM_ARCH_OPTION = 32 | 64 if ( ! $?WM_ARCH_OPTION ) setenv WM_ARCH_OPTION 64