forked from rarias/bscpkgs
Split OpenMP from Clang in LLVM
As the OpenMP-V implementation requires to be built with nOS-V, we can split the OpenMP package in a different derivation to prevent rebuilds of clang. Additionally, as OpenMP-V now can be build alongside the vanilla OpenMP runtime, we simply build a single openmp derivation with both runtimes. Only a single build of the clang compiler is now required. Reviewed-by: Aleix Roca Nonell <aleix.rocanonell@bsc.es> Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
This commit is contained in:
57
pkgs/llvm-ompss2/openmp.nix
Normal file
57
pkgs/llvm-ompss2/openmp.nix
Normal file
@@ -0,0 +1,57 @@
|
||||
{ lib
|
||||
, llvmPackages_latest
|
||||
, monorepoSrc
|
||||
, runCommand
|
||||
, cmake
|
||||
, ninja
|
||||
, llvm
|
||||
, perl
|
||||
, pkg-config
|
||||
, version
|
||||
, nosv
|
||||
, enableDebug ? false
|
||||
}:
|
||||
|
||||
let
|
||||
stdenv = llvmPackages_latest.stdenv;
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "openmp";
|
||||
inherit version;
|
||||
|
||||
src = runCommand "${pname}-src" {} ''
|
||||
mkdir -p "$out"
|
||||
cp -r ${monorepoSrc}/cmake "$out"
|
||||
cp -r ${monorepoSrc}/${pname} "$out"
|
||||
'';
|
||||
|
||||
sourceRoot = "${src.name}/${pname}";
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
ninja
|
||||
perl
|
||||
pkg-config
|
||||
nosv
|
||||
];
|
||||
|
||||
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
|
||||
postInstall = ''
|
||||
rm -f $out/lib/libgomp*
|
||||
rm -f $out/lib/libiomp*
|
||||
'';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user