From 7c82b37d0b40f908b1fef65206177662d5b49d36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Bon=C3=A9?= Date: Tue, 9 Dec 2025 17:46:40 +0100 Subject: [PATCH] Add install check for OpenMP{,-V} --- pkgs/llvm-ompss2/openmp.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/pkgs/llvm-ompss2/openmp.nix b/pkgs/llvm-ompss2/openmp.nix index 720525fc..c26b55f0 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; };