forked from mirrors/nixpkgs
hipsparse: fixup samples
This commit is contained in:
parent
8de23957e9
commit
8e80bc7dd2
|
@ -9,7 +9,9 @@
|
|||
, gfortran
|
||||
, git
|
||||
, gtest
|
||||
, openmp
|
||||
, buildTests ? false
|
||||
, buildSamples ? false
|
||||
}:
|
||||
|
||||
# This can also use cuSPARSE as a backend instead of rocSPARSE
|
||||
|
@ -21,6 +23,8 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
"out"
|
||||
] ++ lib.optionals buildTests [
|
||||
"test"
|
||||
] ++ lib.optionals buildSamples [
|
||||
"sample"
|
||||
];
|
||||
|
||||
src = fetchFromGitHub {
|
||||
|
@ -42,10 +46,14 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
git
|
||||
] ++ lib.optionals buildTests [
|
||||
gtest
|
||||
] ++ lib.optionals (buildTests || buildSamples) [
|
||||
openmp
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DCMAKE_C_COMPILER=hipcc"
|
||||
"-DCMAKE_CXX_COMPILER=hipcc"
|
||||
"-DBUILD_CLIENTS_SAMPLES=${if buildSamples then "ON" else "OFF"}"
|
||||
# Manually define CMAKE_INSTALL_<DIR>
|
||||
# See: https://github.com/NixOS/nixpkgs/pull/197838
|
||||
"-DCMAKE_INSTALL_BINDIR=bin"
|
||||
|
@ -104,6 +112,11 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
mv $out/bin/hipsparse-test $test/bin
|
||||
mv /build/source/matrices $test
|
||||
rmdir $out/bin
|
||||
'' + lib.optionalString buildSamples ''
|
||||
mkdir -p $sample/bin
|
||||
mv clients/staging/example_* $sample/bin
|
||||
patchelf --set-rpath $out/lib:${lib.makeLibraryPath (
|
||||
finalAttrs.buildInputs ++ [ hip gfortran.cc ])} $sample/bin/example_*
|
||||
'';
|
||||
|
||||
passthru.updateScript = rocmUpdateScript {
|
||||
|
|
|
@ -15180,6 +15180,7 @@ with pkgs;
|
|||
};
|
||||
|
||||
hipsparse = callPackage ../development/libraries/hipsparse {
|
||||
inherit (llvmPackages_rocm) openmp;
|
||||
stdenv = rocmClangStdenv;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue