nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, stdenv
3, llvm_meta
4, monorepoSrc
5, runCommand
6, cmake
7, llvm
8, targetLlvm
9, lit
10, clang-unwrapped
11, perl
12, pkg-config
13, version
14}:
15
16stdenv.mkDerivation rec {
17 pname = "openmp";
18 inherit version;
19
20 src = runCommand "${pname}-src-${version}" {} ''
21 mkdir -p "$out"
22 cp -r ${monorepoSrc}/cmake "$out"
23 cp -r ${monorepoSrc}/${pname} "$out"
24 '';
25
26 sourceRoot = "${src.name}/${pname}";
27
28 patches = [
29 ./gnu-install-dirs.patch
30 ./run-lit-directly.patch
31 ];
32
33 outputs = [ "out" "dev" ];
34
35 nativeBuildInputs = [ cmake perl pkg-config lit ];
36 buildInputs = [
37 (if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm)
38 ];
39
40 # Unsup:Pass:XFail:Fail
41 # 26:267:16:8
42 doCheck = false;
43 checkTarget = "check-openmp";
44
45 preCheck = ''
46 patchShebangs ../tools/archer/tests/deflake.bash
47 '';
48
49 cmakeFlags = [
50 "-DCLANG_TOOL=${clang-unwrapped}/bin/clang"
51 "-DOPT_TOOL=${llvm}/bin/opt"
52 "-DLINK_TOOL=${llvm}/bin/llvm-link"
53 ];
54
55 meta = llvm_meta // {
56 homepage = "https://openmp.llvm.org/";
57 description = "Support for the OpenMP language";
58 longDescription = ''
59 The OpenMP subproject of LLVM contains the components required to build an
60 executable OpenMP program that are outside the compiler itself.
61 Contains the code for the runtime library against which code compiled by
62 "clang -fopenmp" must be linked before it can run and the library that
63 supports offload to target devices.
64 '';
65 # "All of the code is dual licensed under the MIT license and the UIUC
66 # License (a BSD-like license)":
67 license = with lib.licenses; [ mit ncsa ];
68 };
69}