llvmPackages_{12,13,14,15,16,17,18,git}: use common openmp

This commit is contained in:
Tristan Ross 2024-03-28 11:28:13 -07:00
parent 8a9bde6989
commit 8c71431f14
No known key found for this signature in database
GPG Key ID: B09C422035669AF8
16 changed files with 94 additions and 502 deletions

View File

@ -1,5 +1,6 @@
{ lowPrio, newScope, pkgs, lib, stdenv, cmake
, preLibcCrossHeaders
, fetchpatch
, libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith
, buildLlvmTools # tools, but from the previous stage, for cross
, targetLlvmLibraries # libraries, but from the next stage, for cross
@ -264,7 +265,15 @@ let
stdenv = overrideCC stdenv buildLlvmTools.clangNoLibcxx;
};
openmp = callPackage ./openmp {
openmp = callPackage ../common/openmp {
src = fetch "openmp" "14dh0r6h2xh747ffgnsl4z08h0ri04azi9vf79cbz7ma1r27kzk0";
patches = [
# Fix cross.
(fetchpatch {
url = "https://github.com/llvm/llvm-project/commit/5e2358c781b85a18d1463fd924d2741d4ae5e42e.patch";
hash = "sha256-UxIlAifXnexF/MaraPW0Ut6q+sf3e7y1fMdEv1q103A=";
})
];
inherit llvm_meta targetLlvm;
};
});

View File

@ -1,48 +0,0 @@
{ lib
, stdenv
, llvm_meta
, fetch
, fetchpatch
, cmake
, llvm
, targetLlvm
, perl
, version
}:
stdenv.mkDerivation rec {
pname = "openmp";
inherit version;
src = fetch pname "14dh0r6h2xh747ffgnsl4z08h0ri04azi9vf79cbz7ma1r27kzk0";
patches = [
# Fix cross.
(fetchpatch {
url = "https://github.com/llvm/llvm-project/commit/5e2358c781b85a18d1463fd924d2741d4ae5e42e.patch";
hash = "sha256-UxIlAifXnexF/MaraPW0Ut6q+sf3e7y1fMdEv1q103A=";
})
];
patchFlags = [ "-p2" ];
nativeBuildInputs = [ cmake perl ];
buildInputs = [
(if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm)
];
meta = llvm_meta // {
homepage = "https://openmp.llvm.org/";
description = "Support for the OpenMP language";
longDescription = ''
The OpenMP subproject of LLVM contains the components required to build an
executable OpenMP program that are outside the compiler itself.
Contains the code for the runtime library against which code compiled by
"clang -fopenmp" must be linked before it can run and the library that
supports offload to target devices.
'';
# "All of the code is dual licensed under the MIT license and the UIUC
# License (a BSD-like license)":
license = with lib.licenses; [ mit ncsa ];
};
}

View File

@ -1,5 +1,6 @@
{ lowPrio, newScope, pkgs, lib, stdenv, cmake
, preLibcCrossHeaders
, fetchpatch
, libxml2, python3, isl, fetchFromGitHub, overrideCC, wrapCCWith, wrapBintoolsWith
, buildLlvmTools # tools, but from the previous stage, for cross
, targetLlvmLibraries # libraries, but from the next stage, for cross
@ -304,7 +305,14 @@ in let
stdenv = overrideCC stdenv buildLlvmTools.clangNoLibcxx;
};
openmp = callPackage ./openmp {
openmp = callPackage ../common/openmp {
patches = [
# Fix cross.
(fetchpatch {
url = "https://github.com/llvm/llvm-project/commit/5e2358c781b85a18d1463fd924d2741d4ae5e42e.patch";
hash = "sha256-UxIlAifXnexF/MaraPW0Ut6q+sf3e7y1fMdEv1q103A=";
})
];
inherit llvm_meta targetLlvm;
};
});

View File

