summary refs log tree commit diff
diff options
context:
space:
mode:
authorDmitry Kalinkin <dmitry.kalinkin@gmail.com>2022-05-07 14:24:28 -0400
committerRobert Schütz <github@dotlambda.de>2022-05-15 16:00:00 -0700
commit8e24a6db2e633daafe0c7633ed74c8265585ccec (patch)
tree3ff79ced27b325e4b9ad212555dc840215fbfa05
parentf607b644c40714ebc08cf56ba0c0378cfcdda4e2 (diff)
downloadnixpkgs-8e24a6db2e633daafe0c7633ed74c8265585ccec.tar
nixpkgs-8e24a6db2e633daafe0c7633ed74c8265585ccec.tar.gz
nixpkgs-8e24a6db2e633daafe0c7633ed74c8265585ccec.tar.bz2
nixpkgs-8e24a6db2e633daafe0c7633ed74c8265585ccec.tar.lz
nixpkgs-8e24a6db2e633daafe0c7633ed74c8265585ccec.tar.xz
nixpkgs-8e24a6db2e633daafe0c7633ed74c8265585ccec.tar.zst
nixpkgs-8e24a6db2e633daafe0c7633ed74c8265585ccec.zip
nnpdf: init at 4.0.4
-rw-r--r--pkgs/applications/science/physics/nnpdf/default.nix71
-rw-r--r--pkgs/top-level/all-packages.nix2
-rw-r--r--pkgs/top-level/python-packages.nix4
3 files changed, 77 insertions, 0 deletions
diff --git a/pkgs/applications/science/physics/nnpdf/default.nix b/pkgs/applications/science/physics/nnpdf/default.nix
new file mode 100644
index 00000000000..8674132d840
--- /dev/null
+++ b/pkgs/applications/science/physics/nnpdf/default.nix
@@ -0,0 +1,71 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, pkg-config
+, apfel
+, gsl
+, lhapdf
+, libarchive
+, libyamlcpp
+, python3
+, sqlite
+, swig
+}:
+
+stdenv.mkDerivation rec {
+  pname = "nnpdf";
+  version = "4.0.4";
+
+  src = fetchFromGitHub {
+    owner = "NNPDF";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-Alx4W0TkPzJBsnRXcKBrlEU6jWTnOjrji/IPk+dNCw0=";
+  };
+
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/NNPDF/nnpdf/commit/7943b62a91d3a41fd4f6366b18881d50695f4b45.diff";
+      hash = "sha256-UXhTO7vZgJiY8h3bgjg7SQC0gMUQsYQ/V/PgtCEQ7VU=";
+    })
+  ];
+
+  postPatch = ''
+    for file in CMakeLists.txt buildmaster/CMakeLists.txt; do
+      substituteInPlace $file \
+        --replace "-march=nocona -mtune=haswell" ""
+    done
+  '';
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+  ];
+
+  buildInputs = [
+    apfel
+    gsl
+    lhapdf
+    libarchive
+    libyamlcpp
+    python3
+    python3.pkgs.numpy
+    sqlite
+    swig
+  ];
+
+  cmakeFlags = [
+    "-DCOMPILE_filter=ON"
+    "-DCOMPILE_evolvefit=ON"
+  ];
+
+  meta = with lib; {
+    description = "An open-source machine learning framework for global analyses of parton distributions";
+    homepage = "https://docs.nnpdf.science/";
+    license = licenses.gpl3Only;
+    maintainers = [ maintainers.veprbl ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 6d39c7156f7..54af7f573f8 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -33161,6 +33161,8 @@ with pkgs;
     lhapdf = lhapdf.override { stdenv = gccStdenv; };
   };
 
+  nnpdf = callPackage ../applications/science/physics/nnpdf { };
+
   professor = callPackage ../applications/science/physics/professor { };
 
   sacrifice = callPackage ../applications/science/physics/sacrifice {};
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 02b38b79c0c..94fed32d942 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -5719,6 +5719,10 @@ in {
 
   nltk = callPackage ../development/python-modules/nltk { };
 
+  nnpdf = toPythonModule (pkgs.nnpdf.override {
+    python3 = python;
+  });
+
   nmapthon2 = callPackage ../development/python-modules/nmapthon2 { };
 
   amaranth-boards = callPackage ../development/python-modules/amaranth-boards { };