Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Herwig7 81x #2477

Merged
4 commits merged into from Sep 7, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
33 changes: 33 additions & 0 deletions herwigpp-missingBoostMTLib.patch
@@ -0,0 +1,33 @@
diff -Naur Herwig-7.0.0/m4/boost.m4 boost.m4
--- Herwig-7.0.0/m4/boost.m4 2015-07-08 13:52:11.770227514 +0100
+++ boost.m4 2015-08-17 10:13:36.115747311 +0100
@@ -372,8 +372,8 @@
AC_DEFUN([_BOOST_FIND_LIBS],
[Boost_lib=no
case "$3" in #(
- (mt | mt-) boost_mt=-mt; boost_rtopt=;; #(
- (mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X$3" : 'Xmt-*\(.*\)'`;; #(
+ (mt | mt-) boost_mt=; boost_rtopt=;; #(
+ (mt* | mt-*) boost_mt=; boost_rtopt=`expr "X$3" : 'X-*\(.*\)'`;; #(
(*) boost_mt=; boost_rtopt=$3;;
esac
if test $enable_static_boost = yes; then
@@ -388,7 +388,7 @@
esac
# If the PREFERRED-RT-OPT are not empty, prepend a `-'.
test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt"
- $boost_guess_use_mt && boost_mt=-mt
+ $boost_guess_use_mt && boost_mt=
# Look for the abs path the static archive.
# $libext is computed by Libtool but let's make sure it's non empty.
test -z "$libext" &&
@@ -423,7 +423,7 @@
for boost_lib_ in $2; do
for boost_tag_ in -$boost_cv_lib_tag ''; do
for boost_ver_ in -$boost_cv_lib_version ''; do
-for boost_mt_ in $boost_mt -mt ''; do
+for boost_mt_ in $boost_mt ''; do
for boost_rtopt_ in $boost_rtopt '' -d; do
for boost_lib in \
boost_$boost_lib_$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \

10 changes: 7 additions & 3 deletions herwigpp-toolfile.spec
Expand Up @@ -11,12 +11,16 @@ cat << \EOF_TOOLFILE >%i/etc/scram.d/herwigpp.xml
<tool name="herwigpp" version="@TOOL_VERSION@">
<client>
<environment name="HERWIGPP_BASE" default="@TOOL_ROOT@"/>
<environment name="LIBDIR" default="$HERWIGPP_BASE/lib"/>
<environment name="INCLUDE" default="$HERWIGPP_BASE/include"/>
<environment name="LIBDIR" default="$HERWIGPP_BASE/lib/Herwig7"/>
<environment name="INCLUDE" default="$HERWIGPP_BASE/include/Herwig7"/>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smuzaffar I am sorry it seems that I uploaded not the newest version of the tool file.

All parts with Herwig7 have to be changed to just Herwig as we found out in the old PR.



Sorry for the additional efforts required. If you want and have time this week I will buy you a beer at the CERN R1.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is your original commit where you had Herwig7. The fix is part of another commit. If you see the final changes (by going to File Changed tab then you will see the right path)

</client>
<runtime name="HERWIGPATH" value="$HERWIGPP_BASE/share/Herwig++"/>
<runtime name="HERWIGPATH" value="$HERWIGPP_BASE/share/Herwig7"/>
<runtime name="ROOT_INCLUDE_PATH" value="$INCLUDE" type="path"/>
<use name="root_cxxdefaults"/>
<use name="lhapdf"/>
<use name="thepeg"/>
<use name="madgraph5amcatnlo"/>
<use name="openloops"/>
</tool>
EOF_TOOLFILE

Expand Down
76 changes: 51 additions & 25 deletions herwigpp.spec
@@ -1,41 +1,67 @@
### RPM external herwigpp 2.7.1
Source: http://service-spi.web.cern.ch/service-spi/external/MCGenerators/distribution/herwig++/herwig++-%{realversion}-src.tgz
Requires: boost thepeg gsl hepmc
### RPM external herwigpp 7.0.2
Source: https://www.hepforge.org/archive/herwig/Herwig-%{realversion}.tar.bz2
#Source: https://mharrend.web.cern.ch/mharrend/herwig7/Herwig-7.0.2.tar.bz2

# Tried to comment out the parts which build HerwigDefaults.rpo during make install

Requires: lhapdf
Requires: boost
Requires: thepeg
Requires: gsl
Requires: hepmc
Requires: fastjet
Requires: madgraph5amcatnlo
Requires: openloops

# Patch since otherwise Boost wants multithreaded lib, even though only single-threaded lib is installed
# Problem exists since Herwig++3Beta

Patch0: herwigpp-missingBoostMTLib


BuildRequires: autotools
BuildRequires: lhapdf


%if "%{?cms_cxx:set}" != "set"
%define cms_cxx g++
%endif

%if "%{?cms_cxxflags:set}" != "set"
%define cms_cxxflags -O2 -std=c++0x
%endif

%prep
%setup -q -n herwig++/%{realversion}
%setup -q -n Herwig-%{realversion}

%patch0 -p1
# %patch1 -p1

# Regenerate build scripts
autoreconf -fiv

%build
# Update to detect aarch64 and ppc64le
rm -f ./Config/config.{sub,guess}
curl -L -k -s -o ./Config/config.sub 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'
curl -L -k -s -o ./Config/config.guess 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'
chmod +x ./Config/config.{sub,guess}
CXX="$(which %{cms_cxx}) -fPIC"
CC="$(which gcc) -fPIC"
PLATF_CONF_OPTS="--enable-shared --disable-static"

./configure \
--disable-silent-rules --with-gsl=$GSL_ROOT --with-thepeg=$THEPEG_ROOT --with-boost=${BOOST_ROOT} --prefix=%i \
CXXFLAGS="-fuse-cxa-atexit %cms_cxxflags" CXX="%cms_cxx"
./configure $PLATF_CONF_OPTS \
--with-thepeg=$THEPEG_ROOT \
--with-fastjet=$FASTJET_ROOT \
--with-gsl=$GSL_ROOT \
--with-boost=$BOOST_ROOT \
--with-madgraph=$MADGRAPH5AMCATNLO_ROOT \
--with-openloops=$OPENLOOPS_ROOT \
--prefix=%i \
CXX="$CXX" CC="$CC" \
BOOST_ROOT="$BOOST_ROOT" LDFLAGS="$LDFLAGS -L$BOOST_ROOT/lib" \
LD_LIBRARY_PATH=$LHAPDF_ROOT/lib:$GSL_ROOT/lib:$LD_LIBRARY_PATH


# Fix up a configuration mistake coming from a test being confused
# by the "skipping incompatible" linking messages when linking 32bit on 64bit
perl -p -i -e 's|/usr/lib64/libm.a /usr/lib64/libc.a||' Makefile
perl -p -i -e 's|/usr/lib64/libm.a /usr/lib64/libc.a||' */Makefile
perl -p -i -e 's|/usr/lib64/libm.a /usr/lib64/libc.a||' */*/Makefile
perl -p -i -e 's|/usr/lib64/libm.a /usr/lib64/libc.a||' */*/*/Makefile

make %makeprocesses
make %makeprocesses all LD_LIBRARY_PATH=$LHAPDF_ROOT/lib:$THEPEG_ROOT/lib/ThePEG:$GSL_ROOT/lib:$FASTJET_ROOT/lib:$BOOST_ROOT/lib:$LD_LIBRARY_PATH LIBRARY_PATH=$FASTJET_ROOT/lib

%install
#tar -c -h lib include | tar -x -C %i
make install
make install LD_LIBRARY_PATH=$LHAPDF_ROOT/lib:$THEPEG_ROOT/lib/ThePEG:$GSL_ROOT/lib:$FASTJET_ROOT/lib:$BOOST_ROOT/lib:$LD_LIBRARY_PATH LIBRARY_PATH=$FASTJET_ROOT/lib:$THEPEG_ROOT/lib/ThePEG:$LHAPDF_ROOT/lib LHAPDF_DATA_PATH=$LHAPDF_ROOT/share/LHAPDF



%post
%{relocateConfig}share/Herwig++/HerwigDefaults.rpo
%{relocateConfig}share/Herwig7/HerwigDefaults.rpo
10 changes: 9 additions & 1 deletion lhapdf.spec
Expand Up @@ -8,8 +8,10 @@ Source1: lhapdf_makeLinks
Source2: http://www.hepforge.org/archive/lhapdf/pdfsets/6.1/cteq6l1.tar.gz
Source3: http://www.hepforge.org/archive/lhapdf/pdfsets/6.1/CT10.tar.gz
Source4: http://www.hepforge.org/archive/lhapdf/pdfsets/6.1/MSTW2008nlo68cl.tar.gz
Source5: https://www.hepforge.org/archive/lhapdf/pdfsets/6.1/MMHT2014lo68cl.tar.gz
Source6: https://www.hepforge.org/archive/lhapdf/pdfsets/6.1/MMHT2014nlo68cl.tar.gz

Source5: lhapdf_pdfsetsindex
Source7: lhapdf_pdfsetsindex

Requires: boost yaml-cpp python cython

Expand Down Expand Up @@ -38,12 +40,18 @@ cd %{i}/share/LHAPDF
cp %{_sourcedir}/cteq6l1.tar.gz .
cp %{_sourcedir}/CT10.tar.gz .
cp %{_sourcedir}/MSTW2008nlo68cl.tar.gz .
cp %{_sourcedir}/MMHT2014lo68cl.tar.gz .
cp %{_sourcedir}/MMHT2014nlo68cl.tar.gz .
tar xvfz cteq6l1.tar.gz
tar xvfz CT10.tar.gz
tar xvfz MSTW2008nlo68cl.tar.gz
tar xvfz MMHT2014lo68cl.tar.gz
tar xvfz MMHT2014nlo68cl.tar.gz
rm -f cteq6l1.tar.gz
rm -f CT10.tar.gz
rm -f MSTW2008nlo68cl.tar.gz
rm -f MMHT2014lo68cl.tar.gz
rm -f MMHT2014nlo68cl.tar.gz
chmod a+x %{_sourcedir}/lhapdf_makeLinks
%{_sourcedir}/lhapdf_makeLinks %{setsversion}
rm -f pdfsets.index
Expand Down
20 changes: 12 additions & 8 deletions madgraph5amcatnlo.spec
@@ -1,6 +1,7 @@
### RPM external madgraph5amcatnlo 2.3.0.beta
%define versiontag 2_3_0_beta
Source: https://launchpad.net/mg5amcnlo/2.0/2.2.0/+download/MG5_aMC_v%{realversion}.tar.gz
### RPM external madgraph5amcatnlo 2.3.3
%define versiontag 2_3_3
Source: http://service-spi.web.cern.ch/service-spi/external/tarFiles/MCGeneratorsTarFiles/MG5_aMC_v%{realversion}.tar.gz
#Source: https://launchpad.net/mg5amcnlo/2.0/2.3.0/+download/MG5_aMC_v%{realversion}.tar.gz
Patch0: madgraph5amcatnlo-config
# Compile and install internal and external packages
Patch1: madgraph5amcatnlo-compile
Expand All @@ -20,16 +21,19 @@ Requires: lhapdf

%build

# Compile in advance

# There is a bug in two models which is fixed only in 2.3.1 version. Thus, remove models
rm -rf models/hgg_plugin models/SMScalars
# Save patched config
cp input/mg5_configuration.txt input/mg5_configuration_patched.txt

# Compile in advance
chmod +x bin/compile.py
./bin/compile.py
${PYTHON_ROOT}/bin/python ./bin/compile.py
# Remove compile script after compilation
rm bin/compile.py

# Add back patched config after compilation since its get overwritten
# Save patched config
mv input/mg5_configuration_patched.txt input/mg5_configuration.txt

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

Expand Down
3 changes: 2 additions & 1 deletion thepeg-toolfile.spec
Expand Up @@ -14,8 +14,9 @@ cat << \EOF_TOOLFILE >%i/etc/scram.d/thepeg.xml
<client>
<environment name="THEPEG_BASE" default="@TOOL_ROOT@"/>
<environment name="LIBDIR" default="$THEPEG_BASE/lib/ThePEG"/>
<environment name="INCLUDE" default="$THEPEG_BASE/include"/>
<environment name="INCLUDE" default="$THEPEG_BASE/include/ThePEG"/>
</client>
<runtime name="THEPEGPATH" value="$THEPEG_BASE/share/ThePEG"/>
<runtime name="ROOT_INCLUDE_PATH" value="$INCLUDE" type="path"/>
<use name="root_cxxdefaults"/>
<use name="lhapdf"/>
Expand Down
43 changes: 22 additions & 21 deletions thepeg.spec
@@ -1,29 +1,30 @@
### RPM external thepeg 1.9.2p1
### RPM external thepeg 2.0.2
## INITENV +PATH LD_LIBRARY_PATH %{i}/lib/ThePEG
## INITENV +PATH DYLD_LIBRARY_PATH %{i}/lib/ThePEG

%define tag 41e9a26f5ca9659e30e9c27e4dc86e65ecd4a4bd
%define branch cms/v%realversion
# Download from official webpage
Source: http://www.hepforge.org/archive/thepeg/ThePEG-%{realversion}.tar.bz2

Source: git+https://github.com/cms-externals/thepeg.git?obj=%{branch}/%{tag}&export=thepeg-%{realversion}-%{tag}&module=thepeg-%realversion-%{tag}&output=/thepeg-%{realversion}-%{tag}.tgz
Requires: lhapdf
Requires: gsl
Requires: hepmc
Requires: zlib
Requires: fastjet
Requires: rivet


BuildRequires: autotools
# FIXME: rivet?
BuildRequires: lhapdf

%define keep_archives true

%if "%{?cms_cxx:set}" != "set"
%define cms_cxx c++
%endif

%if "%{?cms_cxxflags:set}" != "set"
%define cms_cxxflags -O2 -std=c++11
%endif

%prep
%setup -q -n thepeg-%{realversion}-%{tag}
%setup -q -n ThePEG-%{realversion}

# Regenerate build scripts
autoreconf -fiv
Expand All @@ -33,11 +34,6 @@ CXX="$(which %{cms_cxx}) -fPIC"
CC="$(which gcc) -fPIC"
PLATF_CONF_OPTS="--enable-shared --disable-static"

case %{cmsplatf} in
osx*)
LIBQUADMATH="-lquadmath"
;;
esac

# Update to detect aarch64 and ppc64le
rm -f ./Config/config.{sub,guess}
Expand All @@ -46,13 +42,18 @@ curl -L -k -s -o ./Config/config.guess 'http://git.savannah.gnu.org/gitweb/?p=co
chmod +x ./Config/config.{sub,guess}

./configure $PLATF_CONF_OPTS \
--disable-silent-rules \
--with-LHAPDF=$LHAPDF_ROOT \
--with-lhapdf=$LHAPDF_ROOT \
--with-boost=$BOOST_ROOT \
--with-hepmc=$HEPMC_ROOT \
--with-gsl=$GSL_ROOT --with-zlib=$ZLIB_ROOT \
--without-javagui --prefix=%{i} \
--disable-readline CXX="$CXX" CC="$CC" CXXFLAGS="%{cms_cxxflags}" \
LIBS="-lz $LIBQUADMATH"
--with-gsl=$GSL_ROOT \
--with-zlib=$ZLIB_ROOT \
--with-fastjet=$FASTJET_ROOT \
--with-rivet=$RIVET_ROOT \
--without-javagui \
--prefix=%{i} \
--disable-readline CXX="$CXX" CC="$CC"



make %{makeprocesses}

Expand All @@ -64,4 +65,4 @@ find %{i}/lib -name '*.la' -exec rm -f {} \;
%{relocateConfig}lib/ThePEG/Makefile.common
%{relocateConfig}lib/ThePEG/Makefile
%{relocateConfig}lib/ThePEG/ThePEGDefaults.rpo
%{relocateConfig}lib/ThePEG/ThePEGDefaults-1.9.2.rpo
%{relocateConfig}lib/ThePEG/ThePEGDefaults-%{realversion}.rpo