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-11-16 04:20:00 +00:00
|
|
|
version = "5.7.1";
|
2023-01-20 10:41:00 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2024-01-02 11:29:13 +00:00
|
|
|
owner = "ROCm";
|
2023-01-20 10:41:00 +00:00
|
|
|
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";
|
2024-01-02 11:29:13 +00:00
|
|
|
homepage = "https://github.com/ROCm/HIPIFY";
|
2023-01-20 10:41:00 +00:00
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = teams.rocm.members;
|
|
|
|
platforms = platforms.linux;
|
2024-01-02 11:29:13 +00:00
|
|
|
broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "6.0.0";
|
2023-01-20 10:41:00 +00:00
|
|
|
};
|
|
|
|
})
|