blob: 34452bb8f8505ccf0da4def86d2d62d837d6f293 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
{
lib,
stdenv,
fetchFromGitHub,
rocmUpdateScript,
cmake,
llvm,
zlib,
zstd,
perl,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "hipify";
version = "7.2.3";
src = fetchFromGitHub {
owner = "ROCm";
repo = "HIPIFY";
rev = "rocm-${finalAttrs.version}";
hash = "sha256-LC0lnYetV7RPVw92zew6za6bDH4zmnERXUM4MVaRVtc=";
};
strictDeps = true;
nativeBuildInputs = [
cmake
perl
llvm.rocm-toolchain
];
buildInputs = [
llvm.llvm
llvm.clang-unwrapped
perl
zlib
zstd
];
env.CXXFLAGS = "-I${lib.getInclude llvm.llvm}/include -I${lib.getInclude llvm.clang-unwrapped}/include";
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace-fail "\''${LLVM_TOOLS_BINARY_DIR}/clang" "${llvm.rocm-toolchain}/bin/clang"
chmod +x bin/*
'';
passthru.updateScript = rocmUpdateScript { inherit finalAttrs; };
postInstall = ''
rm $out/bin/hipify-perl
chmod +x $out/bin/*
chmod +x $out/libexec/*
patchShebangs $out/bin/
patchShebangs $out/libexec/
ln -s $out/{libexec/hipify,bin}/hipify-perl
'';
meta = {
description = "Convert CUDA to Portable C++ Code";
homepage = "https://github.com/ROCm/HIPIFY";
license = with lib.licenses; [ mit ];
teams = [ lib.teams.rocm ];
platforms = lib.platforms.linux;
};
})
|