libxsmm: 1.15 -> 1.16.1, improve derivation

The following changes are made to the derivation besides the version
bump:

- Move all buildInputs to nativeBuildInputs.
- Switch from Python 2 to Python 3.
- Build a dynamic library by default.
- Use gfortran version corresponding to gcc version.
- Enable parallel building.
This commit is contained in:
Daniël de Kok 2020-09-05 15:50:54 +02:00
parent 4afc26f0fa
commit 9be28ee361

View File

@ -1,9 +1,11 @@
{ stdenv, fetchFromGitHub, coreutils, gfortran7, gnused { stdenv, fetchFromGitHub, coreutils, gfortran, gnused
, python27, utillinux, which, bash , python3, utillinux, which
, enableStatic ? false
}: }:
let let
version = "1.15"; version = "1.16.1";
in stdenv.mkDerivation { in stdenv.mkDerivation {
pname = "libxsmm"; pname = "libxsmm";
inherit version; inherit version;
@ -11,31 +13,40 @@ in stdenv.mkDerivation {
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "hfp"; owner = "hfp";
repo = "libxsmm"; repo = "libxsmm";
rev = "refs/tags/${version}"; rev = version;
sha256 = "1406qk7k2k4qfqy4psqk55iihsrx91w8kjgsa82jxj50nl9nw5nj"; sha256 = "1c1qj6hcdfx11bvilnly92vgk1niisd2bjw1s8vfyi2f7ws1wnp0";
}; };
buildInputs = [ nativeBuildInputs = [
coreutils coreutils
gfortran7 gfortran
gnused gnused
python27 python3
utillinux utillinux
which which
]; ];
enableParallelBuilding = true;
dontConfigure = true;
makeFlags = let
static = if enableStatic then "1" else "0";
in [
"OMP=1"
"PREFIX=$(out)"
"STATIC=${static}"
];
prePatch = '' prePatch = ''
patchShebangs . patchShebangs .
''; '';
makeFlags = [ "PREFIX=$(out)" ];
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "Library targeting Intel Architecture for specialized dense and sparse matrix operations, and deep learning primitives"; description = "Library targeting Intel Architecture for specialized dense and sparse matrix operations, and deep learning primitives";
license = licenses.bsd3; license = licenses.bsd3;
homepage = "https://github.com/hfp/libxsmm"; homepage = "https://github.com/hfp/libxsmm";
platforms = platforms.linux; platforms = platforms.linux;
maintainers = with stdenv.lib.maintainers; [ chessai ]; maintainers = with stdenv.lib.maintainers; [ chessai ];
inherit version;
}; };
} }