nixpkgs/pkgs/applications/science/physics/xfitter/default.nix
Matthew Bauer 1c8aba8334 treewide: use blas and lapack
This makes packages use lapack and blas, which can wrap different
BLAS/LAPACK implementations.

treewide: cleanup from blas/lapack changes

A few issues in the original treewide:

- can’t assume blas64 is a bool
- unused commented code
2020-04-17 16:24:09 -05:00

58 lines
1.7 KiB
Nix

{ stdenv, fetchurl, apfel, apfelgrid, applgrid, blas, gfortran, lhapdf, lapack, libyaml, lynx, mela, root5, qcdnum, which }:
stdenv.mkDerivation rec {
pname = "xfitter";
version = "2.0.1";
src = fetchurl {
name = "${pname}-${version}.tgz";
url = "https://www.xfitter.org/xFitter/xFitter/DownloadPage?action=AttachFile&do=get&target=${pname}-${version}.tgz";
sha256 = "0kmgc67nw5flp92yw5x6l2vsnhwsfi5z2a20404anisdgdjs8zc6";
};
patches = [
./undefined_behavior.patch
];
# patch needs to updated due to version bump
#CXXFLAGS = "-Werror=return-type";
preConfigure =
# Fix F77LD to workaround for a following build error:
#
# gfortran: error: unrecognized command line option '-stdlib=libc++'
#
stdenv.lib.optionalString stdenv.isDarwin ''
substituteInPlace src/Makefile.in \
--replace "F77LD = \$(F77)" "F77LD = \$(CXXLD)" \
'';
configureFlags = [
"--enable-apfel"
"--enable-apfelgrid"
"--enable-applgrid"
"--enable-mela"
"--enable-lhapdf"
];
nativeBuildInputs = [ gfortran which ];
buildInputs =
[ apfel apfelgrid applgrid blas lhapdf lapack mela root5 qcdnum ]
# pdf2yaml requires fmemopen and open_memstream which are not readily available on Darwin
++ stdenv.lib.optional (!stdenv.isDarwin) libyaml
;
propagatedBuildInputs = [ lynx ];
enableParallelBuilding = true;
hardeningDisable = [ "format" ];
meta = with stdenv.lib; {
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;
homepage = "https://www.xfitter.org/xFitter";
platforms = platforms.unix;
maintainers = with maintainers; [ veprbl ];
};
}