Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F19250526
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
23 KB
Referenced Files
None
Subscribers
None
View Options
Index: contrib/trunk/configure
===================================================================
--- contrib/trunk/configure (revision 310)
+++ contrib/trunk/configure (revision 311)
@@ -1,325 +1,326 @@
#!/bin/bash
#
# This script will generate a Makefile according to the options one requests.
# The Makefile will then allow one to build and install the FastJet contrib.
#
# See
# configure --help
# for information about how to use this script
#------------------------------------------------------------------------
# the list of contribs supported by this script
#------------------------------------------------------------------------
all_contribs=`find . -mindepth 2 -maxdepth 2 -name VERSION -not -print \
| sed 's/\.\///g;s/\/.*$//g' | grep -v "Template"`
#------------------------------------------------------------------------
# default values prior to the arg parsing
#------------------------------------------------------------------------
only_contribs=""
excluded_contribs=""
fjconfig="fastjet-config"
#------------------------------------------------------------------------
# print a usage message and exit
#------------------------------------------------------------------------
# exit code passed as argument:
# 0 if it is a normal call
# 1 if it is due to a misusage.
usage(){
cat 1>&2 <<EOF
This is a FastJet-contrib tool to configure the behaviour of
the build and installation.
Usage:
configure [--help] [--list] [--fastjet-config=FILE] [--prefix=PREFIX] [CXX=...] [CXXFLAGS=...]
The arguments can be the following [default in square brackets]:
--help prints this message and exits
--list prints the list of existing contribs and exits
--fastjet-config=FILE
sets the 'fastjet-config' file to use [$fjconfig]
--prefix=PREFIX sets the installation directory [prefix returned by fastjet-config]
--only=Contrib1,Contrib2,...
only configures for compilation selected contribs
--exclude=Contrib1,Contrib2,...
excludes selected contribs from configuration
EOF
exit $1
}
#------------------------------------------------------------------------
# write error messages and exit
#------------------------------------------------------------------------
write_error(){
echo "Error: $1"
echo "Use fastjet-config --help for more information"
exit 1
}
#------------------------------------------------------------------------
# tools to parse options
#------------------------------------------------------------------------
# option_name _string
# Returns NAME if _string is of the form: --NAME[=...]
option_name(){
echo "$1" | sed 's/^--//;s/=.*//' | tr '-' '_'
}
# option_value _string
# Returns FOO if _string is of the form: --option=FOO
option_value(){
echo "$1" | sed 's/^[^=]*=//'
}
# is_in_list _arg _arg_list
# return true if the argument _arg is in the list _arg_list
# and false otherwise
is_in_list(){
arg_match="$1"
shift
for arg_match_i do
[ "x$arg_match_i" != "x$arg_match" ] || return 0
done
false
}
#------------------------------------------------------------------------
# parse the command line options
#------------------------------------------------------------------------
# first deal with the case where no argument is passed
#[ $# -gt 0 ] || usage 1
# make sure Makefile.inc is absent
makefileinc=".Makefile.inc"
[ -e $makefileinc ] && rm $makefileinc && touch $makefileinc
echo "# contrib-wide Makefile include file, generated automatically with" >> $makefileinc
echo "# $0 $*" >> $makefileinc
for arg do
case "$arg" in
--help|-h)
usage 0
;;
--list)
echo $all_contribs
exit 0
;;
--*=*)
arg_name=`option_name $arg`
arg_value=`option_value $arg`
case $arg_name in
prefix)
prefix="$arg_value"
;;
fastjet_config)
fjconfig="$arg_value"
;;
only)
- only_contribs="${arg_value//,/ /}"
+ only_contribs="${arg_value//,/ }" # replace all commas with a blank
;;
exclude)
- excluded_contribs="${arg_value//,/ /}"
+ excluded_contribs="${arg_value//,/ }" # replace all commas with a blank
;;
*)
write_error "$arg: unrecognised argument"
;;
esac
;;
[A-Z]*=*)
# variables that go into the $makefileinc
echo "$arg" >> $makefileinc
;;
*)
write_error "$arg is not a recognised argument. Aborting"
;;
esac
done
#------------------------------------------------------------------------
# check for fastjet-config and set up prefix
#------------------------------------------------------------------------
# exit if fastjet-config is not found (bad file name or not in path)
if ! [ `command -v $fjconfig` ]; then
echo "Error:" $fjconfig" has not been found."
echo " You may explicitly specify the location of fastjet-config "
echo " with the option --fastjet-config=...."
echo "Exiting"
exit 1
fi
# if prefix has not been set explicitly from command line, set it to
# the one returned by 'fastjet-config --prefix'
if [ "x"$prefix == "x" ] ; then
prefix=`$fjconfig --prefix`
fi
# generate the rest of $makefileinc
echo "FASTJETCONFIG=$fjconfig" >> $makefileinc
echo "PREFIX=$prefix" >> $makefileinc
echo 'install_script = $(SHELL) ../utils/install-sh' >> $makefileinc
echo 'check_script = ../utils/check.sh' >> $makefileinc
#------------------------------------------------------------------------
# construct the list of directories to recurse into
#------------------------------------------------------------------------
included_contribs=""
if [ "x${only_contribs}" == "x" ] ; then
included_contribs="$all_contribs"
else
included_contribs="$only_contribs"
fi
built_contribs=""
if [ "x${excluded_contribs}" == "x" ] ; then
built_contribs="$included_contribs"
else
built_contribs=""
for contrib in $included_contribs; do
if ! is_in_list $contrib ${excluded_contribs} ; then
built_contribs="$built_contribs $contrib"
fi
done
fi
#------------------------------------------------------------------------
# create the Makefile
#------------------------------------------------------------------------
TAB="$(printf '\t')"
# cat >Makefile <<EOF
# # This Makefile has been generated by the 'configure' script.
# # Please edit this with great care.
#
# # installation setup
# SUBDIRS=$built_contribs
#
# # Note: we could simply use "export" here to have all variables
# # exported by default, but the explicit mention below has the advantage
# # that it overrides any default in the sub-makefile. Note also
# # that we could play some games with te MAKELEVEL variable.
# SUBMAKE=\$(MAKE) FASTJETCONFIG=${fjconfig} PREFIX=$prefix
#
# RECURSIVE_TARGETS=all-recursive install-recursive clean examples
#
# .PHONY: \$(RECURSIVE_TARGETS) install examples
#
# all: all-recursive
#
# install: all install-recursive
#
# \$(RECURSIVE_TARGETS):
# ${TAB}@+failcom='exit 1' \\
# ${TAB}target=\`echo \$@ | sed s/-recursive//\`; \\
# ${TAB}list='\$(SUBDIRS)'; for subdir in \$(SUBDIRS); do \\
# ${TAB} \$(SUBMAKE) -C \$\$subdir \$\$target || eval \$\$failcom; \\
# ${TAB}done
#
# EOF
# The method below id more along the lines of what is present in the
# GNU make manual but the explicit use of $(MAKECMDGOALS) in the
# recursion causes make install to recurse as "make install" (even
# though it depends on make all... so each the contribs is built and
# installed before going to the next one, In case of a compilation
# error, it is better to build everything and then install everything.
#
# The option to avoid that would be to define an explicit recursion
# for each target e.g. doing
#
# SUBDIRS.clean = $(SUBDIRS:=.clean)
# clean: $(SUBDIRS.clean)
# $(SUBDIRS.clean):
# $(MAKE) -C $@ clean
# .PHONY: clean $(SUBDIRS.clean)
#
# which, in our case would probably only be required for "all" (so
# that it can explicitly be called by install
#
# Note that this method may have a better behaviour when using the -j
# option.
# cat >Makefile <<EOF
# # This Makefile has been generated by the 'configure' script.
# # Please edit this with great care.
#
# # installation setup
# SUBDIRS=$built_contribs
# SUBDIRS.all=\$(SUBDIRS:=.all)
#
# SUBMAKE=\$(MAKE) FASTJETCONFIG=${fjconfig} PREFIX=$prefix
#
# .PHONY: \$(SUBDIRS) \$(SUBDIRS.all) clean distclean check install examples
#
# all: \$(SUBDIRS.all)
#
# install: all \$(SUBDIRS)
#
# examples check clean distclean: \$(SUBDIRS)
#
# \$(SUBDIRS):
# ${TAB}+\$(SUBMAKE) -C \$@ \$(MAKECMDGOALS)
#
# \$(SUBDIRS.all):
# ${TAB}+\$(SUBMAKE) -C \$(basename \$@)
#
# EOF
# alternatively we could build this from the Makefile.in
# prefix variable
-# note that the apparently bizarre construct below ensures that the
-# appropriate characters are escaped in the sed replacement
+commandline="$0 $*"
+# he apparently bizarre constructs below ensure that the
+# slashes are escaped in the sed replacement, so as not to conflicit
+# with those in the s/// syntax
escaped_built_list="$(echo ${built_contribs} | sed -e 's/[\/&]/\\&/g')"
escaped_fjconfig="$(echo ${fjconfig} | sed -e 's/[\/&]/\\&/g')"
escaped_prefix="$(echo ${prefix} | sed -e 's/[\/&]/\\&/g')"
-
-commandline="$0 $*"
+escaped_commandline="$(echo ${commandline} | sed -e 's/[\/&]/\\&/g')"
+# write out the Makefile
sed -e "s/@CONTRIB_BUILD_LIST@/$escaped_built_list/g;\
s/@FJCONFIG@/$escaped_fjconfig/g;\
- s,@PREFIX@,${escaped_prefix},g;\
+ s/@PREFIX@/${escaped_prefix}/g;\
s/template gets processed/was generated automatically/;\
- s,@contrib_commandline@,$commandline,;\
+ s/@contrib_commandline@/$escaped_commandline/;\
s/any edits fit with the rest of the build system/you only edit Makefile.in/" Makefile.in > Makefile
-
#------------------------------------------------------------------------
# write output and config.log file
#------------------------------------------------------------------------
echo
echo "Configuring fjcontrib version" `cat VERSION`
echo
echo -e "Enabled contribs: "
for contrib in $built_contribs
do
# check if a contrib has an associated svn directory; if so include info about the svn repo
if [ -e $contrib/.svn ] ; then
svninfo="svn:"`svn info $contrib | grep '^ *URL' | sed -e 's/URL: //' -e 's/.*\/contribs\/'$contrib'\///'`""
else
svninfo=""
fi
printf " %-20s v%-15s $svninfo\n" $contrib `cat $contrib/VERSION`
done
echo
echo -e "Installation prefix: "$prefix
echo "--------------------------------------------------"
echo -e "Now run 'make', optionally 'make check', and 'make install'\n"
echo -e "This file was created by the fastjet contrib configure on "`date`"\n" > config.log
echo -e "The command line invocation was\n" >> config.log
echo -e " $0 $@\n" >> config.log
for contrib in $built_contribs
do
printf " %-20s v%s\n" $contrib `cat $contrib/VERSION` >> config.log
done
echo -e "Installation prefix: "$prefix"\n" >> config.log
Index: contrib/trunk/ChangeLog
===================================================================
--- contrib/trunk/ChangeLog (revision 310)
+++ contrib/trunk/ChangeLog (revision 311)
@@ -1,413 +1,422 @@
+2013-08-28 Matteo Cacciari <cacciari@lpthe.jussieu.fr>
+
+ * configure
+ fixed two bugs that were preventing specifying more than
+ one contrib with the --only and --exclude options. The issues
+ were a spurious "/" appearing in the replacement of commas with
+ blanks in the contribs list, and a non-escaped command-line
+ passed through sed when writing out the Makefile.
+
2013-08-27 Gregory Soyez <soyez@fastjet.fr>
* VERSION:
* NEWS:
released fjcontrib 1.006 including Nsubjettiness 1.0.3
* contribs.svn:
switched NSubjetiness to version 1.0.3
2013-08-13 Gavin Salam <gavin.salam@cern.ch>
* configure:
identification of svn info fixed to work also with svn 1.8 (that
version prints an absolute and relative URL, and configure was
picking up both; now it picks up just the absolute URL).
* scripts/internal/release-fjcontrib.sh:
hopefully fixed bug where tagging comment didn't have version
number (but '$version')
2013-07-24 Gavin Salam <gavin.salam@cern.ch>
* DEVEL-GUIDELINES:
mentioned that authors can ask for input from fjcontrib
maintainers before making a release
2013-06-04 Gavin Salam <gavin.salam@cern.ch>
* configure:
improved error message when fastjet-config not found
2013-06-04 Gavin Salam <gavin.salam@cern.ch>
* NEWS:
* VERSION:
released version 1.005, which adds ScJet 1.1.0
2013-06-03 Gavin Salam <gavin.salam@cern.ch>
* contribs.svn:
added ScJet 1.1.0 from Jeff Tseng
2013-05-28 Gavin Salam <gavin.salam@cern.ch>
* NEWS:
* VERSION:
release of version 1.004
* contribs.svn:
switched GenericSubtractor to version 1.2.0
2013-05-22 Gavin Salam <gavin.salam@cern.ch>
* configure:
for contribs obtained through an svn checkout (e.g. for
developers), it now supplements version info from the
ContribName/VERSION file with info about the svn location.
2013-05-07 Matteo Cacciari <cacciari@lpthe.jussieu.fr>
* scripts/internal/common.sh:
further replacement [ \t] -> [[:space:]] for the fix
mentioned below, since the first one fails to recognize tabs
(only blanks worked)
2013-05-01 Gavin Salam <gavin.salam@cern.ch>
* NEWS:
* VERSION:
release of 1.003
* contribs.svn:
changed version of EnergyCorrelator to 1.0.1
* scripts/internal/common.sh:
implemented suggested fix by J. Thaler for issue of
already-checked out contribs not being recognized on some
systems.
2013-04-30 Gavin Salam <gavin.salam@cern.ch>
* contribs.svn:
put in EnergyCorrelator 1.0.0
2013-04-29 Gregory Soyez <soyez@fastjet.fr> + Matteo
* scripts/update-contribs.sh:
reworded comments at the top of the script to reflect the changes
made with 'contribs.local'
2013-04-28 Matteo Cacciari <cacciari@lpthe.jussieu.fr> + Gregory
* scripts/update-contribs.sh
* scripts/internal/common.sh
* contribs.svn
replaced contribs.local with local_svn to avoid confusion with
the name of the file that will eventually be used to contain
local modifications to contribs.svn.
Fixed a regular expression in grep (allowing for mixture of spaces
and tabs before the contrib name)
Also reworded some comments.
Added support for a contribs.local overriding default entries in
contribs.svn. Added option to skip processing of a specific
contribution by scripts/update-contribs.sh, by replacing version
number with any number of dashes.
2013-04-27 Matteo Cacciari <cacciari@lpthe.jussieu.fr>
* utils/check.sh
Fixed a few typos in comments
2013-04-12 Gregory Soyez <soyez@fastjet.fr>
* NEWS:
* VERSION:
prepared for 1.002 release
* contribs.svn:
GenericSubtractor switched to version 1.1.0 (was 1.0.0)
2013-02-23 Gavin Salam <gavin.salam@cern.ch>
* NEWS:
* VERSION:
prepared for 1.001 release
* contribs.svn:
added VariableR 1.0.1 and Nsubjettiness 1.0.2 (from Jesse Thaler)
* configure:
now outputs version of each contrib (+ other small formatting)
* Makefile.in:
distclean now removes Makefile and .Makefile.inc
2013-02-22 Gavin Salam <gavin.salam@cern.ch>
* utils/check.sh:
now prints out the directory that it's running in
2013-02-21 Matteo Cacciari <cacciari@lpthe.jussieu.fr>
* DEVEL-GUIDELINES:
Rephrased sentence about registering a new contrib and the note
note about retrieving a registered contrib using
scripts/update-contribs.sh ContribName trunk"
2013-02-21 Gregory Soyez <soyez@fastjet.fr>
* scripts/internal/Template/Makefile:
added missing ; in make install
2013-02-21 Gavin Salam <gavin.salam@cern.ch>
* DEVEL-GUIDELINES:
added info on use of htpasswd to send us a password
* scripts/internal/common.sh (svn_write):
switched write URL from svn+ssh -> https
2013-02-21 Gavin Salam <gavin.salam@cern.ch>
* README:
fixed type for http checkout
2013-02-07 Matteo Cacciari <cacciari@lpthe.jussieu.fr>
* VERSION
Pushed version to 1.000 for release
* contribs.svn
set version numbers to 1.0.0 for both GenericSubtractor and
JetFFMoments
2013-02-06 Gavin SALAM <salam@lpthe.jussieu.fr> + Matteo
* scripts/internal/release-fjcontrib.sh:
a few fixes wrt paths for the tarball, info on release date,
parallel make, etc.
2013-02-06 Gavin SALAM <salam@tycho.lpthe.jussieu.fr> + Matteo
* scripts/update-contribs.sh:
now does "exit 1" if it couldn't find a given contrib version on
the svn.
* scripts/internal/release-fjcontrib.sh:
now allows user to carry on even if there are local modifications,
but with a warning.
* scripts/update-contribs.sh:
tried to make sure that failure of switch-to-contrib results in
failure of update-contribs too (important e.g. for release script)
* configure (makefileinc):
the .Makefile.inc file now has variables to override the install
and check scripts (intended to help possible future changes +
standalone functionality).
* scripts/internal/check.sh -> utils/check.sh
* scripts/internal/install-sh -> utils/install-sh
moved these into a separate directory so that in the tarball we
include utils, but can completely discard scripts/
* scripts/internal/Template/Makefile:
this has been updated to use scripts in utils/*
* scripts/internal/generate-html-contents.pl:
now includes a link to the directory for the contrib
* configure:
fixed bug in output of prefix to .Makefile.inc (wasn't being
output when it was derived from fastjet-config).
* contribs.svn:
JetFFMoments -> tags/0.99.1
* scripts/internal/release-fjcontrib.sh :
fixed typo in checking of existing version; before asking about a
release it now lists the contrib versions.
* VERSION
upped to 0.001 for more testing
2013-02-01 Gavin Salam <gavin.salam@cern.ch>
* contribs.svn:
GenericSubtractor -> 0.99.1
JetFFMoments -> 0.99
* configure:
* Makefile.in:
* scripts/internal/Template/Makefile:
variables are now communicated to sub-directory Makefiles via a
.Makefile.inc; trunks of JetFFMoments and GenericSubtractor also
modified.
* scripts/internal/release-fjcontrib.sh:
contents now lives in a separate directory
* scripts/update-contribs.sh:
no longer query if the contrib isn't yet there.
2013-02-01 Gregory Soyez <soyez@fastjet.fr>
* scripts/internal/package.sh: (well... mostly Matteo)
added a simple script to package a tarball
2013-01-31 Gregory Soyez <soyez@fastjet.fr>
* scripts/internal/release-fjcontrib.sh:
. removed unneeded developer and svn-users files from the
tarball
. fixed a few typos and trivial bugs
. check which fastjet-config to use when running tests
. the script now upload the tarball and the relevant info for
the webpage update
* scripts/internal/generate-html-contents.pl:
played with CSS styles so as to get a result that looks rather
close to what is on the FastJet tools page
* scripts/internal/common.sh:
* scripts/update-contribs.sh:
passed the default answer to get_yesno_answer as an argument
rather than a pre-defined variable
* scripts/internal/release-fjcontrib.sh:
added a script to release fj-contrib
it includes all the contrib in contribs.svn
* configure:
* README:
used --fastjet-config=... rather than --fjconfig=... to specify
the 'fastjet-config' file to use
* scripts/update-contribs.sh:
* scripts/internal/common.sh:
allowed to run
update-contribs.sh --force
which will answer yes to all "yesno" questions asked
* VERSION: *** ADDED ***
added a VERSION file
* scripts/internal/switch-to-version.sh:
* scripts/register-new-contrib.sh:
* scripts/new-contrib-from-template.sh:
* scripts/release-contrib.sh:
removed potential trailing /
2013-01-31 Gavin Salam <gavin.salam@cern.ch> + Gregory
* DEVEL-GUIDELINES: *** ADDED ***
* README
tried to make these a little more compact.
2013-01-31 Gregory Soyez <soyez@fastjet.fr>
* scripts/make-release.sh -> scripts/release-contrib.sh:
renamed for more consistency
* scripts/internal/switch-to-version.sh:
if the version starts with a digit, prefix it by "tags/"
* scripts/internal/install-sh:
added a script for installing files
* scripts/make-release.sh:
checked the full list of mandatory files when making a release
2013-01-31 Gavin Salam <gavin.salam@cern.ch>
* scripts/update-contribs.sh:
added -h option to update-contribs.sh
2013-01-31 Gregory Soyez <soyez@fastjet.fr>
* scripts/update-contribs.sh:
if the svn up updated the update-contribs.sh script, re-run with
the new version
* AUTHORS: *** ADDED ***
* COPYING: *** ADDED ***
* scripts.internal/Template/COPYING:
put this under GPLv2 and added the list of people maintaining the
FastJet-contrib
* README:
mentioned new-contrib-from-template.sh instead of
new-contrib-template.sh
* scripts/internal/check.sh:
checked that the expected output contains more than comments and
empty lines
2013-01-31 Gavin SALAM <gavin.salam@cern.ch> + Matteo + Gregory
* scripts/internal/Template/example.ref *** ADDED ***
added a template reference output file for make check with
instruction on what to do with it.
* scripts/new-contrib-template.sh -> scripts/new-contrib-from-template.sh
a more meaningful name.
2013-01-31 Gregory Soyez <soyez@fastjet.fr>
* scripts/internal/check.sh:
default extension for expected output set to "ref"
* scripts/internal/Template/example.cc:
added missing header
* scripts/internal/Template/Makefile
* scripts/internal/check.sh:
fixed some bash typos
* scripts/switch-to-version.sh: *** DELETED ***
* scripts/internal/switch-to-version.sh: *** ADDED ***
* scripts/update-contribs.sh:
moved switch-to version in internal/
* scripts/new-contrib-template.sh: *** ADDED ***
* scripts/internal/Template: *** ADDED ***
added a template to create a new contrib and is associated script
* scripts/TODO:
updated to reflect altest changes
2013-01-30 Gregory Soyez <soyez@fastjet.fr>
* scripts/switch-to-version.sh:
* scripts/update-contribs.sh:
if the versions agree, still run svn up
* scripts/internal/common.sh:
make sure the full contrib name is specified
* scripts/update-contribs.sh:
when updating a specified contrib, ask for confirmation
* scripts/switch-to-version.sh:
- use svn switch --relocate since svn relocate is not available
with old svn version
- give a write access when checking out the trunk
* scripts/make-release.sh:
gave access to check_pending_modifications
* data/ *** ADDED ***
added common event files for make check purpose
* configure: *** ADDED ***
* Makefile.in: *** ADDED ***
added basic building mechanism
* scripts/update-contribs.sh:
allowed to run it with a contrib name and optional version
This is then equivalent to calling switch-to-version.sh
* scripts/update-contribs.sh:
added "Template" to the list of ignored directories
* scripts/* *** ADDED ***
* README *** ADDED ***
added a list of maintenance scripts (see README for details)
* contribs.svn *** ADDED ***
added an (empty) list of supported contribs
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Tue, Sep 30, 5:42 AM (1 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
6566248
Default Alt Text
(23 KB)
Attached To
Mode
rFASTJETSVN fastjetsvn
Attached
Detach File
Event Timeline
Log In to Comment