@ -1,53 +0,0 @@
{ lib
, stdenv
, llvm_meta
, src
, fetchpatch
, cmake
, llvm
, targetLlvm
, perl
, version
}:
stdenv.mkDerivation rec {
pname = "openmp";
inherit version;
inherit src;
sourceRoot = "${src.name}/${pname}";
patches = [
# Fix cross.
(fetchpatch {
url = "https://github.com/llvm/llvm-project/commit/5e2358c781b85a18d1463fd924d2741d4ae5e42e.patch";
hash = "sha256-UxIlAifXnexF/MaraPW0Ut6q+sf3e7y1fMdEv1q103A=";
})
];
patchFlags = [ "-p2" ];
nativeBuildInputs = [ cmake perl ];
buildInputs = [
(if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm)
];
cmakeFlags = [
"-DLIBOMPTARGET_BUILD_AMDGCN_BCLIB=OFF" # Building the AMDGCN device RTL currently fails
];
meta = llvm_meta // {
homepage = "https://openmp.llvm.org/";
description = "Support for the OpenMP language";
longDescription = ''
The OpenMP subproject of LLVM contains the components required to build an
executable OpenMP program that are outside the compiler itself.
Contains the code for the runtime library against which code compiled by
"clang -fopenmp" must be linked before it can run and the library that
supports offload to target devices.
'';
# "All of the code is dual licensed under the MIT license and the UIUC
# License (a BSD-like license)":
license = with lib.licenses; [ mit ncsa ];
};
}

View File

@ -302,7 +302,11 @@ in let
stdenv = overrideCC stdenv buildLlvmTools.clangNoLibcxx;
};
openmp = callPackage ./openmp {
openmp = callPackage ../common/openmp {
patches = [
./openmp/gnu-install-dirs.patch
./openmp/run-lit-directly.patch
];
inherit llvm_meta targetLlvm;
};
});

View File

@ -1,69 +0,0 @@
{ lib
, stdenv
, llvm_meta
, monorepoSrc
, runCommand
, cmake
, llvm
, targetLlvm
, lit
, clang-unwrapped
, perl
, pkg-config
, version
}:
stdenv.mkDerivation rec {
pname = "openmp";
inherit version;
src = runCommand "${pname}-src-${version}" {} ''
mkdir -p "$out"
cp -r ${monorepoSrc}/cmake "$out"
cp -r ${monorepoSrc}/${pname} "$out"
'';
sourceRoot = "${src.name}/${pname}";
patches = [
./gnu-install-dirs.patch
./run-lit-directly.patch
];
outputs = [ "out" "dev" ];
nativeBuildInputs = [ cmake perl pkg-config lit ];
buildInputs = [
(if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm)
];
# Unsup:Pass:XFail:Fail
# 26:267:16:8
doCheck = false;
checkTarget = "check-openmp";
preCheck = ''
patchShebangs ../tools/archer/tests/deflake.bash
'';
cmakeFlags = [
"-DCLANG_TOOL=${clang-unwrapped}/bin/clang"
"-DOPT_TOOL=${llvm}/bin/opt"
"-DLINK_TOOL=${llvm}/bin/llvm-link"
];
meta = llvm_meta // {
homepage = "https://openmp.llvm.org/";
description = "Support for the OpenMP language";
longDescription = ''
The OpenMP subproject of LLVM contains the components required to build an
executable OpenMP program that are outside the compiler itself.
Contains the code for the runtime library against which code compiled by
"clang -fopenmp" must be linked before it can run and the library that
supports offload to target devices.
'';
# "All of the code is dual licensed under the MIT license and the UIUC
# License (a BSD-like license)":
license = with lib.licenses; [ mit ncsa ];
};
}

View File

@ -320,7 +320,12 @@ in let
stdenv = overrideCC stdenv buildLlvmTools.clangNoLibcxx;
};
openmp = callPackage ./openmp {
openmp = callPackage ../common/openmp {
patches = [
./openmp/fix-find-tool.patch
./openmp/gnu-install-dirs.patch
./openmp/run-lit-directly.patch
];
inherit llvm_meta targetLlvm;
};
});

View File

