Skip to content

Commit

Permalink
fix madgraph5amcatnlo to use externals from cms
Browse files Browse the repository at this point in the history
  • Loading branch information
smuzaffar committed May 16, 2018
1 parent fa22d45 commit 1dc9496
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 36 deletions.
39 changes: 18 additions & 21 deletions madgraph5amcatnlo-config.patch
@@ -1,5 +1,7 @@
--- MG5_aMC_v2_5_5/input/mg5_configuration.txt 2017-05-26 09:49:49.000000000 +0200
+++ MG5_aMC_v2_5_5/mg5_configuration.txt 2017-10-13 16:48:40.105387446 +0200
diff --git a/input/mg5_configuration.txt b/input/mg5_configuration.txt
index c089808..f6b983f 100644
--- a/input/mg5_configuration.txt
+++ b/input/mg5_configuration.txt
@@ -28,14 +28,14 @@
#! Prefered Fortran Compiler
#! If None: try to find g77 or gfortran on the system
Expand Down Expand Up @@ -29,28 +31,26 @@
#! on containing the lib, bin and include directories) .
#! If using a relative path, that starts from the mg5 directory
-# pythia8_path = ./HEPTools/pythia8
+pythia8_path = $PYTHIA8_ROOT
+pythia8_path = ${PYTHIA8_ROOT}

#! MG5aMC_PY8_interface path
#! Defines the path of the C++ driver file that is used by MG5_aMC to
#! steer the Pythia8 shower.
#! Can be installed directly from within MG5_aMC with the following command:
#! MG5_aMC> install mg5amc_py8_interface
-# mg5amc_py8_interface_path = ./HEPTools/MG5aMC_PY8_interface
+mg5amc_py8_interface_path = $MADGRAPH5AMCATNLO_ROOT/HEPTools/MG5aMC_PY8_interface
+mg5amc_py8_interface_path = @MADGRAPH5AMCATNLO_ROOT@/HEPTools/MG5aMC_PY8_interface

#! Herwig++/Herwig7 paths
#! specify here the paths also to HepMC ant ThePEG
@@ -75,14 +75,14 @@
#! WARNING: if Herwig7 has been installed with the bootstrap script,
@@ -76,13 +76,13 @@
#! then please set thepeg_path and hepmc_path to the same value as
#! hwpp_path
-# hwpp_path =
# hwpp_path =
-# thepeg_path =
-# hepmc_path =
+hwpp_path = $HERWIGPP_ROOT
+thepeg_path = $THEPEG_ROOT
+hepmc_path = $HEPMC_ROOT
+thepeg_path = ${THEPEG_ROOT}
+hepmc_path = ${HEPMC_ROOT}

#! Control when MG5 checks if he is up-to-date.
#! Enter the number of day between two check (0 means never)
Expand Down Expand Up @@ -84,7 +84,7 @@
-# cluster_size = 150
+cluster_type = lsf
+cluster_queue = 1nh
+cluster_size = 150
+cluster_size = 150

#! Path to a node directory to avoid direct writing on the central disk
#! Note that condor clusters avoid direct writing by default (therefore this
Expand All @@ -111,39 +111,36 @@

#! MCatNLO-utilities
#! relative path starting from main directory
@@ -178,15 +177,15 @@
@@ -178,14 +177,14 @@
#! if auto: try to find it automatically on the system (default)
#! if '' or None: disabling pjfry
#! if pjfry=/PATH/TO/pjfry/lib: use that specific installation path for PJFry++
-# pjfry = auto
-
+pjfry = None #
+
+pjfry = None #

#! Set the Golem95 directory containing golem's library
#! It only supports version higher than 1.3.0
#! if auto: try to find it automatically on the system (default)
#! if '' or None: disabling Golem95
#! if golem=/PATH/TO/golem/lib: use that speficif installation path for Golem95
-# golem = auto
-
+golem = ${GOSAMCONTRIB_PATH}/lib #
+
+golem = ${GOSAMCONTRIB_ROOT}/lib #

#! Set the samurai directory containing samurai's library
#! It only supports version higher than 2.0.0
#! if auto: try to find it automatically on the system (default)
@@ -197,19 +196,19 @@
#! Set the Ninja directory containing ninja's library
#! if '' or None: disabling ninja
#! if ninja=/PATH/TO/ninja/lib: use that specific installation path for ninja
-# ninja = ./HEPTools/lib
+ninja = ${MADGRAPH5AMCATNLO_ROOT}/HEPTools/lib
+ninja = @MADGRAPH5AMCATNLO_ROOT@/HEPTools/lib

