nixpkgs/pkgs/development/compilers/ispc/default.nix

76 lines
2.1 KiB
Nix
Raw Normal View History

2016-09-04 16:03:34 +01:00
{stdenv, fetchFromGitHub, bash, which, m4, python, bison, flex, llvmPackages, clangWrapSelf,
testedTargets ? ["sse2" "host"] # the default test target is sse4, but that is not supported by all Hydra agents
2016-09-04 16:03:34 +01:00
}:
2016-09-04 11:20:03 +01:00
# TODO: patch LLVM so Skylake-EX works better (patch included in ispc github) - needed for LLVM 3.9?
stdenv.mkDerivation rec {
2016-09-04 11:20:03 +01:00
version = "1.9.1";
rev = "v${version}";
2016-09-04 16:03:34 +01:00
inherit testedTargets;
name = "ispc-${version}";
src = fetchFromGitHub {
owner = "ispc";
repo = "ispc";
inherit rev;
2016-09-04 11:20:03 +01:00
sha256 = "1wwsyvn44hd5iyi5779l5378x096307slpyl29wrsmfp66796693";
};
# there are missing dependencies in the Makefile, causing sporadic build failures
enableParallelBuilding = false;
doCheck = true;
buildInputs = with llvmPackages; [
which
m4
python
bison
flex
llvm
2016-09-04 11:20:03 +01:00
llvmPackages.clang-unwrapped # we need to link against libclang, so we need the unwrapped
];
2016-03-24 17:12:49 +00:00
postPatch = "sed -i -e 's/\\/bin\\///g' -e 's/-lcurses/-lncurses/g' Makefile";
# TODO: this correctly catches errors early, but also some things that are just weird and don't seem to be real
# errors
#configurePhase = ''
# makeFlagsArray=( SHELL="${bash}/bin/bash -o pipefail" )
#'';
installPhase = ''
mkdir -p $out/bin
cp ispc $out/bin
'';
checkPhase = ''
export ISPC_HOME=$PWD
2016-09-04 16:03:34 +01:00
for target in $testedTargets
do
echo "Testing target $target"
echo "================================"
echo
PATH=${llvmPackages.clang}/bin:$PATH python run_tests.py -t $target --non-interactive --verbose --file=test_output.log
fgrep -q "No new fails" test_output.log || exit 1
done
'';
makeFlags = [
2016-09-04 11:20:03 +01:00
"CXX=${llvmPackages.clang}/bin/clang++"
"CLANG=${llvmPackages.clang}/bin/clang"
"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 = ["x86_64-linux"]; # TODO: buildable on more platforms?
maintainers = [ maintainers.aristid ];
};
}