2023-01-20 10:41:00 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rocmUpdateScript
|
|
|
|
, cmake
|
2023-10-19 13:55:26 +00:00
|
|
|
, clang
|
2023-01-20 10:41:00 +00:00
|
|
|
, libxml2
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
|
|
pname = "hipify";
|
2023-10-19 13:55:26 +00:00
|
|
|
version = "5.7.0";
|
2023-01-20 10:41:00 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ROCm-Developer-Tools";
|
|
|
|
repo = "HIPIFY";
|
|
|
|
rev = "rocm-${finalAttrs.version}";
|
2023-10-19 13:55:26 +00:00
|
|
|
hash = "sha256-lCQ2VTUGmFC90Xu70/tvoeDhFaInGqLT3vC2A1UojNI=";
|
2023-01-20 10:41:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
buildInputs = [ libxml2 ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace CMakeLists.txt \
|
2023-10-19 13:55:26 +00:00
|
|
|
--replace "\''${LLVM_TOOLS_BINARY_DIR}/clang" "${clang}/bin/clang"
|
2023-01-20 10:41:00 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.updateScript = rocmUpdateScript {
|
|
|
|
name = finalAttrs.pname;
|
|
|
|
owner = finalAttrs.src.owner;
|
|
|
|
repo = finalAttrs.src.repo;
|
|
|
|
};
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
# Fixup bad symlinks
|
2023-01-20 10:41:00 +00:00
|
|
|
postInstall = ''
|
2023-10-19 13:55:26 +00:00
|
|
|
rm -r $out/hip/bin
|
|
|
|
ln -s $out/bin $out/hip/bin
|
|
|
|
patchShebangs $out/bin
|
2023-01-20 10:41:00 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Convert CUDA to Portable C++ Code";
|
|
|
|
homepage = "https://github.com/ROCm-Developer-Tools/HIPIFY";
|
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = teams.rocm.members;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version;
|
|
|
|
};
|
|
|
|
})
|