From 9be28ee3615d8c26e01b29103390a25634b0845e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Sat, 5 Sep 2020 15:50:54 +0200 Subject: [PATCH] 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. --- .../development/libraries/libxsmm/default.nix | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/pkgs/development/libraries/libxsmm/default.nix b/pkgs/development/libraries/libxsmm/default.nix index 25c85948608a..394347277f6a 100644 --- a/pkgs/development/libraries/libxsmm/default.nix +++ b/pkgs/development/libraries/libxsmm/default.nix @@ -1,9 +1,11 @@ -{ stdenv, fetchFromGitHub, coreutils, gfortran7, gnused -, python27, utillinux, which, bash +{ stdenv, fetchFromGitHub, coreutils, gfortran, gnused +, python3, utillinux, which + +, enableStatic ? false }: let - version = "1.15"; + version = "1.16.1"; in stdenv.mkDerivation { pname = "libxsmm"; inherit version; @@ -11,31 +13,40 @@ in stdenv.mkDerivation { src = fetchFromGitHub { owner = "hfp"; repo = "libxsmm"; - rev = "refs/tags/${version}"; - sha256 = "1406qk7k2k4qfqy4psqk55iihsrx91w8kjgsa82jxj50nl9nw5nj"; + rev = version; + sha256 = "1c1qj6hcdfx11bvilnly92vgk1niisd2bjw1s8vfyi2f7ws1wnp0"; }; - buildInputs = [ + nativeBuildInputs = [ coreutils - gfortran7 + gfortran gnused - python27 + python3 utillinux which ]; + enableParallelBuilding = true; + + dontConfigure = true; + + makeFlags = let + static = if enableStatic then "1" else "0"; + in [ + "OMP=1" + "PREFIX=$(out)" + "STATIC=${static}" + ]; + prePatch = '' patchShebangs . ''; - makeFlags = [ "PREFIX=$(out)" ]; - meta = with stdenv.lib; { description = "Library targeting Intel Architecture for specialized dense and sparse matrix operations, and deep learning primitives"; license = licenses.bsd3; homepage = "https://github.com/hfp/libxsmm"; platforms = platforms.linux; maintainers = with stdenv.lib.maintainers; [ chessai ]; - inherit version; }; }