[Rivet-svn] rivet: Multi-threaded rivet-buildplugin. Realized that we're bui...

Rivet Mercurial rivet at projects.hepforge.org
Fri Jun 16 09:15:01 BST 2017


details:   https://rivet.hepforge.org/hg/rivet/rev/6718836040f3
branches:  
changeset: 5817:6718836040f3
user:      David Grellscheid <david.grellscheid at durham.ac.uk>
date:      Fri Jun 16 10:06:37 2017 +0200
description:
Multi-threaded rivet-buildplugin. Realized that we're building make here. Let's actually use make instead.

diffs (truncated from 300 to 50 lines):

--- a/bin/rivet-buildplugin.in	Wed May 03 15:43:17 2017 +0100
+++ b/bin/rivet-buildplugin.in	Fri Jun 16 10:06:37 2017 +0200
@@ -5,43 +5,120 @@
 ## Get program name
 PROG=$(basename $0)
 
-## Print help message
-tmp=$(echo "$*" | egrep -- '--\<help\>|-\<h\>')
-if test -n "$tmp"; then # || test $# -lt 1
-    echo "$PROG: compilation helper for Rivet analysis plugins"
-    echo
-    echo "Usage: $PROG [<libname>] <source1> [<source2> [compiler_flags] ...]"
-    echo
-    echo "<libname> can be a path, provided the filename is of the form 'Rivet*.so'"
-    echo "If <libname> is not specified, the default name is 'RivetAnalysis.so'."
-    echo
-    echo "To make special build variations you can add appropriate compiler flags"
-    echo "to the arguments and these will be passed directly to the compiler. For"
-    echo "example, for a debug build of your plugin library, add '-g', and for a"
-    echo "32 bit build on a 64 bit system add '-m32'."
-    echo
-    echo "Options:"
-    echo "  -h | --help: display this help message"
-    echo "  --with-root: add ROOT link options (requires root-config on system)"
-    echo "  --cmd|--dry-run: just print the generated compiler command, do not execute"
-    echo
-    echo "TODO:"
-    echo "  * is there a GCC option to parallelise the single-command compilation?"
-    test -n "$tmp"
-    exit $?
+# default value for num_jobs is all available cores
+let num_jobs=$(getconf _NPROCESSORS_ONLN)
+
+function usage {
+    cat <<-EOF
+		$PROG: 
+		compile a Rivet analysis plugin library from one or more sources
+
+		Usage: $PROG [options] [libname] source1 [...] [compiler_flags]
+
+		<libname> can be a path, provided the filename is of the form 'Rivet*.so'
+		If <libname> is not specified, the default name is 'RivetAnalysis.so'.
+
+		To make special build variations you can add appropriate compiler flags
+		to the arguments and these will be passed directly to the compiler. For
+		example, for a debug build of your plugin library, add '-g', and for a
+		32 bit build on a 64 bit system add '-m32'.
+
+		Options:
+		  -h | --help:      display this help message


More information about the Rivet-svn mailing list