@ -1,74 +0,0 @@
{ lib
, stdenv
, llvm_meta
, monorepoSrc
, runCommand
, cmake
, ninja
, llvm
, targetLlvm
, lit
, clang-unwrapped
, perl
, pkg-config
, xcbuild
, version
}:
stdenv.mkDerivation rec {
pname = "openmp";
inherit version;
src = runCommand "${pname}-src-${version}" {} ''
mkdir -p "$out"
cp -r ${monorepoSrc}/cmake "$out"
cp -r ${monorepoSrc}/${pname} "$out"
'';
sourceRoot = "${src.name}/${pname}";
patches = [
./fix-find-tool.patch
./gnu-install-dirs.patch
./run-lit-directly.patch
];
outputs = [ "out" "dev" ];
nativeBuildInputs = [ cmake ninja perl pkg-config lit ];
buildInputs = [
(if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm)
];
nativeCheckInputs = lib.optional stdenv.hostPlatform.isDarwin xcbuild.xcrun;
# Unsup:Pass:XFail:Fail
# 26:267:16:8
doCheck = false;
checkTarget = "check-openmp";
preCheck = ''
patchShebangs ../tools/archer/tests/deflake.bash
'';
cmakeFlags = [
"-DCLANG_TOOL=${clang-unwrapped}/bin/clang"
"-DOPT_TOOL=${llvm}/bin/opt"
"-DLINK_TOOL=${llvm}/bin/llvm-link"
];
meta = llvm_meta // {
homepage = "https://openmp.llvm.org/";
description = "Support for the OpenMP language";
longDescription = ''
The OpenMP subproject of LLVM contains the components required to build an
executable OpenMP program that are outside the compiler itself.
Contains the code for the runtime library against which code compiled by
"clang -fopenmp" must be linked before it can run and the library that
supports offload to target devices.
'';
# "All of the code is dual licensed under the MIT license and the UIUC
# License (a BSD-like license)":
license = with lib.licenses; [ mit ncsa ];
};
}

View File

@ -335,7 +335,12 @@ in let
stdenv = overrideCC stdenv buildLlvmTools.clangNoLibcxx;
};
openmp = callPackage ./openmp {
openmp = callPackage ../common/openmp {
patches = [
./openmp/fix-find-tool.patch
./openmp/gnu-install-dirs.patch
./openmp/run-lit-directly.patch
];
inherit llvm_meta targetLlvm;
};
});

View File

@ -320,7 +320,12 @@ in let
stdenv = overrideCC stdenv buildLlvmTools.clangNoLibcxx;
};
openmp = callPackage ./openmp {
openmp = callPackage ../common/openmp {
patches = [
./openmp/fix-find-tool.patch
./openmp/gnu-install-dirs.patch
./openmp/run-lit-directly.patch
];
inherit llvm_meta targetLlvm;
};
});

View File

@ -1,74 +0,0 @@
{ lib
, stdenv
, llvm_meta
, monorepoSrc
, runCommand
, cmake
, ninja
, llvm
, targetLlvm
, lit
, clang-unwrapped
, perl
, pkg-config
, xcbuild
, version
}:
stdenv.mkDerivation rec {
pname = "openmp";
inherit version;
src = runCommand "${pname}-src-${version}" {} ''
mkdir -p "$out"
cp -r ${monorepoSrc}/cmake "$out"
cp -r ${monorepoSrc}/${pname} "$out"
'';
sourceRoot = "${src.name}/${pname}";
patches = [
./fix-find-tool.patch
./gnu-install-dirs.patch
./run-lit-directly.patch
];
outputs = [ "out" "dev" ];
nativeBuildInputs = [ cmake ninja perl pkg-config lit ];
buildInputs = [
(if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm)
];
nativeCheckInputs = lib.optional stdenv.hostPlatform.isDarwin xcbuild.xcrun;
# Unsup:Pass:XFail:Fail
# 26:267:16:8
doCheck = false;
checkTarget = "check-openmp";
preCheck = ''
patchShebangs ../tools/archer/tests/deflake.bash
'';
cmakeFlags = [
"-DCLANG_TOOL=${clang-unwrapped}/bin/clang"
"-DOPT_TOOL=${llvm}/bin/opt"
"-DLINK_TOOL=${llvm}/bin/llvm-link"
];
meta = llvm_meta // {
homepage = "https://openmp.llvm.org/";
description = "Support for the OpenMP language";
longDescription = ''
The OpenMP subproject of LLVM contains the components required to build an
executable OpenMP program that are outside the compiler itself.
Contains the code for the runtime library against which code compiled by
"clang -fopenmp" must be linked before it can run and the library that
supports offload to target devices.
'';
# "All of the code is dual licensed under the MIT license and the UIUC
# License (a BSD-like license)":
license = with lib.licenses; [ mit ncsa ];
};
}

