From f9581cfb59e12f5d2824d320986549a8251f0aaa Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Tue, 22 Jun 2021 14:55:52 +0200 Subject: [PATCH] cn6: enable extra test utils --- bsc/cn6/default.nix | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/bsc/cn6/default.nix b/bsc/cn6/default.nix index 7263c1a..4fcc74d 100644 --- a/bsc/cn6/default.nix +++ b/bsc/cn6/default.nix @@ -3,8 +3,18 @@ , babeltrace2 , pkg-config , uthash +, enableTest ? false +, mpi ? null +, clangOmpss2 ? null +, tampi ? null }: +with stdenv.lib; + +assert (enableTest -> (mpi != null)); +assert (enableTest -> (clangOmpss2 != null)); +assert (enableTest -> (tampi != null)); + stdenv.mkDerivation rec { pname = "cn6"; version = "${src.shortRev}"; @@ -13,7 +23,8 @@ stdenv.mkDerivation rec { babeltrace2 pkg-config uthash - ]; + mpi + ] ++ optionals (enableTest) [ mpi clangOmpss2 tampi ]; src = builtins.fetchGit { url = "ssh://git@bscpm03.bsc.es/rarias/cn6.git"; @@ -22,4 +33,18 @@ stdenv.mkDerivation rec { }; makeFlags = [ "PREFIX=$(out)" ]; + + postBuild = optionalString (enableTest) '' + ( + cd test + make timediff timediff_mpi + ) + ''; + + postInstall = optionalString (enableTest) '' + ( + cd test + cp timediff timediff_mpi sync-err.sh $out/bin/ + ) + ''; }