diff --git a/pkgs/applications/science/physics/sherpa/default.nix b/pkgs/applications/science/physics/sherpa/default.nix index 2dfe3f7d7bb2c..b1fbbab8781fb 100644 --- a/pkgs/applications/science/physics/sherpa/default.nix +++ b/pkgs/applications/science/physics/sherpa/default.nix @@ -1,12 +1,12 @@ -{ lib, stdenv, fetchurl, autoconf, gfortran, hepmc2, fastjet, lhapdf, rivet, sqlite }: +{ lib, stdenv, fetchurl, autoconf, gfortran, hepmc3, fastjet, lhapdf, rivet, sqlite }: stdenv.mkDerivation rec { pname = "sherpa"; - version = "2.2.15"; + version = "2.2.16"; src = fetchurl { url = "https://www.hepforge.org/archive/sherpa/SHERPA-MC-${version}.tar.gz"; - sha256 = "sha256-3zvLa1k/bm7uOWKUsTyQM39cPBXJJlF1OgPgznl1hks="; + sha256 = "sha256-AntSN5BhtJFuDBoOFvrzoCr/W4SnX5CeAXiTcz9MjUs="; }; postPatch = lib.optionalString (stdenv.hostPlatform.libc == "glibc") '' @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { configureFlags = [ "--with-sqlite3=${sqlite.dev}" - "--enable-hepmc2=${hepmc2}" + "--enable-hepmc3=${hepmc3}" "--enable-fastjet=${fastjet}" "--enable-lhapdf=${lhapdf}" "--enable-rivet=${rivet}" diff --git a/pkgs/development/libraries/physics/fastnlo-toolkit/default.nix b/pkgs/development/libraries/physics/fastnlo-toolkit/default.nix index 3c781689bbf83..820afcbd8f68b 100644 --- a/pkgs/development/libraries/physics/fastnlo-toolkit/default.nix +++ b/pkgs/development/libraries/physics/fastnlo-toolkit/default.nix @@ -22,6 +22,11 @@ stdenv.mkDerivation rec { sha256 = "sha256-7aIMYCOkHC/17CHYiEfrxvtSJxTDivrS7BQ32cGiEy0="; }; + patches = [ + # Compatibility with YODA 2.x + ./yoda2_support.patch + ]; + buildInputs = [ boost gfortran diff --git a/pkgs/development/libraries/physics/fastnlo-toolkit/yoda2_support.patch b/pkgs/development/libraries/physics/fastnlo-toolkit/yoda2_support.patch new file mode 100644 index 0000000000000..d9f4aaa5159f8 --- /dev/null +++ b/pkgs/development/libraries/physics/fastnlo-toolkit/yoda2_support.patch @@ -0,0 +1,247 @@ +diff --git a/src/fnlo-tk-statunc.cc b/src/fnlo-tk-statunc.cc +index 62d1eec..ad62cac 100644 +--- a/src/fnlo-tk-statunc.cc ++++ b/src/fnlo-tk-statunc.cc +@@ -30,7 +30,16 @@ + #include "fastnlotk/fastNLOLHAPDF.h" + #include "fastnlotk/speaker.h" + #ifdef WITH_YODA ++#if defined __has_include ++#if !__has_include("YODA/WriterAIDA.h") ++#define WITH_YODA2 ++#endif ++#endif ++#ifdef WITH_YODA2 ++#include "YODA/Scatter.h" ++#else + #include "YODA/Scatter2D.h" ++#endif + #include "YODA/WriterYODA.h" + #endif + +@@ -493,28 +502,25 @@ int main(int argc, char** argv) { + + //! --- 1D + if (NDim == 1) { +- //! Vectors to fill 2D scatter plot +- vector < double > x; +- vector < double > y; +- vector < double > exminus; +- vector < double > explus; +- vector < double > eyminus; +- vector < double > eyplus; ++ //! Vector to fill 2D scatter plot ++ vector points; + //! Loop over bins in outer (1st) dimension + for (unsigned int k =0 ; k x; +- vector < double > y; +- vector < double > exminus; +- vector < double > explus; +- vector < double > eyminus; +- vector < double > eyplus; ++ //! Vector to fill 2D scatter plot ++ vector points; + //! Loop over bins in inner (2nd) dimension + NDimBins[1] = fnlo.GetNDim1Bins(j); + for (unsigned int k = 0; k x; +- vector < double > y; +- vector < double > exminus; +- vector < double > explus; +- vector < double > eyminus; +- vector < double > eyplus; ++ //! Vector to fill 2D scatter plot ++ vector < YODA::Point2D > points; + //! Loop over bins in outer (1st) dimension + for (unsigned int k =0 ; k x; +- vector < double > y; +- vector < double > exminus; +- vector < double > explus; +- vector < double > eyminus; +- vector < double > eyplus; ++ vector < YODA::Point2D > points; + //! Loop over bins in inner (2nd) dimension + NDimBins[1] = fnlo->GetNDim1Bins(j); + for (unsigned int k = 0; kGetNDim1Bins(j); + for (unsigned int k = 0; k x; +- vector < double > y; +- vector < double > exminus; +- vector < double > explus; +- vector < double > eyminus; +- vector < double > eyplus; ++ vector < YODA::Point2D > points; + //! Loop over bins in inner (3rd) dimension + NDimBins[2] = fnlo->GetNDim2Bins(j,k); + for (unsigned int l = 0; l