View File

@ -320,7 +320,11 @@ in let
stdenv = overrideCC stdenv buildLlvmTools.clangNoLibcxx;
};
openmp = callPackage ./openmp {
openmp = callPackage ../common/openmp {
patches = [
./openmp/fix-find-tool.patch
./openmp/run-lit-directly.patch
];
inherit llvm_meta targetLlvm;
};
});

View File

@ -1,73 +0,0 @@
{ lib
, stdenv
, llvm_meta
, monorepoSrc
, runCommand
, cmake
, ninja
, llvm
, targetLlvm
, lit
, clang-unwrapped
, perl
, pkg-config
, xcbuild
, version
}:
stdenv.mkDerivation rec {
pname = "openmp";
inherit version;
src = runCommand "${pname}-src-${version}" {} ''
mkdir -p "$out"
cp -r ${monorepoSrc}/cmake "$out"
cp -r ${monorepoSrc}/${pname} "$out"
'';
sourceRoot = "${src.name}/${pname}";
patches = [
./fix-find-tool.patch
./run-lit-directly.patch
];
outputs = [ "out" "dev" ];
nativeBuildInputs = [ cmake ninja perl pkg-config lit ];
buildInputs = [
(if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm)
];
nativeCheckInputs = lib.optional stdenv.hostPlatform.isDarwin xcbuild.xcrun;
# Unsup:Pass:XFail:Fail
# 26:267:16:8
doCheck = false;
checkTarget = "check-openmp";
preCheck = ''
patchShebangs ../tools/archer/tests/deflake.bash
'';
cmakeFlags = [
"-DCLANG_TOOL=${clang-unwrapped}/bin/clang"
"-DOPT_TOOL=${llvm}/bin/opt"
"-DLINK_TOOL=${llvm}/bin/llvm-link"
];
meta = llvm_meta // {
homepage = "https://openmp.llvm.org/";
description = "Support for the OpenMP language";
longDescription = ''
The OpenMP subproject of LLVM contains the components required to build an
executable OpenMP program that are outside the compiler itself.
Contains the code for the runtime library against which code compiled by
"clang -fopenmp" must be linked before it can run and the library that
supports offload to target devices.
'';
# "All of the code is dual licensed under the MIT license and the UIUC
# License (a BSD-like license)":
license = with lib.licenses; [ mit ncsa ];
};
}

View File

