2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchurl, apfel, apfelgrid, applgrid, blas, gfortran, lhapdf, lapack, libyaml, lynx
|
2020-08-15 14:20:28 +00:00
|
|
|
, mela, root5, qcdnum, which, libtirpc
|
2021-08-24 08:32:38 +00:00
|
|
|
, memorymappingHook, memstreamHook
|
2020-08-15 14:20:28 +00:00
|
|
|
}:
|
2018-09-24 18:32:37 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "xfitter";
|
2019-12-27 01:59:34 +00:00
|
|
|
version = "2.0.1";
|
2018-09-24 18:32:37 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 12:41:18 +00:00
|
|
|
name = "${pname}-${version}.tgz";
|
|
|
|
url = "https://www.xfitter.org/xFitter/xFitter/DownloadPage?action=AttachFile&do=get&target=${pname}-${version}.tgz";
|
2019-12-27 01:59:34 +00:00
|
|
|
sha256 = "0kmgc67nw5flp92yw5x6l2vsnhwsfi5z2a20404anisdgdjs8zc6";
|
2018-09-24 18:32:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
2018-10-08 14:59:17 +00:00
|
|
|
./undefined_behavior.patch
|
2018-09-24 18:32:37 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
preConfigure =
|
|
|
|
# Fix F77LD to workaround for a following build error:
|
|
|
|
#
|
|
|
|
# gfortran: error: unrecognized command line option '-stdlib=libc++'
|
|
|
|
#
|
2021-01-15 13:21:58 +00:00
|
|
|
lib.optionalString stdenv.isDarwin ''
|
2018-09-24 18:32:37 +00:00
|
|
|
substituteInPlace src/Makefile.in \
|
|
|
|
--replace "F77LD = \$(F77)" "F77LD = \$(CXXLD)" \
|
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--enable-apfel"
|
|
|
|
"--enable-apfelgrid"
|
|
|
|
"--enable-applgrid"
|
|
|
|
"--enable-mela"
|
|
|
|
"--enable-lhapdf"
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ gfortran which ];
|
|
|
|
buildInputs =
|
2021-08-24 08:32:38 +00:00
|
|
|
[ apfel apfelgrid applgrid blas lhapdf libyaml lapack mela root5 qcdnum ]
|
|
|
|
++ lib.optionals (stdenv.system == "x86_64-darwin") [ memorymappingHook memstreamHook ]
|
2021-05-01 17:11:28 +00:00
|
|
|
++ lib.optional (stdenv.hostPlatform.libc == "glibc") libtirpc
|
2018-09-24 18:32:37 +00:00
|
|
|
;
|
|
|
|
propagatedBuildInputs = [ lynx ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-05-01 17:11:28 +00:00
|
|
|
NIX_CFLAGS_COMPILE = lib.optional (stdenv.hostPlatform.libc == "glibc") "-I${libtirpc.dev}/include/tirpc";
|
|
|
|
NIX_LDFLAGS = lib.optional (stdenv.hostPlatform.libc == "glibc") "-ltirpc";
|
2020-08-15 14:20:28 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-09-24 18:32:37 +00:00
|
|
|
description = "The xFitter project is an open source QCD fit framework ready to extract PDFs and assess the impact of new data";
|
|
|
|
license = licenses.gpl3;
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.xfitter.org/xFitter";
|
2018-09-24 18:32:37 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ veprbl ];
|
|
|
|
};
|
|
|
|
}
|