cn6: enable extra test utils

This commit is contained in:
Rodrigo Arias 2021-06-22 14:55:52 +02:00
parent 3be896d90d
commit f9581cfb59

View File

@ -3,8 +3,18 @@
, babeltrace2 , babeltrace2
, pkg-config , pkg-config
, uthash , 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 { stdenv.mkDerivation rec {
pname = "cn6"; pname = "cn6";
version = "${src.shortRev}"; version = "${src.shortRev}";
@ -13,7 +23,8 @@ stdenv.mkDerivation rec {
babeltrace2 babeltrace2
pkg-config pkg-config
uthash uthash
]; mpi
] ++ optionals (enableTest) [ mpi clangOmpss2 tampi ];
src = builtins.fetchGit { src = builtins.fetchGit {
url = "ssh://git@bscpm03.bsc.es/rarias/cn6.git"; url = "ssh://git@bscpm03.bsc.es/rarias/cn6.git";
@ -22,4 +33,18 @@ stdenv.mkDerivation rec {
}; };
makeFlags = [ "PREFIX=$(out)" ]; 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/
)
'';
} }