Add install check for OpenMP{,-V}

This commit is contained in:
Aleix Boné 2025-12-09 17:46:40 +01:00
parent bda1f10dd7
commit a0f2e2639b
No known key found for this signature in database

View File

@ -74,6 +74,28 @@ stdenv.mkDerivation rec {
rm -f $out/libllvmrt/libomp.* 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 = { passthru = {
inherit nosv; inherit nosv;
}; };