2016-09-04 12:20:03 +02:00
|
|
|
{stdenv, fetchFromGitHub, which, m4, python, bison, flex, llvmPackages, clangWrapSelf}:
|
2015-11-28 21:28:27 +01:00
|
|
|
|
2016-09-04 12:20:03 +02:00
|
|
|
# TODO: patch LLVM so Skylake-EX works better (patch included in ispc github) - needed for LLVM 3.9?
|
2015-11-28 21:28:27 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-09-04 12:20:03 +02:00
|
|
|
version = "1.9.1";
|
|
|
|
rev = "v${version}";
|
2015-11-28 21:28:27 +01:00
|
|
|
|
|
|
|
name = "ispc-${version}";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ispc";
|
|
|
|
repo = "ispc";
|
|
|
|
inherit rev;
|
2016-09-04 12:20:03 +02:00
|
|
|
sha256 = "1wwsyvn44hd5iyi5779l5378x096307slpyl29wrsmfp66796693";
|
2015-11-28 21:28:27 +01:00
|
|
|
};
|
|
|
|
|
2016-09-04 12:20:03 +02:00
|
|
|
enableParallelBuilding = true;
|
2015-11-28 21:28:27 +01:00
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
buildInputs = with llvmPackages; [
|
|
|
|
which
|
|
|
|
m4
|
|
|
|
python
|
|
|
|
bison
|
|
|
|
flex
|
|
|
|
llvm
|
2016-09-04 12:20:03 +02:00
|
|
|
llvmPackages.clang-unwrapped # we need to link against libclang, so we need the unwrapped
|
2015-11-28 21:28:27 +01:00
|
|
|
];
|
|
|
|
|
2016-03-24 18:12:49 +01:00
|
|
|
postPatch = "sed -i -e 's/\\/bin\\///g' -e 's/-lcurses/-lncurses/g' Makefile";
|
2015-11-28 21:28:27 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp ispc $out/bin
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
export ISPC_HOME=$PWD
|
2016-09-04 12:20:03 +02:00
|
|
|
PATH=${llvmPackages.clang}/bin:$PATH python run_tests.py --non-interactive
|
2015-11-28 21:28:27 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags = [
|
2016-09-04 12:20:03 +02:00
|
|
|
"CXX=${llvmPackages.clang}/bin/clang++"
|
|
|
|
"CLANG=${llvmPackages.clang}/bin/clang"
|
2015-11-28 21:28:27 +01:00
|
|
|
"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 ];
|
|
|
|
};
|
|
|
|
}
|