Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at netboot-syslinux-multiplatform 84 lines 2.0 kB view raw
1{ lib 2, stdenv 3, fetchFromGitHub 4, rocmUpdateScript 5, cmake 6, rocm-cmake 7, rocprim 8, hip 9, gtest 10, buildTests ? false 11, buildBenchmarks ? false 12}: 13 14stdenv.mkDerivation (finalAttrs: { 15 pname = "rocthrust"; 16 version = "5.4.3"; 17 18 outputs = [ 19 "out" 20 ] ++ lib.optionals buildTests [ 21 "test" 22 ] ++ lib.optionals buildBenchmarks [ 23 "benchmark" 24 ]; 25 26 src = fetchFromGitHub { 27 owner = "ROCmSoftwarePlatform"; 28 repo = "rocThrust"; 29 rev = "rocm-${finalAttrs.version}"; 30 hash = "sha256-JT2PX53N39H+EaThPHo2ol+BUjDQniSQlKMLiYD8NoM="; 31 }; 32 33 nativeBuildInputs = [ 34 cmake 35 rocm-cmake 36 rocprim 37 hip 38 ]; 39 40 buildInputs = lib.optionals buildTests [ 41 gtest 42 ]; 43 44 cmakeFlags = [ 45 "-DCMAKE_CXX_COMPILER=hipcc" 46 "-DHIP_ROOT_DIR=${hip}" 47 # Manually define CMAKE_INSTALL_<DIR> 48 # See: https://github.com/NixOS/nixpkgs/pull/197838 49 "-DCMAKE_INSTALL_BINDIR=bin" 50 "-DCMAKE_INSTALL_LIBDIR=lib" 51 "-DCMAKE_INSTALL_INCLUDEDIR=include" 52 ] ++ lib.optionals buildTests [ 53 "-DBUILD_TEST=ON" 54 ] ++ lib.optionals buildBenchmarks [ 55 "-DBUILD_BENCHMARKS=ON" 56 ] ++ lib.optionals (buildTests || buildBenchmarks) [ 57 "-DCMAKE_CXX_FLAGS=-Wno-deprecated-builtins" # Too much spam 58 ]; 59 60 postInstall = lib.optionalString buildTests '' 61 mkdir -p $test/bin 62 mv $out/bin/{test_*,*.hip} $test/bin 63 '' + lib.optionalString buildBenchmarks '' 64 mkdir -p $benchmark/bin 65 mv $out/bin/benchmark_* $benchmark/bin 66 '' + lib.optionalString (buildTests || buildBenchmarks) '' 67 rm -rf $out/bin 68 ''; 69 70 passthru.updateScript = rocmUpdateScript { 71 name = finalAttrs.pname; 72 owner = finalAttrs.src.owner; 73 repo = finalAttrs.src.repo; 74 }; 75 76 meta = with lib; { 77 description = "ROCm parallel algorithm library"; 78 homepage = "https://github.com/ROCmSoftwarePlatform/rocThrust"; 79 license = with licenses; [ asl20 ]; 80 maintainers = teams.rocm.members; 81 platforms = platforms.linux; 82 broken = versions.minor finalAttrs.version != versions.minor hip.version; 83 }; 84})