Commit 7e32541a authored by Hannes Mildner's avatar Hannes Mildner
Browse files

For MadGraph, use fastjet-config from fastjet installation, remove outdated custom config

parent e561d9b4
......@@ -850,15 +850,7 @@ def getMadGraphVersion():
def setupFastjet(isNLO, proc_dir=None):
mglog.info('Path to fastjet install dir:%s'%os.environ['FASTJETPATH'])
getfjconfig = subprocess.Popen(['get_files','-data','fastjet-config'])
getfjconfig.wait()
#Get custom fastjet-config
if not os.access(os.getcwd()+'/fastjet-config',os.X_OK):
mglog.error('Failed to get fastjet-config from MadGraphControl')
return 1
fastjetconfig = os.getcwd()+'/fastjet-config'
fastjetconfig = os.environ['FASTJETPATH']+'/bin/fastjet-config'
mglog.info('fastjet-config --version: %s'%str(subprocess.Popen([fastjetconfig, '--version'],stdout = subprocess.PIPE).stdout.read().strip()))
mglog.info('fastjet-config --prefix: %s'%str(subprocess.Popen([fastjetconfig, '--prefix'],stdout = subprocess.PIPE).stdout.read().strip()))
......
#!/bin/bash
#
# fastjet-config. Generated from fastjet-config.in by configure.
#
# This is the base script for retrieving all information
# regarding compiling and linking programs using FastJet.
# Run ./fastjet-config without arguments for usage details
#########################################################
# the list of plugins is dynamic so we need the following
# line to deal with the static lib link
#installationdir=/afs/.cern.ch/sw/lcg/experimental/fastjet/3.0.3/x86_64-slc6-gcc48-opt
#prefix=/afs/.cern.ch/sw/lcg/experimental/fastjet/3.0.3/x86_64-slc6-gcc48-opt
installationdir=$FASTJETPATH
prefix=$FASTJETPATH
exec_prefix=${prefix}
# 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()
{
if [ "xyes" == "xyes" ] ; then
cat 1>&2 <<EOF
This is FastJet 3.0.3 configuration tool.
Usage:
fastjet-config [--help] [--version] [--prefix] [--cxxflags] [--libs]
[--shared[=yes|no]] [--plugins[=yes|no]] [--rpath[=yes|no]] [--runpath]
[--list-plugins] [--config]
The arguments can be either queries (one must be present):
--help prints this message and exits
--version prints FastJet version and exits
--prefix gets the FastJet installation directory
--cxxflags returns the compilation flags to be used with C++ programs
--libs returns the flags to pass to the linker
or flags (optional):
--shared controls whether you want to use the static or shared lib
(default=yes)
--plugins controls whether you also want to link the FastJet plugins
(default=no)
--rpath adds a -rpath argument at link-time that points to the
directory where FastJet libraries are installed. This
avoid having to set LD_LIBRARY_PATH at runtime when
using shared libs in a non standard location (but may
cause the program to inadvertently pick up other shared
libraries that happen to be in the FastJet installation
directory).
(default=yes)
--runpath at link-time, adds info about the directory where FastJet
libraries are installed to the runpath (ELF systens
only). This avoids having to set LD_LIBRARY_PATH at
runtime when using shared libs in a non standard
location but gives priority to an existing LD_LIBRARY_PATH.
--list-plugins list all the available plugins
--config shows a summary of how FastJet was configured
EOF
else
cat 1>&2 <<EOF
This is FastJet 3.0.3 configuration tool.
Usage:
fastjet-config [--help] [--version] [--prefix] [--cxxflags] [--libs]
[--plugins[=yes|no]] [--list-plugins] [--config]
The arguments can be either queries (one must be present):
--help prints this message and exits
--version prints FastJet version and exits
--prefix get the FastJet installation directory
--cxxflags returns the compilation flags to be used with C++ programs
--libs returns the flags to pass to the linker
or flags (optional):
--plugins controls whether you also want to link the FastJet plugins
(default=no)
--list-plugins list all the available plugins
--config shows a summary of how FastJet was configured
EOF
fi
exit $1
}
# first deal with the case where no argument is passed
[ $# -gt 0 ] || usage 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
}
# useful utilities
##################
# wite error messages and exit
write_error()
{
echo "Error: $1"
echo "Use fastjet-config --help for more information"
exit 1
}
# browse the argument list
# This is done the following way:
# - at first pass, we check if the --help argument is set. If yes,
# print usage and exit.
# we also and make sure that there is no interference between the
# arguments (e.g. --cflags --libs is wrong)
# - we then check for extra arguments and return the requested info
#####################################################################
# useful lists of arguments
arg_query_list="version prefix list_plugins config help" # cxxflags libs
arg_yesno_list="shared plugins rpath"
# default behaviour for parameters
plugins_included="no"
use_shared="yes"
add_rpath="yes"
add_runpath="no"
# no query found initially
found_query="no"
found_flags="no"
found_libs="no"
# browse arguments
for arg do
case "$arg" in
--help|-h)
usage 0
;;
--*=*)
arg_name=`option_name $arg`
arg_value=`option_value $arg`
# check the validity of the parmeter value
if ! is_in_list $arg_value yes no ; then
write_error "$arg: parameter value must be yes or no"
fi
# set the parameter value
case $arg_name in
plugins)
plugins_included="$arg_value"
;;
shared)
use_shared="$arg_value"
if [ "x$arg_value" == "xno" ] ; then
add_rpath="no"
fi
;;
rpath)
if test "xyes" = "xyes" ; then
add_rpath="$arg_value"
else
write_error "--rpath is only available together with shared libraries"
fi
;;
*)
write_error "$arg: unrecognised argument"
;;
esac
;;
--cxxflags)
# we've found a query, make sure we don't already have one
# except if it is --libs
if [[ "x$found_query" != "xno" && "x$found_query" != "xlibs" ]]; then
write_error "--cxxflags cannot be used with --$found_query"
fi
# update found_query
# note: for the "big case" later, don't overwrite it if libs are already asked for
found_flags="yes"
if [ "x$found_query" != "xlibs" ]; then
found_query="cxxflags"
fi
;;
--libs)
# we've found a query, make sure we don't already have one
# except if it is --cxxflags
if [[ "x$found_query" != "xno" && "x$found_query" != "xcxxflags" ]]; then
write_error "--libs cannot be used with --$found_query"
fi
# update found_query
found_libs="yes"
found_query="libs"
;;
--*)
arg_name=`option_name $arg`
if is_in_list $arg_name $arg_query_list ; then
# we've found a query, make sure we don't already have one
if [ "x$found_flags" != "xno" ] ; then
write_error "--$arg_name cannot be used with --cxxflags"
fi
if [ "x$found_libs" != "xno" ] ; then
write_error "--$arg_name cannot be used with --libs"
fi
if [ "x$found_query" != "xno" ] ; then
write_error "You can only make one query at a time"
fi
found_query="$arg_name"
else
if is_in_list $arg_name $arg_yesno_list ; then
# we've found a parameter, set it to "yes"
case $arg_name in
plugins)
plugins_included="yes"
;;
shared)
use_shared="yes"
;;
rpath)
if test "xyes" = "xyes" ; then
add_rpath="yes"
else
write_error "--rpath is only available together with shared libraries"
fi
;;
*)
write_error "$arg: unrecognised argument"
;;
esac
else
case $arg_name in
runpath)
if test "xyes" = "xyes" ; then
if test "xyes" = "xyes" ; then
add_runpath="yes"
add_rpath="no"
else
write_error "--runpath is not available on this platform"
fi
else
write_error "--runpath is only available together with shared libraries"
fi
;;
*)
write_error "$arg: unrecognised argument"
;;
esac
fi
fi
;;
*)
write_error "$arg is not a valid argument"
;;
esac
done
# now deal with the output
case $found_query in
no)
write_error "you must at least specify one query in '$arg_query_list'"
;;
version)
echo 3.0.3
;;
prefix)
#echo /afs/.cern.ch/sw/lcg/experimental/fastjet/3.0.3/x86_64-slc6-gcc48-opt
echo $FASTJETPATH
;;
cxxflags)
echo -I${prefix}/include
;;
libs)
libs_string=" -lm "
# since we use the system default (use shared lib if available, static
# otherwise), we only need to worry if shared available and static
# explicitely asked
if test "x$use_shared" = "xno" && test "xyes" = "xyes" ; then
libs_string=$libs_string" ${exec_prefix}/lib/libfastjettools.a ${exec_prefix}/lib/libfastjet.a"
else
libs_string=$libs_string" -L${exec_prefix}/lib -lfastjettools -lfastjet"
fi
if test "x$add_rpath" = "xyes" ; then
libs_string="-Wl,-rpath,${exec_prefix}/lib "$libs_string
else
# GPS 2009-05-29: remove any left over -Wl, e.g. related to CGAL.
libs_string=`echo $libs_string | sed 's/-Wl,-rpath[^ ]*//'`
fi
if test "x$add_runpath" = "xyes" ; then
libs_string="-Wl,--enable-new-dtags -Wl,-rpath,${exec_prefix}/lib "$libs_string
fi
if test "x$plugins_included" = "xyes" ; then
if test "x$use_shared" = "xno" && test "xyes" = "xyes" ; then
libs_string=$libs_string" ${installationdir}/lib/libfastjetplugins.a ${installationdir}/lib/libsiscone.a ${installationdir}/lib/libsiscone_spherical.a -L/afs/cern.ch/sw/lcg/contrib/gcc/4.8.0/x86_64-slc6-gcc48-opt/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0 -L/afs/cern.ch/sw/lcg/contrib/gcc/4.8.0/x86_64-slc6-gcc48-opt/bin/../lib/gcc -L/afs/cern.ch/sw/lcg/contrib/gcc/4.8.0/x86_64-slc6-gcc48-opt/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/afs/cern.ch/sw/lcg/contrib/gcc/4.8.0/x86_64-slc6-gcc48-opt/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../.. -lgfortran -lm -lquadmath"
else
libs_string=$libs_string" -lfastjetplugins -lsiscone_spherical -lsiscone -L/afs/cern.ch/sw/lcg/contrib/gcc/4.8.0/x86_64-slc6-gcc48-opt/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0 -L/afs/cern.ch/sw/lcg/contrib/gcc/4.8.0/x86_64-slc6-gcc48-opt/bin/../lib/gcc -L/afs/cern.ch/sw/lcg/contrib/gcc/4.8.0/x86_64-slc6-gcc48-opt/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/afs/cern.ch/sw/lcg/contrib/gcc/4.8.0/x86_64-slc6-gcc48-opt/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../.. -lgfortran -lm -lquadmath"
fi
fi
if [ "x$found_flags" = "xyes" ] ; then
echo -I${prefix}/include $libs_string
else
echo $libs_string
fi
;;
list_plugins)
echo "Available plugins: "
echo -n " "
echo SISCone CDFCones PxCone D0RunIICone NestedDefs TrackJet ATLASCone CMSIterativeCone EECambridge Jade D0RunICone GridJet | sed -e "s/ /\\`printf '\n\r '`/g"
;;
config)
echo "This is FastJet version 3.0.3"
echo ""
echo "Configuration invocation was"
echo ""
echo " /build/hegner/afs_build/lcgcmake-build/externals/fastjet/src/fastjet/3.0.3/configure '--prefix=/afs/.cern.ch/sw/lcg/experimental/fastjet/3.0.3/x86_64-slc6-gcc48-opt' '--enable-shared' '--enable-allplugins'"
echo ""
printf "Configuration summary:\n----------------------\n Installation directory /afs/.cern.ch/sw/lcg/experimental/fastjet/3.0.3/x86_64-slc6-gcc48-opt\n Shared libraries yes\n Static libraries yes\n Debug flag yes\n CGAL support no\n Plugins: EECambridge yes\n Jade yes\n NestedDefs yes\n SISCone yes\n CDFCones yes\n D0RunICone yes\n D0RunIICone yes\n ATLASCone yes\n CMSIterativeCone yes\n PxCone yes\n TrackJet yes\n GridJet yes\n Monolithic plugins lib yes\n"
;;
esac
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment