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/ + ) + ''; }