2022-05-18 14:49:53 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, apfel
|
|
|
|
, gsl
|
|
|
|
, lhapdf
|
|
|
|
, libarchive
|
2023-02-02 18:25:31 +00:00
|
|
|
, yaml-cpp
|
2022-05-18 14:49:53 +00:00
|
|
|
, python3
|
|
|
|
, sqlite
|
|
|
|
, swig
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "nnpdf";
|
2023-02-16 17:41:37 +00:00
|
|
|
version = "4.0.6";
|
2022-05-18 14:49:53 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "NNPDF";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2023-02-16 17:41:37 +00:00
|
|
|
hash = "sha256-mwOMNlYFhHZq/wakO1/HGwcxvKGKh5OyFa2D9d3Y3IA=";
|
2022-05-18 14:49:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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
|
2023-02-02 18:25:31 +00:00
|
|
|
yaml-cpp
|
2022-05-18 14:49:53 +00:00
|
|
|
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;
|
2022-12-17 10:02:37 +00:00
|
|
|
# never built on aarch64-darwin since first introduction in nixpkgs
|
|
|
|
broken = (stdenv.isDarwin && stdenv.isAarch64) || (stdenv.isLinux && stdenv.isAarch64);
|
2022-05-18 14:49:53 +00:00
|
|
|
};
|
|
|
|
}
|