3b21a32d83
Allows building OpenMP-V with ovni support, which is neccessary to run the runtime tests of OpenMP-V in ovni. Reviewed-by: Aleix Roca Nonell <aleix.rocanonell@bsc.es> Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es> Tested-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
74 lines
1.3 KiB
Nix
74 lines
1.3 KiB
Nix
{ lib
|
|
, llvmPackages_latest
|
|
, monorepoSrc
|
|
, runCommand
|
|
, cmake
|
|
, ninja
|
|
, llvm
|
|
, perl
|
|
, pkg-config
|
|
, version
|
|
, nosv
|
|
, ovni
|
|
, enableNosv ? false
|
|
, enableDebug ? false
|
|
, enableOvni ? false
|
|
}:
|
|
|
|
assert enableOvni -> enableNosv;
|
|
|
|
let
|
|
stdenv = llvmPackages_latest.stdenv;
|
|
in
|
|
stdenv.mkDerivation rec {
|
|
pname = "openmp" + (lib.optionalString enableNosv "-v");
|
|
inherit version;
|
|
|
|
src = runCommand "${pname}-src" {} ''
|
|
mkdir -p "$out"
|
|
cp -r ${monorepoSrc}/cmake "$out"
|
|
cp -r ${monorepoSrc}/openmp "$out"
|
|
'';
|
|
|
|
sourceRoot = "${src.name}/openmp";
|
|
|
|
nativeBuildInputs = [
|
|
cmake
|
|
ninja
|
|
perl
|
|
pkg-config
|
|
] ++ lib.optionals enableNosv [
|
|
nosv
|
|
] ++ lib.optionals enableOvni [
|
|
ovni
|
|
];
|
|
|
|
doCheck = false;
|
|
|
|
hardeningDisable = [ "all" ];
|
|
|
|
cmakeBuildType = if enableDebug then "Debug" else "Release";
|
|
|
|
dontStrip = enableDebug;
|
|
|
|
cmakeFlags = [
|
|
"-DLIBOMP_OMPD_SUPPORT=OFF"
|
|
"-DOPENMP_ENABLE_LIBOMPTARGET=OFF"
|
|
];
|
|
|
|
# Remove support for GNU and Intel Openmp.
|
|
# Also, remove libomp if building with nosv, as there is no support to build
|
|
# only one runtime at a time.
|
|
postInstall = ''
|
|
rm -f $out/lib/libgomp*
|
|
rm -f $out/lib/libiomp*
|
|
'' + lib.optionalString enableNosv ''
|
|
rm -f $out/lib/libomp.*
|
|
'';
|
|
|
|
passthru = {
|
|
inherit nosv;
|
|
};
|
|
}
|
|
|