From 7143712be637a38590756756a264c965e71ebd62 Mon Sep 17 00:00:00 2001 From: jie xiao Date: Wed, 20 May 2026 23:35:41 +0100 Subject: [PATCH 1/3] sherpa3 --- bz2lib.spec | 1 + libzip.spec | 16 +++++ scram-tools.file/tools/libzip/libzip.xml | 12 ++++ scram-tools.file/tools/sherpa/sherpa.xml | 34 ++++++---- sherpa.spec | 86 ++++++++++-------------- 5 files changed, 84 insertions(+), 65 deletions(-) create mode 100644 libzip.spec create mode 100644 scram-tools.file/tools/libzip/libzip.xml diff --git a/bz2lib.spec b/bz2lib.spec index 14ea727f044..b21015730e7 100644 --- a/bz2lib.spec +++ b/bz2lib.spec @@ -4,6 +4,7 @@ BuildRequires: gmake %prep %setup -n bzip2-bzip2-%{realversion} +sed -i 's/-Wl,-soname -Wl,libbz2.so.1.0/-Wl,-soname -Wl,libbz2.so.1/' Makefile-libbz2_so sed -e 's/ -shared/ -dynamiclib/' \ -e 's/ -Wl,-soname -Wl,[^ ]*//' \ -e 's/libbz2\.so/libbz2.dylib/g' \ diff --git a/libzip.spec b/libzip.spec new file mode 100644 index 00000000000..94af5fe3054 --- /dev/null +++ b/libzip.spec @@ -0,0 +1,16 @@ +### RPM external libzip 1.11.4 +Source: git+https://github.com/nih-at/libzip.git?obj=main/v%{realversion}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}.tgz +Requires: zlib zstd +BuildRequires: cmake + +%prep +%setup -n %{n}-%{realversion} + +%build +rm -rf build && mkdir build +cmake -S . -B build \ + -DCMAKE_INSTALL_PREFIX=%{i} +cmake --build build %{makeprocesses} + +%install +cmake --install build diff --git a/scram-tools.file/tools/libzip/libzip.xml b/scram-tools.file/tools/libzip/libzip.xml new file mode 100644 index 00000000000..a7914180148 --- /dev/null +++ b/scram-tools.file/tools/libzip/libzip.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/scram-tools.file/tools/sherpa/sherpa.xml b/scram-tools.file/tools/sherpa/sherpa.xml index 749d8d3f933..da666c62036 100644 --- a/scram-tools.file/tools/sherpa/sherpa.xml +++ b/scram-tools.file/tools/sherpa/sherpa.xml @@ -1,26 +1,32 @@ - + + + + + - - - + + + + - - - + + + - - - - + + + - - - + + + + + diff --git a/sherpa.spec b/sherpa.spec index 293f2d15b3b..83d505fe196 100644 --- a/sherpa.spec +++ b/sherpa.spec @@ -1,60 +1,44 @@ -### RPM external sherpa 2.2.16 -Source: git+https://gitlab.com/sherpa-team/sherpa.git?obj=master/v%{realversion}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}.tgz -Requires: hepmc lhapdf blackhat sqlite python3 fastjet openmpi hepmc3 -BuildRequires: mcfm swig autotools -Patch0: sherpa-2.2.16-hepmcshort -#Avoid calling setenv: https://gitlab.com/sherpa-team/sherpa/-/commit/6ead62d7a2758612f8965fb5b61df8c012cf9cae.diff -Patch1: sherpa-setenv -#Disable build Manual and Examples -Patch2: sherpa-disable-manual +### RPM external sherpa 3.0.4 +Source: git+https://gitlab.com/sherpa-team/sherpa.git?obj=master/v%{realversion}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}.tgz +Requires: hepmc3 lhapdf blackhat fastjet openmpi rivet pythia8 gosam libzip +BuildRequires: cmake swig %{!?without_openloops:Requires: openloops} %prep -%setup -q -n sherpa-%{realversion} -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 - -autoreconf -i --force - -# Force architecture based on %%cmsplatf -%ifarch x86_64 - ARCH_CMSPLATF="-m64" -%endif +%setup -q -n %{n}-%{realversion} %build -export PYTHON=$(which python3) -./configure --prefix=%i --enable-analysis --disable-silent-rules \ - --enable-fastjet=$FASTJET_ROOT \ - --enable-hepmc2=$HEPMC_ROOT \ - --enable-hepmc3=$HEPMC3_ROOT \ - --enable-lhapdf=$LHAPDF_ROOT \ - --enable-blackhat=$BLACKHAT_ROOT \ - --enable-pyext \ - --enable-ufo \ - ${OPENLOOPS_ROOT+--enable-openloops=$OPENLOOPS_ROOT} \ - --enable-mpi \ - --with-sqlite3=$SQLITE_ROOT \ - --enable-analysis \ - CC="mpicc" \ - CXX="mpicxx" \ - MPICXX="mpicxx" \ - FC="mpifort" \ - CXXFLAGS="-fuse-cxa-atexit $ARCH_CMSPLATF -O2 -std=c++0x -I$LHAPDF_ROOT/include -I$BLACKHAT_ROOT/include -I$RIVET_ROOT/include" \ - LDFLAGS="-ldl -L$BLACKHAT_ROOT/lib/blackhat -L$QD_ROOT/lib" - -make %{makeprocesses} +rm -rf build && mkdir build + +cmake -S . -B build \ + -DCMAKE_INSTALL_PREFIX=%i \ + -DSHERPA_ENABLE_MPI=ON -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_Fortran_COMPILER=mpifort \ + -DSHERPA_ENABLE_ANALYSIS=ON \ + -DSHERPA_ENABLE_EXAMPLES=ON \ + -DSHERPA_ENABLE_LIBZIP=ON -DLibZip_DIR=$LIBZIP_ROOT \ + -DSHERPA_ENABLE_GZIP=ON \ + -DSHERPA_ENABLE_HEPMC3=ON -DHEPMC3_DIR=$HEPMC3_ROOT -DSHERPA_ENABLE_HEPMC3_ROOT=OFF \ + -DSHERPA_ENABLE_LHAPDF=ON -DLHAPDF_DIR=$LHAPDF_ROOT -DSHERPA_ENABLE_INTERNAL_PDFS=OFF \ + -DSHERPA_ENABLE_BLACKHAT=ON -DBLACKHAT_DIR=$BLACKHAT_ROOT \ + ${OPENLOOPS_ROOT+-DSHERPA_ENABLE_OPENLOOPS=ON -DOPENLOOPS_DIR=$OPENLOOPS_ROOT} \ + -DSHERPA_ENABLE_ROOT=OFF \ + -DSHERPA_ENABLE_PYTHIA8=ON -DPYHIA8_DIR=$PYTHIA8_ROOT \ + -DSHERPA_ENABLE_RECOLA=OFF \ + -DSHERPA_ENABLE_GOSAM=ON -DGOSAM_DIR=$GOSAM_ROOT \ + -DSHERPA_ENABLE_RIVET=ON -DRIVET_DIR=$RIVET_ROOT \ + -DSHERPA_ENABLE_EWSUD=ON \ + -DSHERPA_ENABLE_PYTHON=ON \ + -DSHERPA_ENABLE_UFO=ON \ + -DSHERPA_ENABLE_THREADING=ON \ + -DSHERPA_ENABLE_DIHIGGS=OFF \ + -DSHERPA_ENABLE_MADLOOP=OFF \ + -DSHERPA_ENABLE_MCFM=OFF \ + -DSHERPA_ENABLE_TESTING=OFF \ + -DSHERPA_ENABLE_INTEGRATION_TESTS=OFF \ + -DSHERPA_ENABLE_BINRELOC=OFF +cmake --build build %{makeprocesses} %install -make install -find %{i}/lib -name '*.la' -delete +cmake --install build sed -i -e 's|^#!/.*|#!/usr/bin/env python3|' %{i}/bin/Sherpa-generate-model - -%post -%{relocateConfig}lib/python%{cms_python3_major_minor_version}/site-packages/ufo_interface/sconstruct_template -%{relocateConfig}bin/make2scons -%{relocateConfig}share/SHERPA-MC/makelibs -%{relocateConfig}bin/Sherpa-config -%{relocateConfig}bin/Sherpa-generate-model -%{relocateConfig}include/SHERPA-MC/ATOOLS/Org/CXXFLAGS*.H From a940c2ddd32d16bbdb565188c9a5a046da82c413 Mon Sep 17 00:00:00 2001 From: jie xiao Date: Thu, 21 May 2026 12:18:18 +0100 Subject: [PATCH 2/3] fix sherpa denpendce --- openloops.spec | 4 +++- scram-tools.file/tools/libzip/libzip.xml | 20 ++++++++--------- .../tools/openloops/openloops.xml | 1 + scram-tools.file/tools/sherpa/sherpa.xml | 22 +++++++++---------- sherpa.spec | 3 +-- 5 files changed, 24 insertions(+), 26 deletions(-) diff --git a/openloops.spec b/openloops.spec index 1f80d7fa310..6e40b199d10 100644 --- a/openloops.spec +++ b/openloops.spec @@ -50,7 +50,9 @@ done ./openloops libinstall openloops-user.coll %install -mkdir %i/{lib,proclib} +mkdir %i/{lib,proclib,include} cp lib/*.so %i/lib cp proclib/*.so %i/proclib cp proclib/*.info %i/proclib +cp proclib/*.rinfo %i/proclib +cp include/* %i/include diff --git a/scram-tools.file/tools/libzip/libzip.xml b/scram-tools.file/tools/libzip/libzip.xml index a7914180148..4b1398bb4c4 100644 --- a/scram-tools.file/tools/libzip/libzip.xml +++ b/scram-tools.file/tools/libzip/libzip.xml @@ -1,12 +1,10 @@ - - - - - - - - - - - + + + + + + + + + diff --git a/scram-tools.file/tools/openloops/openloops.xml b/scram-tools.file/tools/openloops/openloops.xml index 47833975599..9806bad297e 100644 --- a/scram-tools.file/tools/openloops/openloops.xml +++ b/scram-tools.file/tools/openloops/openloops.xml @@ -1,6 +1,7 @@ + diff --git a/scram-tools.file/tools/sherpa/sherpa.xml b/scram-tools.file/tools/sherpa/sherpa.xml index da666c62036..8062a9c54b6 100644 --- a/scram-tools.file/tools/sherpa/sherpa.xml +++ b/scram-tools.file/tools/sherpa/sherpa.xml @@ -1,4 +1,4 @@ - + @@ -7,23 +7,21 @@ - - - - + + + - - - + + + - - - + + + - diff --git a/sherpa.spec b/sherpa.spec index 83d505fe196..d0e7ccb8b99 100644 --- a/sherpa.spec +++ b/sherpa.spec @@ -1,6 +1,6 @@ ### RPM external sherpa 3.0.4 Source: git+https://gitlab.com/sherpa-team/sherpa.git?obj=master/v%{realversion}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}.tgz -Requires: hepmc3 lhapdf blackhat fastjet openmpi rivet pythia8 gosam libzip +Requires: hepmc3 lhapdf blackhat fastjet openmpi rivet pythia8 libzip BuildRequires: cmake swig %{!?without_openloops:Requires: openloops} @@ -25,7 +25,6 @@ cmake -S . -B build \ -DSHERPA_ENABLE_ROOT=OFF \ -DSHERPA_ENABLE_PYTHIA8=ON -DPYHIA8_DIR=$PYTHIA8_ROOT \ -DSHERPA_ENABLE_RECOLA=OFF \ - -DSHERPA_ENABLE_GOSAM=ON -DGOSAM_DIR=$GOSAM_ROOT \ -DSHERPA_ENABLE_RIVET=ON -DRIVET_DIR=$RIVET_ROOT \ -DSHERPA_ENABLE_EWSUD=ON \ -DSHERPA_ENABLE_PYTHON=ON \ From 9fac97944c45443ffb78571023dff2bc79c297c3 Mon Sep 17 00:00:00 2001 From: jie xiao Date: Thu, 21 May 2026 15:00:29 +0100 Subject: [PATCH 3/3] minor adjusts --- bz2lib.spec | 1 - libzip.spec | 23 ++++++++++++++++------- scram-tools.file/tools/libzip/libzip.xml | 2 +- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/bz2lib.spec b/bz2lib.spec index b21015730e7..14ea727f044 100644 --- a/bz2lib.spec +++ b/bz2lib.spec @@ -4,7 +4,6 @@ BuildRequires: gmake %prep %setup -n bzip2-bzip2-%{realversion} -sed -i 's/-Wl,-soname -Wl,libbz2.so.1.0/-Wl,-soname -Wl,libbz2.so.1/' Makefile-libbz2_so sed -e 's/ -shared/ -dynamiclib/' \ -e 's/ -Wl,-soname -Wl,[^ ]*//' \ -e 's/libbz2\.so/libbz2.dylib/g' \ diff --git a/libzip.spec b/libzip.spec index 94af5fe3054..8488a658fb3 100644 --- a/libzip.spec +++ b/libzip.spec @@ -1,16 +1,25 @@ ### RPM external libzip 1.11.4 -Source: git+https://github.com/nih-at/libzip.git?obj=main/v%{realversion}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}.tgz -Requires: zlib zstd +Source: https://github.com/nih-at/libzip/releases/download/v%{realversion}/libzip-%{realversion}.tar.gz BuildRequires: cmake +Requires: zlib zstd +Requires: bz2lib %prep %setup -n %{n}-%{realversion} %build -rm -rf build && mkdir build -cmake -S . -B build \ - -DCMAKE_INSTALL_PREFIX=%{i} -cmake --build build %{makeprocesses} +cmake \ + -S %{_builddir}/%{n}-%{realversion} \ + -B %{_builddir}/build \ + -DCMAKE_INSTALL_PREFIX=%{i} \ + -DCMAKE_PREFIX_PATH=%{cmake_prefix_path} \ + -DENABLE_COMMONCRYPTO=OFF \ + -DENABLE_GNUTLS=OFF \ + -DENABLE_MBEDTLS=OFF \ + -DENABLE_WINDOWS_CRYPTO=OFF \ + -DBUILD_EXAMPLES=OFF \ + -DBUILD_DOC=OFF +make -C %{_builddir}/build %{makeprocesses} %install -cmake --install build +make -C %{_builddir}/build %{makeprocesses} install \ No newline at end of file diff --git a/scram-tools.file/tools/libzip/libzip.xml b/scram-tools.file/tools/libzip/libzip.xml index 4b1398bb4c4..52ba4ea0c7f 100644 --- a/scram-tools.file/tools/libzip/libzip.xml +++ b/scram-tools.file/tools/libzip/libzip.xml @@ -1,10 +1,10 @@ + -