Skip to content

Commit

Permalink
Merge pull request NixOS#75946 from davidtwco/computecpp-init
Browse files Browse the repository at this point in the history
computecpp: init at 1.2.0
  • Loading branch information
Mic92 authored Jan 17, 2020
2 parents e6fad86 + 853372b commit b4d4f83
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
52 changes: 52 additions & 0 deletions pkgs/development/compilers/computecpp/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{ stdenv
, fetchzip
, pkg-config
, autoPatchelfHook
, installShellFiles
, ncurses5
, ocl-icd
, zlib
}:

stdenv.mkDerivation rec {
pname = "computecpp";
version = "1.2.0";

src = fetchzip {
url = "https://computecpp.codeplay.com/downloads/computecpp-ce/${version}/ubuntu-16.04-64bit.tar.gz";
sha256 = "191kwvzxfg1sbaq6aw6f84chi7bhsibb2a63zsyz3gz8m0c0syr5";
stripRoot = true;
};

dontStrip = true;

buildInputs = [ stdenv.cc.cc.lib ncurses5 ocl-icd zlib ];
nativeBuildInputs = [ autoPatchelfHook pkg-config installShellFiles ];

installPhase = ''
runHook preInstall
find ./lib -type f -exec install -D -m 0755 {} -t $out/lib \;
find ./bin -type l -exec install -D -m 0755 {} -t $out/bin \;
find ./bin -type f -exec install -D -m 0755 {} -t $out/bin \;
find ./doc -type f -exec install -D -m 0644 {} -t $out/doc \;
find ./include -type f -exec install -D -m 0644 {} -t $out/include \;
runHook postInstall
'';

passthru = {
isClang = true;
} // stdenv.lib.optionalAttrs (stdenv.targetPlatform.isLinux || (stdenv.cc.isGNU && stdenv.cc.cc ? gcc)) {
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
};

meta = with stdenv.lib; {
description =
"Accelerate Complex C++ Applications on Heterogeneous Compute Systems using Open Standards";
homepage = https://www.codeplay.com/products/computesuite/computecpp;
license = licenses.unfree;
maintainers = with maintainers; [ davidtwco ];
platforms = [ "x86_64-linux" ];
};
}
22 changes: 22 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7811,6 +7811,28 @@ in

compcert = callPackage ../development/compilers/compcert { };

computecpp-unwrapped = callPackage ../development/compilers/computecpp {};
computecpp = wrapCCWith rec {
cc = computecpp-unwrapped;
extraPackages = [
libstdcxxHook
llvmPackages.compiler-rt
];
extraBuildCommands = ''
wrap compute $wrapper $ccPath/compute
wrap compute++ $wrapper $ccPath/compute++
export named_cc=compute
export named_cxx=compute++

rsrc="$out/resource-root"
mkdir -p "$rsrc/lib"
ln -s "${cc}/lib" "$rsrc/include"
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && cc ? gcc && !(stdenv.targetPlatform.useLLVM or false)) ''
echo "--gcc-toolchain=${cc.gcc}" >> $out/nix-support/cc-cflags
'';
};

cryptol = haskell.lib.justStaticExecutables haskellPackages.cryptol;

inherit (callPackages ../development/compilers/crystal {
Expand Down

0 comments on commit b4d4f83

Please sign in to comment.