@ -1,7 +1,10 @@
{ lib
, stdenv
, llvm_meta
, monorepoSrc
, release_version
, patches ? []
, monorepoSrc ? null
, src ? null
, runCommand
, cmake
, ninja
@ -14,44 +17,47 @@
, xcbuild
, version
}:
stdenv.mkDerivation rec {
let
pname = "openmp";
inherit version;
src' =
if monorepoSrc != null then
runCommand "${pname}-src-${version}" {} ''
mkdir -p "$out"
cp -r ${monorepoSrc}/cmake "$out"
cp -r ${monorepoSrc}/${pname} "$out"
'' else src;
in
stdenv.mkDerivation (rec {
inherit pname version patches;
src = runCommand "${pname}-src-${version}" {} ''
mkdir -p "$out"
cp -r ${monorepoSrc}/cmake "$out"
cp -r ${monorepoSrc}/${pname} "$out"
'';
src = src';
sourceRoot = "${src.name}/${pname}";
sourceRoot =
if lib.versionOlder release_version "13" then null
else "${src.name}/${pname}";
patches = [
./fix-find-tool.patch
./gnu-install-dirs.patch
./run-lit-directly.patch
outputs = [ "out" ]
++ lib.optionals (lib.versionAtLeast release_version "14") [ "dev" ];
patchFlags =
if lib.versionOlder release_version "14" then [ "-p2" ]
else null;
nativeBuildInputs = [
cmake
] ++ lib.optionals (lib.versionAtLeast release_version "15") [
ninja
] ++ [ perl ] ++ lib.optionals (lib.versionAtLeast release_version "14") [
pkg-config lit
];
outputs = [ "out" "dev" ];
nativeBuildInputs = [ cmake ninja perl pkg-config lit ];
buildInputs = [
(if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm)
];
nativeCheckInputs = lib.optional stdenv.hostPlatform.isDarwin xcbuild.xcrun;
# Unsup:Pass:XFail:Fail
# 26:267:16:8
doCheck = false;
checkTarget = "check-openmp";
preCheck = ''
patchShebangs ../tools/archer/tests/deflake.bash
'';
cmakeFlags = [
cmakeFlags = lib.optionals (lib.versions.major release_version == "13") [
"-DLIBOMPTARGET_BUILD_AMDGCN_BCLIB=OFF" # Building the AMDGCN device RTL fails
] ++ lib.optionals (lib.versionAtLeast release_version "14") [
"-DCLANG_TOOL=${clang-unwrapped}/bin/clang"
"-DOPT_TOOL=${llvm}/bin/opt"
"-DLINK_TOOL=${llvm}/bin/llvm-link"
@ -71,4 +77,10 @@ stdenv.mkDerivation rec {
# License (a BSD-like license)":
license = with lib.licenses; [ mit ncsa ];
};
}
} // (lib.optionalAttrs (lib.versionAtLeast release_version "14") {
doCheck = false;
checkTarget = "check-openmp";
preCheck = ''
patchShebangs ../tools/archer/tests/deflake.bash
'';
}))

View File

@ -325,7 +325,11 @@ in let
stdenv = overrideCC stdenv buildLlvmTools.clangNoLibcxx;
};
openmp = callPackage ./openmp {
openmp = callPackage ../common/openmp {
patches = [
./openmp/fix-find-tool.patch
./openmp/run-lit-directly.patch
];
inherit llvm_meta targetLlvm;
};
});

View File

@ -1,73 +0,0 @@
{ lib
, stdenv
, llvm_meta
, monorepoSrc
, runCommand
, cmake
, ninja
, llvm
, targetLlvm
, lit
, clang-unwrapped
, perl
, pkg-config
, xcbuild
, version
}:
stdenv.mkDerivation rec {
pname = "openmp";
inherit version;
src = runCommand "${pname}-src-${version}" {} ''
mkdir -p "$out"
cp -r ${monorepoSrc}/cmake "$out"
cp -r ${monorepoSrc}/${pname} "$out"
'';
sourceRoot = "${src.name}/${pname}";
patches = [
./fix-find-tool.patch
./run-lit-directly.patch
];
outputs = [ "out" "dev" ];
nativeBuildInputs = [ cmake ninja perl pkg-config lit ];
buildInputs = [
(if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm)
];
nativeCheckInputs = lib.optional stdenv.hostPlatform.isDarwin xcbuild.xcrun;
# Unsup:Pass:XFail:Fail
# 26:267:16:8
doCheck = false;
checkTarget = "check-openmp";
preCheck = ''
patchShebangs ../tools/archer/tests/deflake.bash
'';
cmakeFlags = [
"-DCLANG_TOOL=${clang-unwrapped}/bin/clang"
"-DOPT_TOOL=${llvm}/bin/opt"
"-DLINK_TOOL=${llvm}/bin/llvm-link"
];
meta = llvm_meta // {
homepage = "https://openmp.llvm.org/";
description = "Support for the OpenMP language";
longDescription = ''
The OpenMP subproject of LLVM contains the components required to build an
executable OpenMP program that are outside the compiler itself.
Contains the code for the runtime library against which code compiled by
"clang -fopenmp" must be linked before it can run and the library that
supports offload to target devices.
'';
# "All of the code is dual licensed under the MIT license and the UIUC
# License (a BSD-like license)":
license = with lib.licenses; [ mit ncsa ];
};
}