diff --git a/bin/rivet-buildplugin.in b/bin/rivet-buildplugin.in --- a/bin/rivet-buildplugin.in +++ b/bin/rivet-buildplugin.in @@ -1,302 +1,302 @@ #!/usr/bin/env bash ## -*- sh -*- ## @configure_input@ ## Get program name PROG=$(basename $0) ## 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] can be a path, provided the filename is of the form 'Rivet*.so' If 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 -j NUM number of parallel compile jobs [$num_jobs] -r | --with-root: add ROOT link options (requires root-config on system) -n | --cmd | --dry-run: just print the generated commands, do not execute -k | --keep: keep intermediate files -v | --verbose: write out debug info EOF } ################## ## Option handling # http://www.bahmanm.com/blogs/command-line-options-how-to-parse-in-bash-using-getopt ## Translate long options to short # https://stackoverflow.com/a/5255468 args=() for arg do case "$arg" in # translate our long options --help ) args+=("-h");; --with-root ) args+=("-r");; --cmd | --dry-run ) args+=("-n");; --keep ) args+=("-k");; --verbose ) args+=("-v");; # pass through anything else * ) args+=("$arg");; esac done ## Reset the translated args set -- "${args[@]}" ## Now we can process with getopt while getopts ":hj:rnkv" opt; do case $opt in h) usage; exit 0 ;; j) num_jobs=$OPTARG ;; r) with_root=yes ;; n) only_show=yes ;; k) keep_tmps=yes ;; v) debug=yes ;; \?) echo "Unknown option -$OPTARG" >&2; exit 1 ;; :) echo "Option -$OPTARG requires an argument" >&2; exit 1 ;; esac done ## Remove options shift $((OPTIND-1)) ## Check num_jobs is a number if [[ ! $num_jobs -eq $num_jobs ]]; then echo "Unknown argument to -j" >&2; exit 1 fi if [[ $num_jobs -lt 1 ]]; then echo "Number of jobs must be positive" >&2; exit 1 fi #echo "$with_root" #echo "$only_show" #echo "$@" ## Need some args left at this point if [[ $# -lt 1 ]]; then usage >&2 exit 1 fi ## Get and check the target library name libname="$1" match1=$(basename "$libname" | egrep '^.*\.so') match2=$(basename "$libname" | egrep '^Rivet.*\.so') if test -n "$match1"; then if test -z "$match2"; then echo "Library name '$libname' does not have the required 'Rivet*.so' name pattern" >&2 exit 1 fi ## If we're using the first arg as the library name, shift it off the positional list shift else if [[ -z $only_show ]]; then echo "Using default library name 'RivetAnalysis.so'" fi libname="RivetAnalysis.so" fi ## Again need some args left at this point if [[ $# -lt 1 ]]; then usage >&2 exit 1 fi ################## ## Now assemble the build flags ## These variables need to exist, may be used in later substitutions ## Note no use of $DESTDIR... we ignore it so that destdir can be used ## for temp installs later copied to / prefix="@prefix@" exec_prefix="@exec_prefix@" datarootdir="@datarootdir@" ## Work out shared library build flags by platform if [[ $(uname) == "Darwin" ]]; then ## Mac OS X shared_flags="-undefined dynamic_lookup -bundle" else ## Unix shared_flags="-shared -fPIC" fi ## Get Rivet system C++ compiler (fall back to $CXX and then g++ if needed) mycxx=g++ rivetcxx=$(which $(echo "@RIVETCXX@" | awk '{print $1}') 2> /dev/null) abscxx=$(which "$CXX" 2> /dev/null) if [[ -x "$rivetcxx" ]]; then mycxx="@CXX@" elif [[ -x "$abscxx" ]]; then mycxx="$CXX" fi ## Get Rivet system C++ compiler flags if [[ -n "@AM_CXXFLAGS@" ]]; then mycxxflags="@AM_CXXFLAGS@" fi if [[ -n "@RIVETCXXFLAGS@" ]]; then mycxxflags="$mycxxflags @RIVETCXXFLAGS@" fi ## Get Rivet system C preprocessor flags (duplicating that in rivet-config.in) if [[ -n "$RIVET_BUILDPLUGIN_BEFORE_INSTALL" ]]; then irivet="@top_srcdir@/include" else irivet="@includedir@" fi test -n "$irivet" && mycppflags="$mycppflags -I${irivet}" @ENABLE_HEPMC_3_TRUE@ihepmc_1="@HEPMC3INCPATH@ @CPPFLAGS@" @ENABLE_HEPMC_3_FALSE@ihepmc_2="@HEPMCINCPATH@" test -n "$ihepmc_1" && mycppflags="$mycppflags -I${ihepmc_1}" test -n "$ihepmc_2" && mycppflags="$mycppflags -I${ihepmc_2}" iyoda="@YODAINCPATH@" test -n "$iyoda" && mycppflags="$mycppflags -I${iyoda}" ifastjet="@FASTJETINCPATH@" test -n "$ifastjet" && mycppflags="$mycppflags -I${ifastjet}" ## Get Rivet system linker flags (duplicating that in rivet-config.in) myldflags="" if [[ -n "$RIVET_BUILDPLUGIN_BEFORE_INSTALL" ]]; then lrivet="@top_builddir@/src/.libs" else lrivet="@libdir@" fi test -n "$lrivet" && myldflags="$myldflags -L${lrivet}" @ENABLE_HEPMC_3_TRUE@lhepmc_1="@HEPMC3LIBPATH@" @ENABLE_HEPMC_3_FALSE@lhepmc_2="@HEPMCLIBPATH@" test -n "$lhepmc_1" && myldflags="$myldflags -L${lhepmc_1}" test -n "$lhepmc_2" && myldflags="$myldflags -L${lhepmc_2}" lyoda="@YODALIBPATH@" test -n "$lyoda" && myldflags="$myldflags -L${lyoda}" -lfastjet="@FASTJETCONFIGLIBADD@" +lfastjet="@FASTJETLIBADD@" test -n "$lfastjet" && myldflags="$myldflags ${lfastjet}" ## Detect whether the linker accepts the --no-as-needed flag and prepend the linker flag with it if possible if (cd /tmp && echo -e 'int main() { return 0; }' > $$.cc; $mycxx -Wl,--no-as-needed $$.cc -o $$ 2> /dev/null); then myldflags="-Wl,--no-as-needed $myldflags" fi ## Get ROOT flags if needed if [[ -n $with_root ]]; then rootcxxflags=$(root-config --cflags 2> /dev/null) rootldflags=$(root-config --libs 2> /dev/null) fi ################## ## Assemble and run build machinery ## Split sources into buckets, one for each core let idx=1 sources="" for src in "$@" do if [[ -s "$src" ]]; then sources="$sources $src" buckets[$idx]="${buckets[$idx]} $src" let idx=(idx%$num_jobs)+1 else if [[ ${src:0:1} == "-" ]]; then ## Found a user option usercxxflags="$usercxxflags $src" else echo "Warning: $src not found" >&2 fi fi done ## May be less than num_jobs let num_buckets=${#buckets[@]} if [[ $num_buckets -lt 1 ]]; then echo "Error: no source files found" >&2 exit 2 fi ## Loop over buckets for idx in $(seq 1 $num_buckets); do # DO NOT SIMPLIFY, the OS X mktemp can't deal with suffixes directly tmpfile="$(mktemp tmp.XXXXXXXX)" mv "$tmpfile" "$tmpfile.cc" tmpfile="$tmpfile.cc" for i in $(echo ${buckets[$idx]}); do #< find the real way to do this! echo "#line 1 \"$i\"" >> "$tmpfile" cat "$i" >> "$tmpfile" done if [[ -s "$tmpfile" ]]; then srcnames[$idx]="$tmpfile" fi done objnames=("${srcnames[@]/.cc/.o}") if [[ -z "$debug" ]]; then silencer="@"; fi tmpmakefile=$(mktemp Makefile.tmp.XXXXXXXXXX) cat > "$tmpmakefile" <|-\') if test $# -eq 0 || test -n "$tmp"; then echo "rivet-config: configuration tool for the Rivet generator validation system" echo " http://projects.hepforge.org/rivet/" echo echo "Usage: $( basename $0 ) [--help|-h] | " echo " [--{prefix,datadir,libdir,includedir}] | " echo " [--{cppflags,ldflags,ldlibs}] | " echo " [--version]" echo "Options:" echo " --help | -h : show this help message" echo echo " --prefix : show the installation prefix (cf. autoconf)" echo " --includedir : show the path to the directory containing the Rivet headers" echo " --libdir : show the path to the directory containing the Rivet libraries" echo " --datadir : show the path to the directory containing Rivet data" echo " --pythonpath : show the path(s) to the directory containing Rivet's Python package" echo echo " --guess-prefix: try to use the runtime prefix, rather than that set at install-time" echo echo " --cxx : returns a compiler string matching that used to build Rivet" echo " --cflags|--cppflags : returns a Rivet '-I' string for insertion into CPPFLAGS" echo " --ldflags : returns a Rivet '-L' string for insertion into LDFLAGS" echo " --libs : returns a Rivet '-L/-l' string for insertion into LIBS or LIBADD" echo echo " --version : returns Rivet release version number" fi ## These variables need to exist ## Note no use of $DESTDIR... we ignore it so that destdir can be used ## for temp installs later copied to / tmp=$( echo "$*" | egrep -- '--\') if [[ -n "$tmp" ]]; then bindir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" prefix=$(dirname $bindir) exec_prefix=$prefix else prefix=@prefix@ exec_prefix=@exec_prefix@ fi datarootdir=@datarootdir@ OUT="" ## "Atomic" build info, for "roll your own build" obsessives tmp=$( echo "$*" | egrep -- '--\') test -n "$tmp" && OUT="$OUT @prefix@" tmp=$( echo "$*" | egrep -- '--\') test -n "$tmp" && OUT="$OUT @includedir@" tmp=$( echo "$*" | egrep -- '--\') test -n "$tmp" && OUT="$OUT @libdir@" tmp=$( echo "$*" | egrep -- '--\') test -n "$tmp" && OUT="$OUT @datadir@/@PACKAGE_TARNAME@" tmp=$( echo "$*" | egrep -- '--\') test -n "$tmp" && OUT="$OUT @RIVET_PYTHONPATH@" ## "Pre-rolled" build info tmp=$( echo "$*" | egrep -- '--\') test -n "$tmp" && OUT="$OUT @RIVETCXX@" tmp=$( echo "$*" | egrep -- '--\|--\') test -n "$tmp" && OUT="$OUT @RIVETCXXFLAGS@" tmp=$( echo "$*" | egrep -- '--\') if test -n "$tmp"; then irivet="@includedir@" test -n "$irivet" && OUT="$OUT -I${irivet}" ihepmc="@HEPMCINCPATH@" test -n "$ihepmc" && OUT="$OUT -I${ihepmc}" iyoda="@YODAINCPATH@" test -n "$iyoda" && OUT="$OUT -I${iyoda}" ifastjet="@FASTJETINCPATH@" test -n "$ifastjet" && OUT="$OUT -I${ifastjet}" fi tmp=$( echo "$*" | egrep -- '--\|--\') if test -n "$tmp"; then lrivet="@libdir@" test -n "$lrivet" && OUT="$OUT -L${lrivet}" lhepmc="@HEPMCLIBPATH@" test -n "$lhepmc" && OUT="$OUT -L${lhepmc} -lHepMC" lyoda="@YODALIBPATH@" test -n "$lyoda" && OUT="$OUT -L${lyoda} -lYODA" - lfastjet="@FASTJETCONFIGLIBADD@" + lfastjet="@FASTJETLIBADD@" test -n "$lfastjet" && OUT="$OUT ${lfastjet}" fi tmp=$( echo "$*" | egrep -- '--\|--\') test -n "$tmp" && OUT="$OUT -lRivet" ## Version tmp=$( echo "$*" | egrep -- '--\') test -n "$tmp" && echo @PACKAGE_VERSION@ && exit 0 echo $OUT diff --git a/configure.ac b/configure.ac --- a/configure.ac +++ b/configure.ac @@ -1,398 +1,419 @@ ## Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) AC_INIT([Rivet],[3.0.0],[rivet@projects.hepforge.org],[Rivet]) ## Check and block installation into the src/build dir if test "$prefix" = "$PWD"; then AC_MSG_ERROR([Installation into the build directory is not supported: use a different --prefix argument]) fi ## Force default prefix to have a path value rather than NONE if test "$prefix" = "NONE"; then prefix=/usr/local fi AC_CONFIG_SRCDIR([src/Core/Analysis.cc]) AC_CONFIG_HEADERS([include/Rivet/Config/DummyConfig.hh include/Rivet/Config/RivetConfig.hh]) AM_INIT_AUTOMAKE([dist-bzip2 -Wall 1.10]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) AC_CONFIG_MACRO_DIR([m4]) AC_SUBST(LT_OBJDIR) ## Package-specific #defines AC_DEFINE_UNQUOTED(RIVET_VERSION, "$PACKAGE_VERSION", "Rivet version string") AC_DEFINE_UNQUOTED(RIVET_NAME, "$PACKAGE_NAME", "Rivet name string") AC_DEFINE_UNQUOTED(RIVET_STRING, "$PACKAGE_STRING", "Rivet name and version string") AC_DEFINE_UNQUOTED(RIVET_TARNAME, "$PACKAGE_TARNAME", "Rivet short name string") AC_DEFINE_UNQUOTED(RIVET_BUGREPORT, "$PACKAGE_BUGREPORT", "Rivet contact email address") ## OS X AC_CEDAR_OSX ## Work out the LCG platform tag AC_LCG_TAG ## Set default compiler flags if test "x$CXXFLAGS" == "x"; then CXXFLAGS="-O2"; fi ## Compiler setup AC_LANG(C++) AC_PROG_CXX AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory]) ## Store and propagate the compiler identity and flags RIVETCXX="$CXX" AC_SUBST(RIVETCXX) RIVETCXXFLAGS="$CXXFLAGS" AC_SUBST(RIVETCXXFLAGS) ## Checks for programs. AC_PROG_INSTALL AC_PROG_LN_S AC_DISABLE_STATIC AC_LIBTOOL_DLOPEN AC_PROG_LIBTOOL AX_EXECINFO AC_FUNC_STRERROR_R ## YODA histogramming library AC_CEDAR_LIBRARYANDHEADERS([YODA], , , [AC_MSG_ERROR([YODA is required])]) YODABINPATH=$YODALIBPATH/../bin AC_SUBST(YODABINPATH) AC_PATH_PROG(YODACONFIG, yoda-config, [], [$YODALIBPATH/../bin:$PATH]) YODA_PYTHONPATH="" if test -f "$YODACONFIG"; then AC_MSG_CHECKING([YODA version using yoda-config]) YODA_VERSION=`$YODACONFIG --version` AC_MSG_RESULT([$YODA_VERSION]) YODA_VERSION1=[`echo $YODA_VERSION | cut -d. -f1 | sed -e 's/\([0-9]*\).*/\1/g'`] YODA_VERSION2=[`echo $YODA_VERSION | cut -d. -f2 | sed -e 's/\([0-9]*\).*/\1/g'`] YODA_VERSION3=[`echo $YODA_VERSION | cut -d. -f3 | sed -e 's/\([0-9]*\).*/\1/g'`] - let YODA_VERSION_INT=YODA_VERSION1*10000+YODA_VERSION2*100+YODA_VERSION3 + let YODA_VERSION_INT=YODA_VERSION1*10000+YODA_VERSION2*100+YODA_VERSION3 if test $YODA_VERSION_INT -lt 10704; then AC_MSG_ERROR([YODA version isn't sufficient: at least version 1.7.4 required]) fi AC_MSG_CHECKING([YODA Python path using yoda-config]) YODA_PYTHONPATH=`$YODACONFIG --pythonpath` AC_MSG_RESULT([$YODA_PYTHONPATH]) fi AC_SUBST(YODA_PYTHONPATH) ## HepMC event record library if test "${with_hepmc+set}" = set; then if test "${with_hepmc3+set}" = set; then AC_MSG_ERROR([HepMC2 *OR* HepMC3 is required. Both were specified!]) fi fi if test "${with_hepmc3+set}" = set; then AC_CEDAR_LIBRARYANDHEADERS([HepMC3], , [use_hepmc3=yes], [use_hepmc3=no]) AM_CONDITIONAL(WITH_HEPMC,false) AM_CONDITIONAL(WITH_HEPMCINC,false) AM_CONDITIONAL(WITH_HEPMCLIB,false) AM_CONDITIONAL(WITHOUT_HEPMC,true) AM_CONDITIONAL(WITHOUT_HEPMCINC,true) AM_CONDITIONAL(WITHOUT_HEPMCLIB,true) else AC_CEDAR_LIBRARYANDHEADERS([HepMC], , [use_hepmc2=yes], [use_hepmc2=no]) AM_CONDITIONAL(WITH_HEPMC3,false) AM_CONDITIONAL(WITH_HEPMC3INC,false) AM_CONDITIONAL(WITH_HEPMC3LIB,false) AM_CONDITIONAL(WITHOUT_HEPMC3,true) AM_CONDITIONAL(WITHOUT_HEPMC3INC,true) AM_CONDITIONAL(WITHOUT_HEPMC3LIB,true) fi if test x$use_hepmc2 = xno && test x$use_hepmc3 = xno ; then AC_MSG_ERROR([HepMC2 or HepMC3 is required]) fi if test x$use_hepmc2 = xyes; then oldCPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$HEPMCINCPATH" if test -e "$HEPMCINCPATH/HepMC/HepMCDefs.h"; then AC_LANG_CONFTEST([AC_LANG_SOURCE([#include #include "HepMC/HepMCDefs.h" int main() { std::cout << HEPMC_VERSION << std::endl; return 0; }])]) else AC_LANG_CONFTEST([AC_LANG_SOURCE([#include #include "HepMC/defs.h" int main() { std::cout << VERSION << std::endl; return 0; }])]) fi if test -f conftest.cc; then $CXX $CPPFLAGS conftest.cc -o conftest 2>&1 1>&5 elif test -f conftest.C; then $CXX $CPPFLAGS conftest.C -o conftest 2>&1 1>&5 else $CXX $CPPFLAGS conftest.cpp -o conftest 2>&1 1>&5 fi hepmc_version=`./conftest` if test x$hepmc_version != x; then let hepmc_major=`echo "$hepmc_version" | cut -d. -f1` let hepmc_minor=`echo "$hepmc_version" | cut -d. -f2` fi rm -f conftest conftest.cpp conftest.cc conftest.C HEPMC_VERSION=$hepmc_major$hepmc_minor AC_MSG_NOTICE([HepMC version is $hepmc_version -> $HEPMC_VERSION]) AC_SUBST(HEPMC_VERSION) CPPFLAGS=$oldCPPFLAGS else oldCPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$HEPMC3INCPATH" AC_LANG_CONFTEST([AC_LANG_SOURCE([#include #include "HepMC3/Version.h" int main() { std::cout << HepMC3::version() << std::endl; return 0; }])]) if test -f conftest.cc; then $CXX $CPPFLAGS conftest.cc -o conftest 2>&1 1>&5 elif test -f conftest.C; then $CXX $CPPFLAGS conftest.C -o conftest 2>&1 1>&5 else $CXX $CPPFLAGS conftest.cpp -o conftest 2>&1 1>&5 fi hepmc_version=`./conftest` if test x$hepmc_version != x; then let hepmc_major=`echo "$hepmc_version" | cut -d. -f1` let hepmc_minor=`echo "$hepmc_version" | cut -d. -f2` let hepmc_third=`echo "$hepmc_version" | cut -d. -f3` fi rm -f conftest conftest.cpp conftest.cc conftest.C HEPMC_VERSION=$hepmc_major$hepmc_minor$hepmc_third AC_MSG_NOTICE([HepMC version is $hepmc_version -> $HEPMC_VERSION]) if test $HEPMC_VERSION -le 310; then AC_MSG_ERROR([HepMC3 version 3.1.1 or later is required.]) fi - + AC_SUBST(HEPMC_VERSION) CPPFLAGS=$oldCPPFLAGS fi AM_CONDITIONAL([ENABLE_HEPMC_3], [test x$hepmc_major = x3]) AM_COND_IF([ENABLE_HEPMC_3],[CPPFLAGS="$CPPFLAGS -DENABLE_HEPMC_3=true"]) ## FastJet clustering library AC_CEDAR_LIBRARYANDHEADERS([fastjet], , , [AC_MSG_ERROR([FastJet is required])]) AC_PATH_PROG(FJCONFIG, fastjet-config, [], $FASTJETPATH/bin:$PATH) if test -f "$FJCONFIG"; then AC_MSG_CHECKING([FastJet version using fastjet-config]) fjversion=`$FJCONFIG --version` AC_MSG_RESULT([$fjversion]) fjmajor=$(echo $fjversion | cut -f1 -d.) fjminor=$(echo $fjversion | cut -f2 -d.) fjmicro=$(echo $fjversion | cut -f3 -d.) if test "$fjmajor" -lt 3; then AC_MSG_ERROR([FastJet version 3.0.0 or later is required]) fi - FASTJETCONFIGLIBADD="$($FJCONFIG --plugins --shared --libs) -lfastjetcontribfragile" + FASTJETLIBADD="$($FJCONFIG --plugins --shared --libs) -lfastjetcontribfragile" else - FASTJETCONFIGLIBADD="-L$FASTJETLIBPATH -l$FASTJETLIBNAME" - FASTJETCONFIGLIBADD="$FASTJETCONFIGLIBADD -lSISConePlugin -lsiscone -lsiscone_spherical" - FASTJETCONFIGLIBADD="$FASTJETCONFIGLIBADD -lCDFConesPlugin -lD0RunIIConePlugin -lNestedDefsPlugin" - FASTJETCONFIGLIBADD="$FASTJETCONFIGLIBADD -lTrackJetPlugin -lATLASConePlugin -lCMSIterativeConePlugin" - FASTJETCONFIGLIBADD="$FASTJETCONFIGLIBADD -lEECambridgePlugin -lJadePlugin" - FASTJETCONFIGLIBADD="$FASTJETCONFIGLIBADD -lfastjetcontribfragile" + FASTJETLIBADD="-L$FASTJETLIBPATH -l$FASTJETLIBNAME" + FASTJETLIBADD="$FASTJETLIBADD -lSISConePlugin -lsiscone -lsiscone_spherical" + FASTJETLIBADD="$FASTJETLIBADD -lCDFConesPlugin -lD0RunIIConePlugin -lNestedDefsPlugin" + FASTJETLIBADD="$FASTJETLIBADD -lTrackJetPlugin -lATLASConePlugin -lCMSIterativeConePlugin" + FASTJETLIBADD="$FASTJETLIBADD -lEECambridgePlugin -lJadePlugin" + FASTJETLIBADD="$FASTJETLIBADD -lfastjetcontribfragile" fi; -AC_MSG_NOTICE([FastJet LIBADD = $FASTJETCONFIGLIBADD]) -AC_SUBST(FASTJETCONFIGLIBADD) +AC_MSG_NOTICE([FastJet LIBADD = $FASTJETLIBADD]) +AC_SUBST(FASTJETLIBADD) # Check for FastJet headers that require the --enable-all(cxx)plugins option -FASTJET_ERRMSG="Required FastJet plugin headers were not found: did you build FastJet with the --enable-allcxxplugins option?" oldCPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$FASTJETINCPATH" +LDFLAGS="$CPPFLAGS -I$FASTJETINCPATH" +FASTJET_ERRMSG="Required FastJet plugin headers were not found: did you build FastJet with the --enable-allcxxplugins option?" AC_CHECK_HEADER([fastjet/D0RunIIConePlugin.hh], [], [AC_MSG_ERROR([$FASTJET_ERRMSG])]) AC_CHECK_HEADER([fastjet/TrackJetPlugin.hh], [], [AC_MSG_ERROR([$FASTJET_ERRMSG])]) +FASTJET_ERRMSG="Required FastJet Contrib headers were not found: did you install FastJet Contrib?" +AC_CHECK_HEADER([fastjet/contrib/SoftDrop.hh], [], [AC_MSG_ERROR([$FASTJET_ERRMSG])]) +AC_MSG_CHECKING([FastJet test program compilation]) +FASTJET_ERRMSG="Couldn't build FastJet test program: did you install FastJet Contrib with 'make fragile-shared-install'?" +AC_COMPILE_IFELSE([AC_LANG_SOURCE([#include + #include "fastjet/contrib/SoftDrop.hh" + int main() { + std::vector particles{{1,1,0,2}, {1,-1,0,2}}; + fastjet::ClusterSequence cs(particles, fastjet::JetDefinition(fastjet::antikt_algorithm, 0.4)); + fastjet::contrib::SoftDrop sd(0.5, 0.1); + for (const fastjet::PseudoJet& j : cs.inclusive_jets()) { + const fastjet::PseudoJet& jsd = sd(j); + } + return 0; + } + ])], + [AC_MSG_RESULT([successful])], + [AC_MSG_RESULT([failed]) + AC_MSG_ERROR([$FASTJET_ERRMSG])]) CPPFLAGS=$oldCPPFLAGS +LDFLAGS=$oldLDFLAGS # ## GNU Scientific Library # AC_SEARCH_GSL # AC_CEDAR_HEADERS([gsl], , , [AC_MSG_ERROR([GSL (GNU Scientific Library) is required])]) # oldCPPFLAGS=$CPPFLAGS # CPPFLAGS="$CPPFLAGS -I$GSLINCPATH" # AC_CHECK_HEADER([gsl/gsl_vector.h], [], [AC_MSG_ERROR([GSL vectors not found.])]) # CPPFLAGS=$oldCPPFLAGS ## Disable build/install of standard analyses AC_ARG_ENABLE([analyses], [AC_HELP_STRING(--disable-analyses, [don't try to build or install standard analyses])], [], [enable_analyses=yes]) if test x$enable_analyses != xyes; then AC_MSG_WARN([Not building standard Rivet analyses, by request]) fi AM_CONDITIONAL(ENABLE_ANALYSES, [test x$enable_analyses = xyes]) ## Build LaTeX docs if possible... AC_PATH_PROG(PDFLATEX, pdflatex) AM_CONDITIONAL(WITH_PDFLATEX, [test x$PDFLATEX != x]) ## ... unless told otherwise! AC_ARG_ENABLE([pdfmanual], [AC_HELP_STRING(--enable-pdfmanual, [build and install the manual])], [], [enable_pdfmanual=no]) if test x$enable_pdfmanual = xyes; then AC_MSG_WARN([Building Rivet manual, by request]) fi AM_CONDITIONAL(ENABLE_PDFMANUAL, [test x$enable_pdfmanual = xyes]) ## Build Doxygen documentation if possible AC_ARG_ENABLE([doxygen], [AC_HELP_STRING(--disable-doxygen, [don't try to make Doxygen documentation])], [], [enable_doxygen=yes]) if test x$enable_doxygen = xyes; then AC_PATH_PROG(DOXYGEN, doxygen) fi AM_CONDITIONAL(WITH_DOXYGEN, [test x$DOXYGEN != x]) ## Build asciidoc docs if possible AC_PATH_PROG(ASCIIDOC, asciidoc) AM_CONDITIONAL(WITH_ASCIIDOC, [test x$ASCIIDOC != x]) ## Python extension AC_ARG_ENABLE(pyext, [AC_HELP_STRING(--disable-pyext, [don't build Python module (default=build)])], [], [enable_pyext=yes]) ## Basic Python checks if test x$enable_pyext == xyes; then AX_PYTHON_DEVEL([>= '2.7.3']) AC_SUBST(PYTHON_VERSION) RIVET_PYTHONPATH=`$PYTHON -c "from __future__ import print_function; import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(prefix='$prefix', plat_specific=True));"` AC_SUBST(RIVET_PYTHONPATH) if test -z "$PYTHON"; then AC_MSG_ERROR([Can't build Python extension since python can't be found]) enable_pyext=no fi if test -z "$PYTHON_CPPFLAGS"; then AC_MSG_ERROR([Can't build Python extension since Python.h header file cannot be found]) enable_pyext=no fi fi AM_CONDITIONAL(ENABLE_PYEXT, [test x$enable_pyext == xyes]) dnl dnl setup.py puts its build artifacts into a labelled path dnl this helps the test scripts to find them locally instead of dnl having to install first dnl RIVET_SETUP_PY_PATH=$(${PYTHON} -c 'from __future__ import print_function; import distutils.util as u, sys; vi=sys.version_info; print("lib.%s-%s.%s" % (u.get_platform(),vi.major, vi.minor))') AC_SUBST(RIVET_SETUP_PY_PATH) ## Cython checks if test x$enable_pyext == xyes; then AM_CHECK_CYTHON([0.24.0], [:], [:]) if test x$CYTHON_FOUND = xyes; then AC_MSG_NOTICE([Cython >= 0.24 found: Python extension source can be rebuilt (for developers)]) fi AC_CHECK_FILE([pyext/rivet/core.cpp], [], [if test "x$CYTHON_FOUND" != "xyes"; then AC_MSG_ERROR([Cython is required for --enable-pyext, no pre-built core.cpp was found.]) fi]) cython_compiler=$CXX ## Set extra Python extension build flags (to cope with Cython output code oddities) PYEXT_CXXFLAGS="$CXXFLAGS" AC_CEDAR_CHECKCXXFLAG([-Wno-unused-but-set-variable], [PYEXT_CXXFLAGS="$PYEXT_CXXFLAGS -Wno-unused-but-set-variable"]) AC_CEDAR_CHECKCXXFLAG([-Wno-sign-compare], [PYEXT_CXXFLAGS="$PYEXT_CXXFLAGS -Wno-sign-compare"]) AC_SUBST(PYEXT_CXXFLAGS) AC_MSG_NOTICE([All Python build checks successful: 'rivet' Python extension will be built]) fi AM_CONDITIONAL(WITH_CYTHON, [test x$CYTHON_FOUND = xyes]) ## Set default build flags AM_CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include" #AM_CPPFLAGS="$AM_CPPFLAGS -I\$(top_srcdir)/include/eigen3" #AM_CPPFLAGS="$AM_CPPFLAGS \$(GSL_CPPFLAGS)" dnl AM_CPPFLAGS="$AM_CPPFLAGS \$(BOOST_CPPFLAGS)" AM_CPPFLAGS="$AM_CPPFLAGS -I\$(YODAINCPATH)" if test x$use_hepmc2 = xyes ; then AM_CPPFLAGS="$AM_CPPFLAGS -I\$(HEPMCINCPATH)" else AM_CPPFLAGS="$AM_CPPFLAGS -I\$(HEPMC3INCPATH)" fi AM_CPPFLAGS="$AM_CPPFLAGS -I\$(FASTJETINCPATH)" AC_CEDAR_CHECKCXXFLAG([-pedantic], [AM_CXXFLAGS="$AM_CXXFLAGS -pedantic"]) AC_CEDAR_CHECKCXXFLAG([-Wall], [AM_CXXFLAGS="$AM_CXXFLAGS -Wall"]) AC_CEDAR_CHECKCXXFLAG([-Wno-long-long], [AM_CXXFLAGS="$AM_CXXFLAGS -Wno-long-long"]) AC_CEDAR_CHECKCXXFLAG([-Wno-format], [AM_CXXFLAGS="$AM_CXXFLAGS -Wno-format"]) dnl AC_CEDAR_CHECKCXXFLAG([-Wno-unused-variable], [AM_CXXFLAGS="$AM_CXXFLAGS -Wno-unused-variable"]) AC_CEDAR_CHECKCXXFLAG([-Werror=uninitialized], [AM_CXXFLAGS="$AM_CXXFLAGS -Werror=uninitialized"]) AC_CEDAR_CHECKCXXFLAG([-Werror=delete-non-virtual-dtor], [AM_CXXFLAGS="$AM_CXXFLAGS -Werror=delete-non-virtual-dtor"]) ## Add OpenMP-enabling flags if possible AX_OPENMP([AM_CXXFLAGS="$AM_CXXFLAGS $OPENMP_CXXFLAGS"]) ## Optional zlib support for gzip-compressed data streams/files AX_CHECK_ZLIB ## Debug flag (default=-DNDEBUG, enabled=-g) AC_ARG_ENABLE([debug], [AC_HELP_STRING(--enable-debug, [build with debugging symbols @<:@default=no@:>@])], [], [enable_debug=no]) if test x$enable_debug == xyes; then AM_CXXFLAGS="$AM_CXXFLAGS -g" fi ## Extra warnings flag (default=none) AC_ARG_ENABLE([extra-warnings], [AC_HELP_STRING(--enable-extra-warnings, [build with extra compiler warnings (recommended for developers) @<:@default=no@:>@])], [], [enable_extra_warnings=no]) if test x$enable_extra_warnings == xyes; then AC_CEDAR_CHECKCXXFLAG([-Wextra], [AM_CXXFLAGS="$AM_CXXFLAGS -Wextra "]) fi AC_SUBST(AM_CPPFLAGS) AC_SUBST(AM_CXXFLAGS) AC_EMPTY_SUBST AC_CONFIG_FILES(Makefile Doxyfile) AC_CONFIG_FILES(include/Makefile include/Rivet/Makefile) AC_CONFIG_FILES(src/Makefile) AC_CONFIG_FILES(src/Core/Makefile src/Core/yamlcpp/Makefile) AC_CONFIG_FILES(src/Tools/Makefile) AC_CONFIG_FILES(src/Projections/Makefile) AC_CONFIG_FILES(src/AnalysisTools/Makefile) AC_CONFIG_FILES(analyses/Makefile) AC_CONFIG_FILES(test/Makefile) AC_CONFIG_FILES(pyext/Makefile pyext/rivet/Makefile pyext/setup.py) AC_CONFIG_FILES(data/Makefile data/texmf/Makefile) AC_CONFIG_FILES(doc/Makefile) AC_CONFIG_FILES(doc/rivetversion.sty) AC_CONFIG_FILES(bin/Makefile bin/rivet-config bin/rivet-buildplugin) AC_CONFIG_FILES(rivetenv.sh rivetenv.csh rivet.pc) AC_OUTPUT if test x$enable_pyrivet == xyes; then cat <