nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 62 lines 1.1 kB view raw
1{ 2 lib, 3 stdenv, 4 cmake, 5 ninja, 6 libxml2, 7 zlib, 8 zstd, 9 ncurses, 10 rocm-merged-llvm, 11 python3, 12}: 13 14let 15 llvmNativeTarget = 16 if stdenv.hostPlatform.isx86_64 then 17 "X86" 18 else if stdenv.hostPlatform.isAarch64 then 19 "AArch64" 20 else 21 throw "Unsupported ROCm LLVM platform"; 22in 23stdenv.mkDerivation { 24 pname = "rocm-device-libs"; 25 # In-tree with ROCm LLVM 26 inherit (rocm-merged-llvm) version; 27 src = rocm-merged-llvm.llvm-src; 28 29 postPatch = '' 30 cd amd/device-libs 31 ''; 32 33 patches = [ ./cmake.patch ]; 34 35 nativeBuildInputs = [ 36 cmake 37 ninja 38 python3 39 ]; 40 41 buildInputs = [ 42 libxml2 43 zlib 44 zstd 45 ncurses 46 rocm-merged-llvm 47 ]; 48 49 cmakeFlags = [ 50 "-DCMAKE_RELEASE_TYPE=Release" 51 "-DLLVM_TARGETS_TO_BUILD=AMDGPU;${llvmNativeTarget}" 52 ]; 53 54 meta = with lib; { 55 description = "Set of AMD-specific device-side language runtime libraries"; 56 homepage = "https://github.com/ROCm/ROCm-Device-Libs"; 57 license = licenses.ncsa; 58 maintainers = with maintainers; [ lovesegfault ]; 59 teams = [ teams.rocm ]; 60 platforms = platforms.linux; 61 }; 62}