Compare commits

...

3 Commits

4 changed files with 91 additions and 8 deletions

View File

@ -10,6 +10,9 @@ let
"printf '%s\n' ${toString (collect (x: x ? outPath) pkgs)} > $out";
bscPkgs = {
aoccUnwrapped = callPackage ./pkgs/aocc/unwrapped.nix { };
aocc = callPackage ./pkgs/aocc/default.nix { };
stdenvAocc = final.overrideCC final.stdenv final.aocc;
bench6 = callPackage ./pkgs/bench6/default.nix { };
bigotes = callPackage ./pkgs/bigotes/default.nix { };
clangOmpss2 = callPackage ./pkgs/llvm-ompss2/default.nix { };

29
pkgs/aocc/default.nix Normal file
View File

@ -0,0 +1,29 @@
{ lib
, aoccUnwrapped
, wrapCCWith
}:
let
cc = aoccUnwrapped;
stdenv = aoccUnwrapped.stdenv;
targetConfig = stdenv.targetPlatform.config;
gcc = stdenv.cc;
in wrapCCWith {
inherit cc;
extraBuildCommands = ''
echo "-isystem ${cc}/include" >> $out/nix-support/cc-cflags
echo "-L${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-ldflags
echo "-L${gcc.cc.lib}/lib" >> $out/nix-support/cc-ldflags
echo "-L${cc}/lib" >> $out/nix-support/cc-ldflags
# Need the gcc in the path
echo 'export "PATH=${gcc}/bin:$PATH"' >> $out/nix-support/cc-wrapper-hook
# Disable hardening by default
echo "" > $out/nix-support/add-hardening.sh
'';
}

47
pkgs/aocc/unwrapped.nix Normal file
View File

@ -0,0 +1,47 @@
{ lib
, fetchurl
, stdenv
, autoPatchelfHook
, rocmPackages
, zlib
, libffi
, elfutils
}:
let
# in newer nixpkgs the runtime is hsakmt
rocmRuntime = if rocmPackages ? hsakmt then
rocmPackages.hsakmt
else
rocmPackages.rocm-runtime;
in
stdenv.mkDerivation (finalAttrs: {
pname = "aocc-compiler";
version = "5.0.0";
src = fetchurl {
url = "https://download.amd.com/developer/eula/aocc/aocc-5-0/aocc-compiler-5.0.0.tar";
sha256 = "sha256-lm+sLSx1np3m6WnBCtp6ezBsET9/HgfqN2gp7IY4Dao=";
};
nativeBuildInputs = [ autoPatchelfHook ];
buildInputs = [
elfutils
zlib
rocmRuntime
stdenv.cc.cc.lib
];
phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
dontStrip = true;
installPhase = ''
mkdir -p $out
cp -a . $out/
ln -s ${lib.getLib libffi}/lib/libffi.so $out/lib/libffi.so.6
'';
passthru = {
isClang = true;
};
})

View File

@ -43,23 +43,23 @@ let
source = if (useGit) then git else release;
in stdenv.mkDerivation rec {
in stdenv.mkDerivation {
pname = "clang-ompss2";
inherit (source) src version;
enableParallelBuilding = true;
isClang = true;
passthru = {
CC = "clang";
CXX = "clang++";
isClang = true;
isClangWithOmpss = true;
inherit gcc zlib;
};
isClangWithOmpss = true;
nativeBuildInputs = [ zlib ];
buildInputs = [
nativeBuildInputs = [
which
bash
python3
@ -67,9 +67,13 @@ in stdenv.mkDerivation rec {
cmake
llvmPackages_latest.lld
elfutils
libffi
pkg-config
zlib
];
buildInputs = [
libffi
zlib
gcc.cc.lib # Required for libstdc++.so.6
];