[openfoam] 01/03: Build parallelly.
Anton Gladky
gladk at moszumanska.debian.org
Wed Sep 28 19:27:07 UTC 2016
This is an automated email from the git hooks/post-receive script.
gladk pushed a commit to branch master
in repository openfoam.
commit 970cde1f216c4c6349dbe2d2dfbbb80719acff3f
Author: Anton Gladky <gladk at debian.org>
Date: Wed Sep 28 20:49:20 2016 +0200
Build parallelly.
---
debian/patches/40_build-parallel.patch | 55 ++++++++++++++++++++++++++++++++++
debian/patches/series | 2 ++
debian/rules | 26 +++++-----------
3 files changed, 65 insertions(+), 18 deletions(-)
diff --git a/debian/patches/40_build-parallel.patch b/debian/patches/40_build-parallel.patch
new file mode 100644
index 0000000..67ce655
--- /dev/null
+++ b/debian/patches/40_build-parallel.patch
@@ -0,0 +1,55 @@
+Description: Build parallelly
+Author: Anton Gladky <gladk at debian.org>
+Last-Update: 2016-09-28
+
+Index: OpenFOAM-dev-version-4.0/wmake/scripts/AllwmakeParseArguments
+===================================================================
+--- OpenFOAM-dev-version-4.0.orig/wmake/scripts/AllwmakeParseArguments
++++ OpenFOAM-dev-version-4.0/wmake/scripts/AllwmakeParseArguments
+@@ -80,13 +80,6 @@ USAGE_LIB
+
+ setWM_NCOMPPROCS()
+ {
+- if [ -r /proc/cpuinfo ]
+- then
+- WM_NCOMPPROCS=$(egrep "^processor" /proc/cpuinfo | wc -l)
+- else
+- WM_NCOMPPROCS=1
+- fi
+-
+ export WM_NCOMPPROCS
+ }
+
+Index: OpenFOAM-dev-version-4.0/wmake/wmake
+===================================================================
+--- OpenFOAM-dev-version-4.0.orig/wmake/wmake
++++ OpenFOAM-dev-version-4.0/wmake/wmake
+@@ -156,25 +156,15 @@ done
+ # Set WM_NCOMPPROCS automatically when both WM_HOSTS and WM_SCHEDULER are set
+ if [ -z "$WM_NCOMPPROCS" -a -n "$WM_HOSTS" -a -n "$WM_SCHEDULER" ]
+ then
++ echo '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1d'
+ WM_NCOMPPROCS=$(wmakeScheduler -count)
+ [ $? -eq 0 ] || unset WM_NCOMPPROCS
+ fi
+
+ if [ "$WM_NCOMPPROCS" ]
+ then
+- if [ "$WM_NCOMPPROCS" -gt 1 -a ! "$MAKEFLAGS" ]
+- then
+- lockDir=$HOME/.$WM_PROJECT/.wmake
+-
+- if [ -d $lockDir ]
+- then
+- rm -f $lockDir/*
+- else
+- mkdir -p $lockDir
+- fi
+-
+- make="$make --no-print-directory -j "$WM_NCOMPPROCS
+- fi
++ echo '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1c'
++ make="$make --no-print-directory -j "$WM_NCOMPPROCS
+ fi
+
+
diff --git a/debian/patches/series b/debian/patches/series
index 1f92e72..aecbab2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,4 @@
10_fix_etc_path.patch
20_yyflex-fix.patch
+30_hardening.patch
+40_build-parallel.patch
diff --git a/debian/rules b/debian/rules
index cbec610..905c10f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -42,28 +42,18 @@ export WM_PROJECT_INST_DIR=$(CURDIR)/debian/tmp/usr
export WM_PROJECT_USER_DIR=$(CURDIR)/debian/tmp
export WM_PROJECT_VERSION=3.0.x
export gperftools_install=$(CURDIR)/platforms/linux64Gcc
-export WM_NCOMPPROCS=6
export WM_MPLIB=SYSTEMOPENMPI
unexport FOAMY_HEX_MESH
-export LD_LIBRARY_PATH:=$(CURDIR)/platforms/linux64Gcc51/lib/openmpi-system:/usr/lib/openmpi/lib:$(CURDIR)/platforms/linux64Gcc51/lib:$(CURDIR)/site/3.0.x/platforms/linux64Gcc51/lib:$(CURDIR)/platforms/linux64Gcc51/lib:$(CURDIR)/platforms/linux64Gcc51/lib/dummy:$(CURDIR)/src/:$(LD_LIBRARY_PATH);
+NUMJOBS=1
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+endif
+
+export WM_NCOMPPROCS=$(NUMJOBS)
-#export FOAM_EXT_LIBBIN=$(CURDIR)/A
-#export WM_OPTIONS=linux64Gcc51
-#export WM_LINK_LANGUAGE=c++
-#export WM_PROJECT=OpenFOAM
-#export WM_PROJECT_VERSION=2.3.1
-#export WM_ARCH=linux64Gcc51
-#export WM_OPTIONS=linux64Gcc51
-#export WM_PRECISION_OPTION=DP
-#export WM_COMPILE_OPTION=Opt
-#export WM_MPLIB=OPENMPI
-#export WM_OSTYPE=POSIX
-#export WM_PROJECT_INST_DIR=/usr
-#export WM_PROJECT_DIR=$(CURDIR)
-#export WM_DIR=$(CURDIR)/wmake
-#export WM_PROJECT_USER_DIR=$(CURDIR)
+export LD_LIBRARY_PATH:=$(CURDIR)/platforms/linux64Gcc51/lib/openmpi-system:/usr/lib/openmpi/lib:$(CURDIR)/platforms/linux64Gcc51/lib:$(CURDIR)/site/3.0.x/platforms/linux64Gcc51/lib:$(CURDIR)/platforms/linux64Gcc51/lib:$(CURDIR)/platforms/linux64Gcc51/lib/dummy:$(CURDIR)/src/:$(LD_LIBRARY_PATH);
override_dh_auto_build:
cd $(CURDIR)/debian/manpage ; python3 gen_man.py
- PATH=$(PATH):$(CURDIR)/wmake/ ./Allwmake
+ PATH=$(PATH):$(CURDIR)/wmake/ ./Allwmake -j$(NUMJOBS)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/openfoam.git
More information about the debian-science-commits
mailing list