#! Set the COLLIER directory containing COLLIER's library
#! if '' or None: disabling COLLIER
#! if ninja=/PATH/TO/ninja/lib: use that specific installation path for COLLIER
# Note that it is necessary that you have generated a static library for COLLIER
-# collier = ./HEPTools/lib
+collier = ${MADGRAPH5AMCATNLO_ROOT}/HEPTools/lib
+collier = @MADGRAPH5AMCATNLO_ROOT@/HEPTools/lib

#! Set how MadLoop dependencies (such as CutTools) should be handled
#! > external : ML5 places a link to the MG5_aMC-wide libraries
Expand Down
24 changes: 9 additions & 15 deletions madgraph5amcatnlo.spec
Expand Up @@ -17,15 +17,21 @@ Requires: lhapdf
Requires: gosamcontrib
Requires: fastjet
Requires: pythia8
Requires: thepeg

%prep
%setup -n MG5_aMC_v%{versiontag}

%patch0 -p1
%patch1 -p1

%build
sed -i -e "s|\${HEPMC_ROOT}|${HEPMC_ROOT}|g" input/mg5_configuration.txt
sed -i -e "s|\${PYTHIA8_ROOT}|${PYTHIA8_ROOT}|g" input/mg5_configuration.txt
sed -i -e "s|\${LHAPDF_ROOT}|${LHAPDF_ROOT}|g" input/mg5_configuration.txt
sed -i -e "s|\${FASTJET_ROOT}|${FASTJET_ROOT}|g" input/mg5_configuration.txt
sed -i -e "s|\${GOSAMCONTRIB_ROOT}|${GOSAMCONTRIB_ROOT}|g" input/mg5_configuration.txt
sed -i -e "s|\${THEPEG_ROOT}|${THEPEG_ROOT}|g" input/mg5_configuration.txt

%build
# Save patched config
cp input/mg5_configuration.txt input/mg5_configuration_patched.txt

Expand All @@ -48,28 +54,16 @@ set nevents 5
EOF
./bin/mg5_aMC ./basiceventgeneration.txt

# Remove folder of basic event generation
#rm -rf basiceventgeneration


# Remove all downloaded tgz files before building the package
find . -type f -name '*.tgz' -delete

%install
sed -i -e "s|@MADGRAPH5AMCATNLO_ROOT@|%{i}|g" input/mg5_configuration.txt
rsync -avh %{_builddir}/MG5_aMC_v%{versiontag}/ %{i}/
sed -ideleteme 's|#!.*/bin/python|#!/usr/bin/env python|' \
%{i}/Template/LO/bin/internal/addmasses_optional.py \
%{i}/madgraph/various/progressbar.py
find %{i} -name '*deleteme' -delete

sed -i -e "s|^lhapdf.*$|lhapdf = ${LHAPDF_ROOT}/bin/lhapdf-config #|g" %{i}/input/mg5_configuration.txt
sed -i -e "s|^fastjet.*$|fastjet = $FASTJET_ROOT/bin/fastjet-config #|g" %{i}/input/mg5_configuration.txt
sed -i -e "s|^golem.*$|golem = $GOSAMCONTRIB_ROOT/lib #|g" %{i}/input/mg5_configuration.txt
#sed -i -e "s|^ninja.*$|ninja = $NINJA_ROOT/lib #|g" %{i}/input/mg5_configuration.txt
#sed -i -e "s|^collier.*$|collier = $RPM_INSTALL_PREFIX/%{pkgrel}/HEPTools/lib #|g" %{i}/input/mg5_configuration.txt

%post
%{relocateConfig}input/mg5_configuration.txt
MG5_INSTALL_PATH=$RPM_INSTALL_PREFIX/%{pkgrel}
sed -i -e "s|^collier.*$|collier = $MG5_INSTALL_PATH/HEPTools/lib #|g" $RPM_INSTALL_PREFIX/%{pkgrel}/input/mg5_configuration.txt
sed -i -e "s|^ninja.*$|ninja = $MG5_INSTALL_PATH/HEPTools/lib #|g" $RPM_INSTALL_PREFIX/%{pkgrel}/input/mg5_configuration.txt

0 comments on commit 1dc9496

Please sign in to comment.