From 11c8a6f19062323cfa980f16d81b034693a6e040ffa709f3521ed9d6169b435f Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: Wed, 11 Jul 2012 15:09:01 +0000 Subject: [PATCH] - reduce build parallelism to reduce build crashes: * dmake support 64 jobs at maximum * do not eat all memory with some huge sources - add procps into BuildRequires to check available memory OBS-URL: https://build.opensuse.org/package/show/LibreOffice:Factory/libreoffice?expand=0&rev=6 --- libreoffice-help-en-US.changes | 6 +++- libreoffice-help-en-US.spec | 51 +++++++++++++++++++++++---------- libreoffice-help-en-US.spec.in | 51 +++++++++++++++++++++++---------- libreoffice-help-group1.changes | 6 +++- libreoffice-help-group1.spec | 51 +++++++++++++++++++++++---------- libreoffice-help-group2.changes | 6 +++- libreoffice-help-group2.spec | 51 +++++++++++++++++++++++---------- libreoffice-help-group3.changes | 6 +++- libreoffice-help-group3.spec | 51 +++++++++++++++++++++++---------- libreoffice-help-group4.changes | 6 +++- libreoffice-help-group4.spec | 51 +++++++++++++++++++++++---------- libreoffice-help-group5.changes | 6 +++- libreoffice-help-group5.spec | 51 +++++++++++++++++++++++---------- libreoffice-help-groupX.spec.in | 51 +++++++++++++++++++++++---------- libreoffice-icon-themes.changes | 2 +- libreoffice-l10n.changes | 2 +- libreoffice.changes | 4 +++ libreoffice.spec | 45 ++++++++++++++++++++--------- 18 files changed, 356 insertions(+), 141 deletions(-) diff --git a/libreoffice-help-en-US.changes b/libreoffice-help-en-US.changes index 69d109a..9ef076c 100644 --- a/libreoffice-help-en-US.changes +++ b/libreoffice-help-en-US.changes @@ -1,7 +1,11 @@ ------------------------------------------------------------------- Mon Jul 9 17:06:28 UTC 2012 - pmladek@suse.com -- updated to libreoffice-3.5.4.7 (SUSE 3.5 rc3, based on upstream 3.5.5-rc3) +- update to libreoffice-3.5.4.7 (SUSE 3.5 rc3, based on upstream 3.5.5-rc3) +- reduce build parallelism to reduce build crashes: + * dmake support 64 jobs at maximum + * do not eat all memory with some huge sources +- add procps into BuildRequires to check available memory ------------------------------------------------------------------- Thu Jun 28 13:33:54 UTC 2012 - pmladek@suse.com diff --git a/libreoffice-help-en-US.spec b/libreoffice-help-en-US.spec index 7ccd9b2..cfd42e4 100644 --- a/libreoffice-help-en-US.spec +++ b/libreoffice-help-en-US.spec @@ -63,6 +63,7 @@ BuildRequires: openssl-devel BuildRequires: perl-Archive-Zip BuildRequires: perl-Compress-Zlib BuildRequires: pkg-config +BuildRequires: procps BuildRequires: unzip BuildRequires: xorg-x11-devel BuildRequires: zip @@ -182,24 +183,44 @@ cd - PARALLEL_BUILD= BUILD_SCRIPT_FLAGS= ncpus= -# parallel build of modules; it makes sense on machines with more CPUs -if test "%build_module_in_parallel" = "1" ; then - ncpus=`grep ^processor /proc/cpuinfo | wc -l` - PARALLEL_BUILD="$PARALLEL_BUILD --with-num-cpus=`grep ^processor /proc/cpuinfo | wc -l`" +# +# Parallel build settings ... +BUILD_SCRIPT_FLAGS= +# dmake does not work with more than 64 jobs +lo_jobs="%{?jobs:%jobs}" +if test -n "$lo_jobs" -a "$lo_jobs" -gt "64" ; then + echo "Warning: dmake does not support more than 64 processes => reducing number of parallel jobs" + lo_jobs="64" fi -if test "%build_module_in_parallel" -gt "1" ; then - ncpus=%build_module_in_parallel - PARALLEL_BUILD="$PARALLEL_BUILD --with-num-cpus=%build_module_in_parallel" +# do not eat all memory +lo_jobs_reduced= +if test -n "$lo_jobs" -a "$lo_jobs" -gt 1 ; then + if test `uname -i` = "x86_64" ; then + mem_per_process=300 + else + mem_per_process=200 + fi + max_mem=`LANG=C free -t -m | sed -n "s|^Total: *\([0-9]*\).*$|\1|p"` + max_jobs="$(($max_mem / $mem_per_process))" + test "$lo_jobs" -gt "$max_jobs" && lo_jobs="$max_jobs" && lo_jobs_reduced="yes" && echo "Warning: Reducing number of jobs to $max_jobs because of memory limits" + test "$lo_jobs" -le 0 && lo_jobs= && echo "Warning: Do not use the parallel build at all becuse of memory limits" fi -if test -n "$ncpus" ; then - PARALLEL_BUILD="--with-num-cpus=$ncpus" - BUILD_SCRIPT_FLAGS="-P$ncpus" +# finally set jobs +PARALLEL_BUILD= +if test -n "$lo_jobs" ; then + PARALLEL_BUILD="--with-max-jobs=$lo_jobs" + BUILD_SCRIPT_FLAGS="-- -P%jobs" fi -if test -n "%{?jobs:%jobs}" -a -e "/opt/icecream/bin/gcc" -a -e "/opt/icecream/bin/g++" ; then - PARALLEL_BUILD="$PARALLEL_BUILD - --with-gcc-speedup=icecream - --with-max-jobs=%jobs" - BUILD_SCRIPT_FLAGS="$BUILD_SCRIPT_FLAGS -- -P%jobs" +# parallel build of modules +# it makes sense on machines with more CPUs +num_cpus=`grep ^processor /proc/cpuinfo | wc -l` +# allow only 2 modules if there more jobs allowed in one module +test -n "$lo_jobs" -a "$lo_jobs" -gt 1 && num_cpus="2" +PARALLEL_BUILD="$PARALLEL_BUILD --with-num-cpus=$num_cpus" +BUILD_SCRIPT_FLAGS="-P$ncpus $BUILD_SCRIPT_FLAGS" +# using icecream +if test -e "/opt/icecream/bin/gcc" -a -e "/opt/icecream/bin/g++" ; then + PARALLEL_BUILD="$PARALLEL_BUILD --with-gcc-speedup=icecream" fi %endif # make sure that JAVA_HOME is set correctly diff --git a/libreoffice-help-en-US.spec.in b/libreoffice-help-en-US.spec.in index 3a22455..debe078 100644 --- a/libreoffice-help-en-US.spec.in +++ b/libreoffice-help-en-US.spec.in @@ -59,6 +59,7 @@ BuildRequires: openssl-devel BuildRequires: perl-Archive-Zip BuildRequires: perl-Compress-Zlib BuildRequires: pkg-config +BuildRequires: procps BuildRequires: unzip BuildRequires: xorg-x11-devel BuildRequires: zip @@ -178,24 +179,44 @@ cd - PARALLEL_BUILD= BUILD_SCRIPT_FLAGS= ncpus= -# parallel build of modules; it makes sense on machines with more CPUs -if test "%build_module_in_parallel" = "1" ; then - ncpus=`grep ^processor /proc/cpuinfo | wc -l` - PARALLEL_BUILD="$PARALLEL_BUILD --with-num-cpus=`grep ^processor /proc/cpuinfo | wc -l`" +# +# Parallel build settings ... +BUILD_SCRIPT_FLAGS= +# dmake does not work with more than 64 jobs +lo_jobs="%{?jobs:%jobs}" +if test -n "$lo_jobs" -a "$lo_jobs" -gt "64" ; then + echo "Warning: dmake does not support more than 64 processes => reducing number of parallel jobs" + lo_jobs="64" fi -if test "%build_module_in_parallel" -gt "1" ; then - ncpus=%build_module_in_parallel - PARALLEL_BUILD="$PARALLEL_BUILD --with-num-cpus=%build_module_in_parallel" +# do not eat all memory +lo_jobs_reduced= +if test -n "$lo_jobs" -a "$lo_jobs" -gt 1 ; then + if test `uname -i` = "x86_64" ; then + mem_per_process=300 + else + mem_per_process=200 + fi + max_mem=`LANG=C free -t -m | sed -n "s|^Total: *\([0-9]*\).*$|\1|p"` + max_jobs="$(($max_mem / $mem_per_process))" + test "$lo_jobs" -gt "$max_jobs" && lo_jobs="$max_jobs" && lo_jobs_reduced="yes" && echo "Warning: Reducing number of jobs to $max_jobs because of memory limits" + test "$lo_jobs" -le 0 && lo_jobs= && echo "Warning: Do not use the parallel build at all becuse of memory limits" fi -if test -n "$ncpus" ; then - PARALLEL_BUILD="--with-num-cpus=$ncpus" - BUILD_SCRIPT_FLAGS="-P$ncpus" +# finally set jobs +PARALLEL_BUILD= +if test -n "$lo_jobs" ; then + PARALLEL_BUILD="--with-max-jobs=$lo_jobs" + BUILD_SCRIPT_FLAGS="-- -P%jobs" fi -if test -n "%{?jobs:%jobs}" -a -e "/opt/icecream/bin/gcc" -a -e "/opt/icecream/bin/g++" ; then - PARALLEL_BUILD="$PARALLEL_BUILD - --with-gcc-speedup=icecream - --with-max-jobs=%jobs" - BUILD_SCRIPT_FLAGS="$BUILD_SCRIPT_FLAGS -- -P%jobs" +# parallel build of modules +# it makes sense on machines with more CPUs +num_cpus=`grep ^processor /proc/cpuinfo | wc -l` +# allow only 2 modules if there more jobs allowed in one module +test -n "$lo_jobs" -a "$lo_jobs" -gt 1 && num_cpus="2" +PARALLEL_BUILD="$PARALLEL_BUILD --with-num-cpus=$num_cpus" +BUILD_SCRIPT_FLAGS="-P$ncpus $BUILD_SCRIPT_FLAGS" +# using icecream +if test -e "/opt/icecream/bin/gcc" -a -e "/opt/icecream/bin/g++" ; then + PARALLEL_BUILD="$PARALLEL_BUILD --with-gcc-speedup=icecream" fi %endif # make sure that JAVA_HOME is set correctly diff --git a/libreoffice-help-group1.changes b/libreoffice-help-group1.changes index edd3353..ae8e553 100644 --- a/libreoffice-help-group1.changes +++ b/libreoffice-help-group1.changes @@ -1,7 +1,11 @@ ------------------------------------------------------------------- Mon Jul 9 17:06:28 UTC 2012 - pmladek@suse.com -- updated to libreoffice-3.5.4.7 (SUSE 3.5 rc3, based on upstream 3.5.5-rc3) +- update to libreoffice-3.5.4.7 (SUSE 3.5 rc3, based on upstream 3.5.5-rc3) +- reduce build parallelism to reduce build crashes: + * dmake support 64 jobs at maximum + * do not eat all memory with some huge sources +- add procps into BuildRequires to check available memory ------------------------------------------------------------------- Thu Jun 28 13:33:54 UTC 2012 - pmladek@suse.com diff --git a/libreoffice-help-group1.spec b/libreoffice-help-group1.spec index ccda37f..239f55d 100644 --- a/libreoffice-help-group1.spec +++ b/libreoffice-help-group1.spec @@ -75,6 +75,7 @@ BuildRequires: openssl-devel BuildRequires: perl-Archive-Zip BuildRequires: perl-Compress-Zlib BuildRequires: pkg-config +BuildRequires: procps BuildRequires: python-devel BuildRequires: unzip BuildRequires: xorg-x11-devel @@ -277,24 +278,44 @@ cd zip30 make %{?jobs:-j%jobs} -f unix/Makefile prefix=/usr CC="gcc $RPM_OPT_FLAGS -DLARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" generic_gcc cd - %endif -# parallel build of modules; it makes sense on machines with more CPUs -if test "%build_module_in_parallel" = "1" ; then - ncpus=`grep ^processor /proc/cpuinfo | wc -l` - PARALLEL_BUILD="$PARALLEL_BUILD --with-num-cpus=`grep ^processor /proc/cpuinfo | wc -l`" +# +# Parallel build settings ... +BUILD_SCRIPT_FLAGS= +# dmake does not work with more than 64 jobs +lo_jobs="%{?jobs:%jobs}" +if test -n "$lo_jobs" -a "$lo_jobs" -gt "64" ; then + echo "Warning: dmake does not support more than 64 processes => reducing number of parallel jobs" + lo_jobs="64" fi -if test "%build_module_in_parallel" -gt "1" ; then - ncpus=%build_module_in_parallel - PARALLEL_BUILD="$PARALLEL_BUILD --with-num-cpus=%build_module_in_parallel" +# do not eat all memory +lo_jobs_reduced= +if test -n "$lo_jobs" -a "$lo_jobs" -gt 1 ; then + if test `uname -i` = "x86_64" ; then + mem_per_process=300 + else + mem_per_process=200 + fi + max_mem=`LANG=C free -t -m | sed -n "s|^Total: *\([0-9]*\).*$|\1|p"` + max_jobs="$(($max_mem / $mem_per_process))" + test "$lo_jobs" -gt "$max_jobs" && lo_jobs="$max_jobs" && lo_jobs_reduced="yes" && echo "Warning: Reducing number of jobs to $max_jobs because of memory limits" + test "$lo_jobs" -le 0 && lo_jobs= && echo "Warning: Do not use the parallel build at all becuse of memory limits" fi -if test -n "$ncpus" ; then - PARALLEL_BUILD="--with-num-cpus=$ncpus" - BUILD_SCRIPT_FLAGS="-P$ncpus" +# finally set jobs +PARALLEL_BUILD= +if test -n "$lo_jobs" ; then + PARALLEL_BUILD="--with-max-jobs=$lo_jobs" + BUILD_SCRIPT_FLAGS="-- -P%jobs" fi -if test -n "%{?jobs:%jobs}" -a -e "/opt/icecream/bin/gcc" -a -e "/opt/icecream/bin/g++" ; then - PARALLEL_BUILD="$PARALLEL_BUILD - --with-gcc-speedup=icecream - --with-max-jobs=%jobs" - BUILD_SCRIPT_FLAGS="$BUILD_SCRIPT_FLAGS -- -P%jobs" +# parallel build of modules +# it makes sense on machines with more CPUs +num_cpus=`grep ^processor /proc/cpuinfo | wc -l` +# allow only 2 modules if there more jobs allowed in one module +test -n "$lo_jobs" -a "$lo_jobs" -gt 1 && num_cpus="2" +PARALLEL_BUILD="$PARALLEL_BUILD --with-num-cpus=$num_cpus" +BUILD_SCRIPT_FLAGS="-P$ncpus $BUILD_SCRIPT_FLAGS" +# using icecream +if test -e "/opt/icecream/bin/gcc" -a -e "/opt/icecream/bin/g++" ; then + PARALLEL_BUILD="$PARALLEL_BUILD --with-gcc-speedup=icecream" fi %endif # make sure that JAVA_HOME is set correctly diff --git a/libreoffice-help-group2.changes b/libreoffice-help-group2.changes index db34cd6..5fcfe8b 100644 --- a/libreoffice-help-group2.changes +++ b/libreoffice-help-group2.changes @@ -1,7 +1,11 @@ ------------------------------------------------------------------- Mon Jul 9 17:06:28 UTC 2012 - pmladek@suse.com -- updated to libreoffice-3.5.4.7 (SUSE 3.5 rc3, based on upstream 3.5.5-rc3) +- update to libreoffice-3.5.4.7 (SUSE 3.5 rc3, based on upstream 3.5.5-rc3) +- reduce build parallelism to reduce build crashes: + * dmake support 64 jobs at maximum + * do not eat all memory with some huge sources +- add procps into BuildRequires to check available memory ------------------------------------------------------------------- Thu Jun 28 13:33:54 UTC 2012 - pmladek@suse.com diff --git a/libreoffice-help-group2.spec b/libreoffice-help-group2.spec index bb50738..fe845b5 100644 --- a/libreoffice-help-group2.spec +++ b/libreoffice-help-group2.spec @@ -75,6 +75,7 @@ BuildRequires: openssl-devel BuildRequires: perl-Archive-Zip BuildRequires: perl-Compress-Zlib BuildRequires: pkg-config +BuildRequires: procps BuildRequires: python-devel BuildRequires: unzip BuildRequires: xorg-x11-devel @@ -295,24 +296,44 @@ cd zip30 make %{?jobs:-j%jobs} -f unix/Makefile prefix=/usr CC="gcc $RPM_OPT_FLAGS -DLARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" generic_gcc cd - %endif -# parallel build of modules; it makes sense on machines with more CPUs -if test "%build_module_in_parallel" = "1" ; then - ncpus=`grep ^processor /proc/cpuinfo | wc -l` - PARALLEL_BUILD="$PARALLEL_BUILD --with-num-cpus=`grep ^processor /proc/cpuinfo | wc -l`" +# +# Parallel build settings ... +BUILD_SCRIPT_FLAGS= +# dmake does not work with more than 64 jobs +lo_jobs="%{?jobs:%jobs}" +if test -n "$lo_jobs" -a "$lo_jobs" -gt "64" ; then + echo "Warning: dmake does not support more than 64 processes => reducing number of parallel jobs" + lo_jobs="64" fi -if test "%build_module_in_parallel" -gt "1" ; then - ncpus=%build_module_in_parallel - PARALLEL_BUILD="$PARALLEL_BUILD --with-num-cpus=%build_module_in_parallel" +# do not eat all memory +lo_jobs_reduced= +if test -n "$lo_jobs" -a "$lo_jobs" -gt 1 ; then + if test `uname -i` = "x86_64" ; then + mem_per_process=300 + else + mem_per_process=200 + fi + max_mem=`LANG=C free -t -m | sed -n "s|^Total: *\([0-9]*\).*$|\1|p"` + max_jobs="$(($max_mem / $mem_per_process))" + test "$lo_jobs" -gt "$max_jobs" && lo_jobs="$max_jobs" && lo_jobs_reduced="yes" && echo "Warning: Reducing number of jobs to $max_jobs because of memory limits" + test "$lo_jobs" -le 0 && lo_jobs= && echo "Warning: Do not use the parallel build at all becuse of memory limits" fi -if test -n "$ncpus" ; then - PARALLEL_BUILD="--with-num-cpus=$ncpus" - BUILD_SCRIPT_FLAGS="-P$ncpus" +# finally set jobs +PARALLEL_BUILD= +if test -n "$lo_jobs" ; then + PARALLEL_BUILD="--with-max-jobs=$lo_jobs" + BUILD_SCRIPT_FLAGS="-- -P%jobs" fi -if test -n "%{?jobs:%jobs}" -a -e "/opt/icecream/bin/gcc" -a -e "/opt/icecream/bin/g++" ; then - PARALLEL_BUILD="$PARALLEL_BUILD - --with-gcc-speedup=icecream - --with-max-jobs=%jobs" - BUILD_SCRIPT_FLAGS="$BUILD_SCRIPT_FLAGS -- -P%jobs" +# parallel build of modules +# it makes sense on machines with more CPUs +num_cpus=`grep ^processor /proc/cpuinfo | wc -l` +# allow only 2 modules if there more jobs allowed in one module +test -n "$lo_jobs" -a "$lo_jobs" -gt 1 && num_cpus="2" +PARALLEL_BUILD="$PARALLEL_BUILD --with-num-cpus=$num_cpus" +BUILD_SCRIPT_FLAGS="-P$ncpus $BUILD_SCRIPT_FLAGS" +# using icecream +if test -e "/opt/icecream/bin/gcc" -a -e "/opt/icecream/bin/g++" ; then + PARALLEL_BUILD="$PARALLEL_BUILD --with-gcc-speedup=icecream" fi %endif # make sure that JAVA_HOME is set correctly diff --git a/libreoffice-help-group3.changes b/libreoffice-help-group3.changes index 338451c..fe59bec 100644 --- a/libreoffice-help-group3.changes +++ b/libreoffice-help-group3.changes @@ -1,7 +1,11 @@ ------------------------------------------------------------------- Mon Jul 9 17:06:28 UTC 2012 - pmladek@suse.com -- updated to libreoffice-3.5.4.7 (SUSE 3.5 rc3, based on upstream 3.5.5-rc3) +- update to libreoffice-3.5.4.7 (SUSE 3.5 rc3, based on upstream 3.5.5-rc3) +- reduce build parallelism to reduce build crashes: + * dmake support 64 jobs at maximum + * do not eat all memory with some huge sources +- add procps into BuildRequires to check available memory ------------------------------------------------------------------- Thu Jun 28 13:33:54 UTC 2012 - pmladek@suse.com diff --git a/libreoffice-help-group3.spec b/libreoffice-help-group3.spec index 9793a60..bcac587 100644 --- a/libreoffice-help-group3.spec +++ b/libreoffice-help-group3.spec @@ -75,6 +75,7 @@ BuildRequires: openssl-devel BuildRequires: perl-Archive-Zip BuildRequires: perl-Compress-Zlib BuildRequires: pkg-config +BuildRequires: procps BuildRequires: python-devel BuildRequires: unzip BuildRequires: xorg-x11-devel @@ -334,24 +335,44 @@ cd zip30 make %{?jobs:-j%jobs} -f unix/Makefile prefix=/usr CC="gcc $RPM_OPT_FLAGS -DLARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" generic_gcc cd - %endif -# parallel build of modules; it makes sense on machines with more CPUs -if test "%build_module_in_parallel" = "1" ; then - ncpus=`grep ^processor /proc/cpuinfo | wc -l` - PARALLEL_BUILD="$PARALLEL_BUILD --with-num-cpus=`grep ^processor /proc/cpuinfo | wc -l`" +# +# Parallel build settings ... +BUILD_SCRIPT_FLAGS= +# dmake does not work with more than 64 jobs +lo_jobs="%{?jobs:%jobs}" +if test -n "$lo_jobs" -a "$lo_jobs" -gt "64" ; then + echo "Warning: dmake does not support more than 64 processes => reducing number of parallel jobs" + lo_jobs="64" fi -if test "%build_module_in_parallel" -gt "1" ; then - ncpus=%build_module_in_parallel - PARALLEL_BUILD="$PARALLEL_BUILD --with-num-cpus=%build_module_in_parallel" +# do not eat all memory +lo_jobs_reduced= +if test -n "$lo_jobs" -a "$lo_jobs" -gt 1 ; then + if test `uname -i` = "x86_64" ; then + mem_per_process=300 + else + mem_per_process=200 + fi + max_mem=`LANG=C free -t -m | sed -n "s|^Total: *\([0-9]*\).*$|\1|p"` + max_jobs="$(($max_mem / $mem_per_process))" + test "$lo_jobs" -gt "$max_jobs" && lo_jobs="$max_jobs" && lo_jobs_reduced="yes" && echo "Warning: Reducing number of jobs to $max_jobs because of memory limits" + test "$lo_jobs" -le 0 && lo_jobs= && echo "Warning: Do not use the parallel build at all becuse of memory limits" fi -if test -n "$ncpus" ; then - PARALLEL_BUILD="--with-num-cpus=$ncpus" - BUILD_SCRIPT_FLAGS="-P$ncpus" +# finally set jobs +PARALLEL_BUILD= +if test -n "$lo_jobs" ; then + PARALLEL_BUILD="--with-max-jobs=$lo_jobs" + BUILD_SCRIPT_FLAGS="-- -P%jobs" fi -if test -n "%{?jobs:%jobs}" -a -e "/opt/icecream/bin/gcc" -a -e "/opt/icecream/bin/g++" ; then - PARALLEL_BUILD="$PARALLEL_BUILD - --with-gcc-speedup=icecream - --with-max-jobs=%jobs" - BUILD_SCRIPT_FLAGS="$BUILD_SCRIPT_FLAGS -- -P%jobs" +# parallel build of modules +# it makes sense on machines with more CPUs +num_cpus=`grep ^processor /proc/cpuinfo | wc -l` +# allow only 2 modules if there more jobs allowed in one module +test -n "$lo_jobs" -a "$lo_jobs" -gt 1 && num_cpus="2" +PARALLEL_BUILD="$PARALLEL_BUILD --with-num-cpus=$num_cpus" +BUILD_SCRIPT_FLAGS="-P$ncpus $BUILD_SCRIPT_FLAGS" +# using icecream +if test -e "/opt/icecream/bin/gcc" -a -e "/opt/icecream/bin/g++" ; then + PARALLEL_BUILD="$PARALLEL_BUILD --with-gcc-speedup=icecream" fi %endif # make sure that JAVA_HOME is set correctly diff --git a/libreoffice-help-group4.changes b/libreoffice-help-group4.changes index c9ae888..14218ce 100644 --- a/libreoffice-help-group4.changes +++ b/libreoffice-help-group4.changes @@ -1,7 +1,11 @@ ------------------------------------------------------------------- Mon Jul 9 17:06:28 UTC 2012 - pmladek@suse.com -- updated to libreoffice-3.5.4.7 (SUSE 3.5 rc3, based on upstream 3.5.5-rc3) +- update to libreoffice-3.5.4.7 (SUSE 3.5 rc3, based on upstream 3.5.5-rc3) +- reduce build parallelism to reduce build crashes: + * dmake support 64 jobs at maximum + * do not eat all memory with some huge sources +- add procps into BuildRequires to check available memory ------------------------------------------------------------------- Thu Jun 28 13:33:54 UTC 2012 - pmladek@suse.com diff --git a/libreoffice-help-group4.spec b/libreoffice-help-group4.spec index d4658fc..57d2292 100644 --- a/libreoffice-help-group4.spec +++ b/libreoffice-help-group4.spec @@ -75,6 +75,7 @@ BuildRequires: openssl-devel BuildRequires: perl-Archive-Zip BuildRequires: perl-Compress-Zlib BuildRequires: pkg-config +BuildRequires: procps BuildRequires: python-devel BuildRequires: unzip BuildRequires: xorg-x11-devel @@ -268,24 +269,44 @@ cd zip30 make %{?jobs:-j%jobs} -f unix/Makefile prefix=/usr CC="gcc $RPM_OPT_FLAGS -DLARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" generic_gcc cd - %endif -# parallel build of modules; it makes sense on machines with more CPUs -if test "%build_module_in_parallel" = "1" ; then - ncpus=`grep ^processor /proc/cpuinfo | wc -l` - PARALLEL_BUILD="$PARALLEL_BUILD --with-num-cpus=`grep ^processor /proc/cpuinfo | wc -l`" +# +# Parallel build settings ... +BUILD_SCRIPT_FLAGS= +# dmake does not work with more than 64 jobs +lo_jobs="%{?jobs:%jobs}" +if test -n "$lo_jobs" -a "$lo_jobs" -gt "64" ; then + echo "Warning: dmake does not support more than 64 processes => reducing number of parallel jobs" + lo_jobs="64" fi -if test "%build_module_in_parallel" -gt "1" ; then - ncpus=%build_module_in_parallel - PARALLEL_BUILD="$PARALLEL_BUILD --with-num-cpus=%build_module_in_parallel" +# do not eat all memory +lo_jobs_reduced= +if test -n "$lo_jobs" -a "$lo_jobs" -gt 1 ; then + if test `uname -i` = "x86_64" ; then + mem_per_process=300 + else + mem_per_process=200 + fi + max_mem=`LANG=C free -t -m | sed -n "s|^Total: *\([0-9]*\).*$|\1|p"` + max_jobs="$(($max_mem / $mem_per_process))" + test "$lo_jobs" -gt "$max_jobs" && lo_jobs="$max_jobs" && lo_jobs_reduced="yes" && echo "Warning: Reducing number of jobs to $max_jobs because of memory limits" + test "$lo_jobs" -le 0 && lo_jobs= && echo "Warning: Do not use the parallel build at all becuse of memory limits" fi -if test -n "$ncpus" ; then - PARALLEL_BUILD="--with-num-cpus=$ncpus" - BUILD_SCRIPT_FLAGS="-P$ncpus" +# finally set jobs +PARALLEL_BUILD= +if test -n "$lo_jobs" ; then + PARALLEL_BUILD="--with-max-jobs=$lo_jobs" + BUILD_SCRIPT_FLAGS="-- -P%jobs" fi -if test -n "%{?jobs:%jobs}" -a -e "/opt/icecream/bin/gcc" -a -e "/opt/icecream/bin/g++" ; then - PARALLEL_BUILD="$PARALLEL_BUILD - --with-gcc-speedup=icecream - --with-max-jobs=%jobs" - BUILD_SCRIPT_FLAGS="$BUILD_SCRIPT_FLAGS -- -P%jobs" +# parallel build of modules +# it makes sense on machines with more CPUs +num_cpus=`grep ^processor /proc/cpuinfo | wc -l` +# allow only 2 modules if there more jobs allowed in one module +test -n "$lo_jobs" -a "$lo_jobs" -gt 1 && num_cpus="2" +PARALLEL_BUILD="$PARALLEL_BUILD --with-num-cpus=$num_cpus" +BUILD_SCRIPT_FLAGS="-P$ncpus $BUILD_SCRIPT_FLAGS" +# using icecream +if test -e "/opt/icecream/bin/gcc" -a -e "/opt/icecream/bin/g++" ; then + PARALLEL_BUILD="$PARALLEL_BUILD --with-gcc-speedup=icecream" fi %endif # make sure that JAVA_HOME is set correctly diff --git a/libreoffice-help-group5.changes b/libreoffice-help-group5.changes index db34cd6..5fcfe8b 100644 --- a/libreoffice-help-group5.changes +++ b/libreoffice-help-group5.changes @@ -1,7 +1,11 @@ ------------------------------------------------------------------- Mon Jul 9 17:06:28 UTC 2012 - pmladek@suse.com -- updated to libreoffice-3.5.4.7 (SUSE 3.5 rc3, based on upstream 3.5.5-rc3) +- update to libreoffice-3.5.4.7 (SUSE 3.5 rc3, based on upstream 3.5.5-rc3) +- reduce build parallelism to reduce build crashes: + * dmake support 64 jobs at maximum + * do not eat all memory with some huge sources +- add procps into BuildRequires to check available memory ------------------------------------------------------------------- Thu Jun 28 13:33:54 UTC 2012 - pmladek@suse.com diff --git a/libreoffice-help-group5.spec b/libreoffice-help-group5.spec index a2a07e0..7d6d4a7 100644 --- a/libreoffice-help-group5.spec +++ b/libreoffice-help-group5.spec @@ -75,6 +75,7 @@ BuildRequires: openssl-devel BuildRequires: perl-Archive-Zip BuildRequires: perl-Compress-Zlib BuildRequires: pkg-config +BuildRequires: procps BuildRequires: python-devel BuildRequires: unzip BuildRequires: xorg-x11-devel @@ -322,24 +323,44 @@ cd zip30 make %{?jobs:-j%jobs} -f unix/Makefile prefix=/usr CC="gcc $RPM_OPT_FLAGS -DLARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" generic_gcc cd - %endif -# parallel build of modules; it makes sense on machines with more CPUs -if test "%build_module_in_parallel" = "1" ; then - ncpus=`grep ^processor /proc/cpuinfo | wc -l` - PARALLEL_BUILD="$PARALLEL_BUILD --with-num-cpus=`grep ^processor /proc/cpuinfo | wc -l`" +# +# Parallel build settings ... +BUILD_SCRIPT_FLAGS= +# dmake does not work with more than 64 jobs +lo_jobs="%{?jobs:%jobs}" +if test -n "$lo_jobs" -a "$lo_jobs" -gt "64" ; then + echo "Warning: dmake does not support more than 64 processes => reducing number of parallel jobs" + lo_jobs="64" fi -if test "%build_module_in_parallel" -gt "1" ; then - ncpus=%build_module_in_parallel - PARALLEL_BUILD="$PARALLEL_BUILD --with-num-cpus=%build_module_in_parallel" +# do not eat all memory +lo_jobs_reduced= +if test -n "$lo_jobs" -a "$lo_jobs" -gt 1 ; then + if test `uname -i` = "x86_64" ; then + mem_per_process=300 + else + mem_per_process=200 + fi + max_mem=`LANG=C free -t -m | sed -n "s|^Total: *\([0-9]*\).*$|\1|p"` + max_jobs="$(($max_mem / $mem_per_process))" + test "$lo_jobs" -gt "$max_jobs" && lo_jobs="$max_jobs" && lo_jobs_reduced="yes" && echo "Warning: Reducing number of jobs to $max_jobs because of memory limits" + test "$lo_jobs" -le 0 && lo_jobs= && echo "Warning: Do not use the parallel build at all becuse of memory limits" fi -if test -n "$ncpus" ; then - PARALLEL_BUILD="--with-num-cpus=$ncpus" - BUILD_SCRIPT_FLAGS="-P$ncpus" +# finally set jobs +PARALLEL_BUILD= +if test -n "$lo_jobs" ; then + PARALLEL_BUILD="--with-max-jobs=$lo_jobs" + BUILD_SCRIPT_FLAGS="-- -P%jobs" fi -if test -n "%{?jobs:%jobs}" -a -e "/opt/icecream/bin/gcc" -a -e "/opt/icecream/bin/g++" ; then - PARALLEL_BUILD="$PARALLEL_BUILD - --with-gcc-speedup=icecream - --with-max-jobs=%jobs" - BUILD_SCRIPT_FLAGS="$BUILD_SCRIPT_FLAGS -- -P%jobs" +# parallel build of modules +# it makes sense on machines with more CPUs +num_cpus=`grep ^processor /proc/cpuinfo | wc -l` +# allow only 2 modules if there more jobs allowed in one module +test -n "$lo_jobs" -a "$lo_jobs" -gt 1 && num_cpus="2" +PARALLEL_BUILD="$PARALLEL_BUILD --with-num-cpus=$num_cpus" +BUILD_SCRIPT_FLAGS="-P$ncpus $BUILD_SCRIPT_FLAGS" +# using icecream +if test -e "/opt/icecream/bin/gcc" -a -e "/opt/icecream/bin/g++" ; then + PARALLEL_BUILD="$PARALLEL_BUILD --with-gcc-speedup=icecream" fi %endif # make sure that JAVA_HOME is set correctly diff --git a/libreoffice-help-groupX.spec.in b/libreoffice-help-groupX.spec.in index b37823a..62937d1 100644 --- a/libreoffice-help-groupX.spec.in +++ b/libreoffice-help-groupX.spec.in @@ -71,6 +71,7 @@ BuildRequires: openssl-devel BuildRequires: perl-Archive-Zip BuildRequires: perl-Compress-Zlib BuildRequires: pkg-config +BuildRequires: procps BuildRequires: python-devel BuildRequires: unzip BuildRequires: xorg-x11-devel @@ -154,24 +155,44 @@ cd zip30 make %{?jobs:-j%jobs} -f unix/Makefile prefix=/usr CC="gcc $RPM_OPT_FLAGS -DLARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" generic_gcc cd - %endif -# parallel build of modules; it makes sense on machines with more CPUs -if test "%build_module_in_parallel" = "1" ; then - ncpus=`grep ^processor /proc/cpuinfo | wc -l` - PARALLEL_BUILD="$PARALLEL_BUILD --with-num-cpus=`grep ^processor /proc/cpuinfo | wc -l`" +# +# Parallel build settings ... +BUILD_SCRIPT_FLAGS= +# dmake does not work with more than 64 jobs +lo_jobs="%{?jobs:%jobs}" +if test -n "$lo_jobs" -a "$lo_jobs" -gt "64" ; then + echo "Warning: dmake does not support more than 64 processes => reducing number of parallel jobs" + lo_jobs="64" fi -if test "%build_module_in_parallel" -gt "1" ; then - ncpus=%build_module_in_parallel - PARALLEL_BUILD="$PARALLEL_BUILD --with-num-cpus=%build_module_in_parallel" +# do not eat all memory +lo_jobs_reduced= +if test -n "$lo_jobs" -a "$lo_jobs" -gt 1 ; then + if test `uname -i` = "x86_64" ; then + mem_per_process=300 + else + mem_per_process=200 + fi + max_mem=`LANG=C free -t -m | sed -n "s|^Total: *\([0-9]*\).*$|\1|p"` + max_jobs="$(($max_mem / $mem_per_process))" + test "$lo_jobs" -gt "$max_jobs" && lo_jobs="$max_jobs" && lo_jobs_reduced="yes" && echo "Warning: Reducing number of jobs to $max_jobs because of memory limits" + test "$lo_jobs" -le 0 && lo_jobs= && echo "Warning: Do not use the parallel build at all becuse of memory limits" fi -if test -n "$ncpus" ; then - PARALLEL_BUILD="--with-num-cpus=$ncpus" - BUILD_SCRIPT_FLAGS="-P$ncpus" +# finally set jobs +PARALLEL_BUILD= +if test -n "$lo_jobs" ; then + PARALLEL_BUILD="--with-max-jobs=$lo_jobs" + BUILD_SCRIPT_FLAGS="-- -P%jobs" fi -if test -n "%{?jobs:%jobs}" -a -e "/opt/icecream/bin/gcc" -a -e "/opt/icecream/bin/g++" ; then - PARALLEL_BUILD="$PARALLEL_BUILD - --with-gcc-speedup=icecream - --with-max-jobs=%jobs" - BUILD_SCRIPT_FLAGS="$BUILD_SCRIPT_FLAGS -- -P%jobs" +# parallel build of modules +# it makes sense on machines with more CPUs +num_cpus=`grep ^processor /proc/cpuinfo | wc -l` +# allow only 2 modules if there more jobs allowed in one module +test -n "$lo_jobs" -a "$lo_jobs" -gt 1 && num_cpus="2" +PARALLEL_BUILD="$PARALLEL_BUILD --with-num-cpus=$num_cpus" +BUILD_SCRIPT_FLAGS="-P$ncpus $BUILD_SCRIPT_FLAGS" +# using icecream +if test -e "/opt/icecream/bin/gcc" -a -e "/opt/icecream/bin/g++" ; then + PARALLEL_BUILD="$PARALLEL_BUILD --with-gcc-speedup=icecream" fi %endif # make sure that JAVA_HOME is set correctly diff --git a/libreoffice-icon-themes.changes b/libreoffice-icon-themes.changes index 5b87ae2..71b7ef4 100644 --- a/libreoffice-icon-themes.changes +++ b/libreoffice-icon-themes.changes @@ -1,7 +1,7 @@ ------------------------------------------------------------------- Mon Jul 9 17:06:28 UTC 2012 - pmladek@suse.com -- updated to libreoffice-3.5.4.7 (SUSE 3.5 rc3, based on upstream 3.5.5-rc3) +- update to libreoffice-3.5.4.7 (SUSE 3.5 rc3, based on upstream 3.5.5-rc3) ------------------------------------------------------------------- Thu Jun 28 13:33:54 UTC 2012 - pmladek@suse.com diff --git a/libreoffice-l10n.changes b/libreoffice-l10n.changes index 226269f..eb14bfc 100644 --- a/libreoffice-l10n.changes +++ b/libreoffice-l10n.changes @@ -1,7 +1,7 @@ ------------------------------------------------------------------- Mon Jul 9 17:06:28 UTC 2012 - pmladek@suse.com -- updated to libreoffice-3.5.4.7 (SUSE 3.5 rc3, based on upstream 3.5.5-rc3) +- update to libreoffice-3.5.4.7 (SUSE 3.5 rc3, based on upstream 3.5.5-rc3) ------------------------------------------------------------------- Thu Jun 28 13:33:54 UTC 2012 - pmladek@suse.com diff --git a/libreoffice.changes b/libreoffice.changes index efcdc46..79c6bc9 100644 --- a/libreoffice.changes +++ b/libreoffice.changes @@ -11,6 +11,10 @@ Mon Jul 9 17:06:28 UTC 2012 - pmladek@suse.com * fix MySQL, GDocs, and LanguageTool extension registration * make sure we don't export shapes with negative size (bnc#760997) * make sure all tab pages have the same dimensions (fdo#49921, bnc#769162) +- reduce build parallelism to reduce build crashes: + * dmake support 64 jobs at maximum + * do not eat all memory with some huge sources +- add procps into BuildRequires to check available memory ------------------------------------------------------------------- Thu Jun 28 13:33:54 UTC 2012 - pmladek@suse.com diff --git a/libreoffice.spec b/libreoffice.spec index c6fa4ef..25d3427 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -47,6 +47,7 @@ BuildRequires: patch BuildRequires: perl-Archive-Zip BuildRequires: perl-Compress-Zlib BuildRequires: postgresql-devel +BuildRequires: procps BuildRequires: python-devel BuildRequires: recode BuildRequires: unixODBC-devel @@ -163,10 +164,6 @@ BuildRequires: gst-plugins-base-devel # test_build_SDK: 0 = no # 1 = yes (if possible, see below the definition of lo_build_sdk) %define test_build_sdk 1 -# build_module_in_parallel 0 = no -# 1 = yes (the number is defined be the number of cpus) -# 2,3,4... = yes (force the number of modules to be built in parallel) -%define build_module_in_parallel 1 # debug_build: 0 = no # 1 = yes (enable depency tracking, ccache) %define debug_build 0 @@ -1388,17 +1385,39 @@ cd - %endif # # Parallel build settings ... +# dmake does not work with more than 64 jobs +lo_jobs="%{?jobs:%jobs}" +if test -n "$lo_jobs" -a "$lo_jobs" -gt "64" ; then + echo "Warning: dmake does not support more than 64 processes => reducing number of parallel jobs" + lo_jobs="64" +fi +# do not eat all memory +lo_jobs_reduced= +if test -n "$lo_jobs" -a "$lo_jobs" -gt 1 ; then + if test `uname -i` = "x86_64" ; then + mem_per_process=300 + else + mem_per_process=200 + fi + max_mem=`LANG=C free -t -m | sed -n "s|^Total: *\([0-9]*\).*$|\1|p"` + max_jobs="$(($max_mem / $mem_per_process))" + test "$lo_jobs" -gt "$max_jobs" && lo_jobs="$max_jobs" && lo_jobs_reduced="yes" && echo "Warning: Reducing number of jobs to $max_jobs because of memory limits" + test "$lo_jobs" -le 0 && lo_jobs= && echo "Warning: Do not use the parallel build at all becuse of memory limits" +fi +# finally set jobs PARALLEL_BUILD= -if test -n "%{?jobs:%jobs}" -a -e "/opt/icecream/bin/gcc" -a -e "/opt/icecream/bin/g++" ; then - PARALLEL_BUILD="--with-gcc-speedup=icecream - --with-max-jobs=%jobs" +if test -n "$lo_jobs" ; then + PARALLEL_BUILD="--with-max-jobs=$lo_jobs" fi -# parallel build of modules; it makes sense on machines with more CPUs -if test "%build_module_in_parallel" = "1" ; then - PARALLEL_BUILD="$PARALLEL_BUILD --with-num-cpus=`grep ^processor /proc/cpuinfo | wc -l`" -fi -if test "%build_module_in_parallel" -gt "1" ; then - PARALLEL_BUILD="$PARALLEL_BUILD --with-num-cpus=%build_module_in_parallel" +# parallel build of modules +# it makes sense on machines with more CPUs +num_cpus=`grep ^processor /proc/cpuinfo | wc -l` +# allow only 2 modules if there more jobs allowed in one module +test -n "$lo_jobs" -a "$lo_jobs" -gt 1 && num_cpus="2" +PARALLEL_BUILD="$PARALLEL_BUILD --with-num-cpus=$num_cpus" +# using icecream +if test -e "/opt/icecream/bin/gcc" -a -e "/opt/icecream/bin/g++" ; then + PARALLEL_BUILD="$PARALLEL_BUILD --with-gcc-speedup=icecream" fi # # disable KDE4 on openSUSE-11.1-Evergreen but not on SLED11