2019-10-09 12:17:01 +01:00
|
|
|
{stdenv, fetchFromGitHub, cmake, which, m4, python, bison, flex, llvmPackages,
|
2019-10-02 18:29:29 +01:00
|
|
|
testedTargets ? ["sse2"] # the default test target is sse4, but that is not supported by all Hydra agents
|
2016-09-04 16:03:34 +01:00
|
|
|
}:
|
2015-11-28 20:28:27 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-01-19 06:18:04 +00:00
|
|
|
version = "1.10.0";
|
2018-01-15 11:25:03 +00:00
|
|
|
rev = "v${version}";
|
2015-11-28 20:28:27 +00:00
|
|
|
|
2016-09-04 16:03:34 +01:00
|
|
|
inherit testedTargets;
|
|
|
|
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "ispc";
|
2015-11-28 20:28:27 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ispc";
|
|
|
|
repo = "ispc";
|
|
|
|
inherit rev;
|
2019-01-19 06:18:04 +00:00
|
|
|
sha256 = "1x07n2gaff3v32yvddrb659mx5gg12bnbsqbyfimp396wn04w60b";
|
2015-11-28 20:28:27 +00:00
|
|
|
};
|
|
|
|
|
2019-11-03 21:20:00 +00:00
|
|
|
doCheck = stdenv.isLinux;
|
2015-11-28 20:28:27 +00:00
|
|
|
|
2019-10-09 12:17:01 +01:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2015-11-28 20:28:27 +00:00
|
|
|
buildInputs = with llvmPackages; [
|
|
|
|
which
|
|
|
|
m4
|
|
|
|
python
|
|
|
|
bison
|
2017-07-29 18:42:44 +01:00
|
|
|
flex
|
2015-11-28 20:28:27 +00:00
|
|
|
llvm
|
2016-09-04 11:20:03 +01:00
|
|
|
llvmPackages.clang-unwrapped # we need to link against libclang, so we need the unwrapped
|
2015-11-28 20:28:27 +00:00
|
|
|
];
|
|
|
|
|
2019-10-09 12:17:01 +01:00
|
|
|
postPatch = "sed -i -e 's/curses/ncurses/g' CMakeLists.txt";
|
2015-11-28 20:28:27 +00:00
|
|
|
|
2016-09-04 14:56:07 +01:00
|
|
|
# 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" )
|
|
|
|
#'';
|
|
|
|
|
2015-11-28 20:28:27 +00:00
|
|
|
checkPhase = ''
|
2019-10-09 12:17:01 +01:00
|
|
|
export ISPC_HOME=$PWD/bin
|
2016-09-04 16:03:34 +01:00
|
|
|
for target in $testedTargets
|
|
|
|
do
|
|
|
|
echo "Testing target $target"
|
|
|
|
echo "================================"
|
|
|
|
echo
|
2019-10-09 12:17:01 +01:00
|
|
|
(cd ../
|
|
|
|
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)
|
2016-09-04 16:03:34 +01:00
|
|
|
done
|
2015-11-28 20:28:27 +00:00
|
|
|
'';
|
|
|
|
|
2019-10-09 12:17:01 +01:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DCLANG_EXECUTABLE=${llvmPackages.clang}/bin/clang"
|
|
|
|
"-DISPC_INCLUDE_EXAMPLES=OFF"
|
|
|
|
"-DISPC_INCLUDE_UTILS=OFF"
|
2015-11-28 20:28:27 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = https://ispc.github.io/ ;
|
|
|
|
description = "Intel 'Single Program, Multiple Data' Compiler, a vectorised language";
|
|
|
|
license = licenses.bsd3;
|
2019-10-09 11:16:55 +01:00
|
|
|
platforms = ["x86_64-linux" "x86_64-darwin"]; # TODO: buildable on more platforms?
|
2015-11-28 20:28:27 +00:00
|
|
|
maintainers = [ maintainers.aristid ];
|
|
|
|
};
|
|
|
|
}
|