diff --git a/pkgs/llvm-ompss2/openmp.nix b/pkgs/llvm-ompss2/openmp.nix index 720525f..c26b55f 100644 --- a/pkgs/llvm-ompss2/openmp.nix +++ b/pkgs/llvm-ompss2/openmp.nix @@ -74,6 +74,28 @@ stdenv.mkDerivation rec { rm -f $out/libllvmrt/libomp.* ''; + doInstallCheck = true; + # There are not cmake flags to force nOS-V, it enables it when found through + # pkg-config. If enableNosv is set, but we fail to find it at build time, + # the build will succeed but won't use nOS-V (libompv won't be created). + # This is a sanity check to ensure that after install we have the proper + # files. + installCheckPhase = + if enableNosv then + '' + test -f $out/lib/libompv.so + test -f $out/libllvmrt/libompv.so + test ! -f $out/lib/libomp.so + test ! -f $out/libllvmrt/libomp.so + '' + else + '' + test -f $out/lib/libomp.so + test -f $out/libllvmrt/libomp.so + test ! -f $out/lib/libompv.so + test ! -f $out/libllvmrt/libompv.so + ''; + passthru = { inherit nosv; };