From 8c71431f1414fcddcbf6b41c4d8d76b4f01853fb Mon Sep 17 00:00:00 2001 From: Tristan Ross Date: Thu, 28 Mar 2024 11:28:13 -0700 Subject: [PATCH] llvmPackages_{12,13,14,15,16,17,18,git}: use common openmp --- .../development/compilers/llvm/12/default.nix | 11 ++- .../compilers/llvm/12/openmp/default.nix | 48 ------------ .../development/compilers/llvm/13/default.nix | 10 ++- .../compilers/llvm/13/openmp/default.nix | 53 ------------- .../development/compilers/llvm/14/default.nix | 6 +- .../compilers/llvm/14/openmp/default.nix | 69 ----------------- .../development/compilers/llvm/15/default.nix | 7 +- .../compilers/llvm/15/openmp/default.nix | 74 ------------------- .../development/compilers/llvm/16/default.nix | 7 +- .../development/compilers/llvm/17/default.nix | 7 +- .../compilers/llvm/17/openmp/default.nix | 74 ------------------- .../development/compilers/llvm/18/default.nix | 6 +- .../compilers/llvm/18/openmp/default.nix | 73 ------------------ .../llvm/{16 => common}/openmp/default.nix | 72 ++++++++++-------- .../compilers/llvm/git/default.nix | 6 +- .../compilers/llvm/git/openmp/default.nix | 73 ------------------ 16 files changed, 94 insertions(+), 502 deletions(-) delete mode 100644 pkgs/development/compilers/llvm/12/openmp/default.nix delete mode 100644 pkgs/development/compilers/llvm/13/openmp/default.nix delete mode 100644 pkgs/development/compilers/llvm/14/openmp/default.nix delete mode 100644 pkgs/development/compilers/llvm/15/openmp/default.nix delete mode 100644 pkgs/development/compilers/llvm/17/openmp/default.nix delete mode 100644 pkgs/development/compilers/llvm/18/openmp/default.nix rename pkgs/development/compilers/llvm/{16 => common}/openmp/default.nix (50%) delete mode 100644 pkgs/development/compilers/llvm/git/openmp/default.nix diff --git a/pkgs/development/compilers/llvm/12/default.nix b/pkgs/development/compilers/llvm/12/default.nix index bd87dc5f34f0..d9b1b7bb83f5 100644 --- a/pkgs/development/compilers/llvm/12/default.nix +++ b/pkgs/development/compilers/llvm/12/default.nix @@ -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; }; }); diff --git a/pkgs/development/compilers/llvm/12/openmp/default.nix b/pkgs/development/compilers/llvm/12/openmp/default.nix deleted file mode 100644 index 6040f3d1621a..000000000000 --- a/pkgs/development/compilers/llvm/12/openmp/default.nix +++ /dev/null @@ -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 ]; - }; -} diff --git a/pkgs/development/compilers/llvm/13/default.nix b/pkgs/development/compilers/llvm/13/default.nix index cd96231e62c3..bab1eab57e8b 100644 --- a/pkgs/development/compilers/llvm/13/default.nix +++ b/pkgs/development/compilers/llvm/13/default.nix @@ -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; }; }); diff --git a/pkgs/development/compilers/llvm/13/openmp/default.nix b/pkgs/development/compilers/llvm/13/openmp/default.nix deleted file mode 100644 index 7b461df438f9..000000000000 --- a/pkgs/development/compilers/llvm/13/openmp/default.nix +++ /dev/null @@ -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 ]; - }; -} diff --git a/pkgs/development/compilers/llvm/14/default.nix b/pkgs/development/compilers/llvm/14/default.nix index 66f5c7385a15..c6048aabf75e 100644 --- a/pkgs/development/compilers/llvm/14/default.nix +++ b/pkgs/development/compilers/llvm/14/default.nix @@ -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; }; }); diff --git a/pkgs/development/compilers/llvm/14/openmp/default.nix b/pkgs/development/compilers/llvm/14/openmp/default.nix deleted file mode 100644 index d1c6a46b4d69..000000000000 --- a/pkgs/development/compilers/llvm/14/openmp/default.nix +++ /dev/null @@ -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 ]; - }; -} diff --git a/pkgs/development/compilers/llvm/15/default.nix b/pkgs/development/compilers/llvm/15/default.nix index 0ccb9c449a8d..6af83d4db185 100644 --- a/pkgs/development/compilers/llvm/15/default.nix +++ b/pkgs/development/compilers/llvm/15/default.nix @@ -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; }; }); diff --git a/pkgs/development/compilers/llvm/15/openmp/default.nix b/pkgs/development/compilers/llvm/15/openmp/default.nix deleted file mode 100644 index d51335436ad2..000000000000 --- a/pkgs/development/compilers/llvm/15/openmp/default.nix +++ /dev/null @@ -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 ]; - }; -} diff --git a/pkgs/development/compilers/llvm/16/default.nix b/pkgs/development/compilers/llvm/16/default.nix index 66185071f22b..89801b595d16 100644 --- a/pkgs/development/compilers/llvm/16/default.nix +++ b/pkgs/development/compilers/llvm/16/default.nix @@ -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; }; }); diff --git a/pkgs/development/compilers/llvm/17/default.nix b/pkgs/development/compilers/llvm/17/default.nix index c8d956925345..ab6bff359cf6 100644 --- a/pkgs/development/compilers/llvm/17/default.nix +++ b/pkgs/development/compilers/llvm/17/default.nix @@ -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; }; }); diff --git a/pkgs/development/compilers/llvm/17/openmp/default.nix b/pkgs/development/compilers/llvm/17/openmp/default.nix deleted file mode 100644 index d51335436ad2..000000000000 --- a/pkgs/development/compilers/llvm/17/openmp/default.nix +++ /dev/null @@ -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 ]; - }; -} diff --git a/pkgs/development/compilers/llvm/18/default.nix b/pkgs/development/compilers/llvm/18/default.nix index dd3000c04259..0677f0eea8be 100644 --- a/pkgs/development/compilers/llvm/18/default.nix +++ b/pkgs/development/compilers/llvm/18/default.nix @@ -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; }; }); diff --git a/pkgs/development/compilers/llvm/18/openmp/default.nix b/pkgs/development/compilers/llvm/18/openmp/default.nix deleted file mode 100644 index e1c3c2379af2..000000000000 --- a/pkgs/development/compilers/llvm/18/openmp/default.nix +++ /dev/null @@ -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 ]; - }; -} diff --git a/pkgs/development/compilers/llvm/16/openmp/default.nix b/pkgs/development/compilers/llvm/common/openmp/default.nix similarity index 50% rename from pkgs/development/compilers/llvm/16/openmp/default.nix rename to pkgs/development/compilers/llvm/common/openmp/default.nix index d51335436ad2..7d9d813f024c 100644 --- a/pkgs/development/compilers/llvm/16/openmp/default.nix +++ b/pkgs/development/compilers/llvm/common/openmp/default.nix @@ -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 + ''; +})) diff --git a/pkgs/development/compilers/llvm/git/default.nix b/pkgs/development/compilers/llvm/git/default.nix index 80cff85372d0..14c2880eed95 100644 --- a/pkgs/development/compilers/llvm/git/default.nix +++ b/pkgs/development/compilers/llvm/git/default.nix @@ -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; }; }); diff --git a/pkgs/development/compilers/llvm/git/openmp/default.nix b/pkgs/development/compilers/llvm/git/openmp/default.nix deleted file mode 100644 index e1c3c2379af2..000000000000 --- a/pkgs/development/compilers/llvm/git/openmp/default.nix +++ /dev/null @@ -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 ]; - }; -}