summary refs log tree commit diff
path: root/pkgs/development/compilers/ispc/default.nix
blob: 08f0d7e06b131beab0ba0fec4a4661f31f98a7cb (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
55
56
57
58
{stdenv, fetchFromGitHub, which, m4, python, bison, flex, llvmPackages}:

# TODO: patch LLVM so Knights Landing works better (patch included in ispc github)

stdenv.mkDerivation rec {
  version = "20151128";
  rev = "d3020580ff18836de2d4cae18901980b551d9d01";

  name = "ispc-${version}";

  src = fetchFromGitHub {
    owner = "ispc";
    repo = "ispc";
    inherit rev;
    sha256 = "15qi22qvmlx3jrhrf3rwl0y77v66prpan6qb66a55dw3pw2d4jvn";
  };

  enableParallelBuilding = false;

  doCheck = true;

  buildInputs = with llvmPackages; [
    which
    m4
    python
    bison
    flex
    llvm
    clang
  ];

  # https://github.com/ispc/ispc/pull/1190
  patches = [ ./gcc5.patch ];

  postPatch = "sed -i -e 's/\\/bin\\///g' -e 's/-lcurses/-lncurses/g' Makefile";

  installPhase = ''
    mkdir -p $out/bin
    cp ispc $out/bin
  '';

  checkPhase = ''
    export ISPC_HOME=$PWD
    python run_tests.py
  '';

  makeFlags = [
    "CLANG_INCLUDE=${llvmPackages.clang-unwrapped}/include"
    ];

  meta = with stdenv.lib; {
    homepage = https://ispc.github.io/ ;
    description = "Intel 'Single Program, Multiple Data' Compiler, a vectorised language";
    license = licenses.bsd3;
    platforms = platforms.unix;
    maintainers = [ maintainers.aristid ];
  };
}