about summary refs log tree commit diff
path: root/pkgs/development/rocm-modules/6/llvm/stage-3/openmp.nix
blob: 5fd7b6fd9aa3d0598d1906ed8c84aaa0672da6da (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{ lib
, stdenv
, callPackage
, rocmUpdateScript
, llvm
, clang
, clang-unwrapped
, rocm-device-libs
, rocm-runtime
, rocm-thunk
, perl
, elfutils
, libdrm
, numactl
, lit
}:

callPackage ../base.nix rec {
  inherit stdenv rocmUpdateScript;
  targetName = "openmp";
  targetDir = targetName;
  extraNativeBuildInputs = [ perl ];

  extraBuildInputs = [
    rocm-device-libs
    rocm-runtime
    rocm-thunk
    elfutils
    libdrm
    numactl
  ];

  extraCMakeFlags = [
    "-DCMAKE_MODULE_PATH=/build/source/llvm/cmake/modules" # For docs
    "-DCLANG_TOOL=${clang}/bin/clang"
    "-DCLANG_OFFLOAD_BUNDLER_TOOL=${clang-unwrapped}/bin/clang-offload-bundler"
    "-DPACKAGER_TOOL=${clang-unwrapped}/bin/clang-offload-packager"
    "-DOPENMP_LLVM_TOOLS_DIR=${llvm}/bin"
    "-DOPENMP_LLVM_LIT_EXECUTABLE=${lit}/bin/.lit-wrapped"
    "-DDEVICELIBS_ROOT=${rocm-device-libs.src}"
  ];

  extraPostPatch = ''
    # We can't build this target at the moment
    substituteInPlace libomptarget/DeviceRTL/CMakeLists.txt \
      --replace "gfx1010" ""

    # No idea what's going on here...
    cat ${./1000-openmp-failing-tests.list} | xargs -d \\n rm
  '';

  checkTargets = [ "check-${targetName}" ];
  extraLicenses = [ lib.licenses.mit ];
}