Commit 110af7ef authored by Alyssa Ross's avatar Alyssa Ross
Browse files

Reapply "llvmPackages.openmp: Make OMPD customisable, add missing Python dependency"

This reverts commit fa648b28.

Mass rebuild accidentally merged to master, now being resubmitted to
staging.  Python had been added as an unconditionial build input on
staging in 261db7ef ("llvmPackages.openmp: fix cross build"), but
we're keeping it conditional here per discussion with the author of
that change.

Link: https://github.com/NixOS/nixpkgs/pull/380299#issuecomment-2645492202
parent 0eaae105
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -17,7 +17,12 @@
, python3
, version
, devExtraCmakeFlags ? []
, ompdSupport ? true
, ompdGdbSupport ? ompdSupport
}:

assert lib.assertMsg (ompdGdbSupport -> ompdSupport) "OMPD GDB support requires OMPD support!";

let
  pname = "openmp";
  src' =
@@ -55,10 +60,14 @@ stdenv.mkDerivation (rec {

  buildInputs = [
    (if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm)
  ] ++ lib.optionals (ompdSupport && ompdGdbSupport) [
    python3
  ];

  cmakeFlags = lib.optionals (lib.versions.major release_version == "13") [
  cmakeFlags = [
    (lib.cmakeBool "LIBOMP_OMPD_SUPPORT" ompdSupport)
    (lib.cmakeBool "LIBOMP_OMPD_GDB_SUPPORT" ompdGdbSupport)
  ] ++ 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"