94 lines
1.8 KiB
Nix
94 lines
1.8 KiB
Nix
{ lib
|
|
, stdenvNoCC
|
|
, fetchFromGitHub
|
|
, cmake
|
|
, ninja
|
|
, gtest
|
|
, mold
|
|
, clang
|
|
, cppCompiler ? clang
|
|
, hwloc
|
|
, gflags
|
|
, rapidjson
|
|
|
|
## optional backends
|
|
, hipSupport ? false, hip, hipfft, hipsparse, hipblas, rocthrust, rocrand
|
|
, cudaSupport ? false, cudatoolkit
|
|
, ompSupport ? false
|
|
, mpiSupport ? false
|
|
}:
|
|
|
|
let
|
|
basename = "ginkgo-hpc";
|
|
version = "1.5.0";
|
|
cpp_c = cppCompiler;
|
|
src = fetchFromGitHub {
|
|
repo = "ginkgo";
|
|
owner = "ginkgo-project";
|
|
rev = "234594c92b58e2384dfb43c2d08e7f43e2b58e7a";
|
|
sha256 = "eKQfuXnTMGgEzuksXzZE4QR5ILfVbw+dK9IsRdmalQc=";
|
|
};
|
|
base_cmake_flags = [
|
|
"-DGINKGO_BUILD_TESTS=OFF"
|
|
"-DGINKGO_BUILD_BENCHMARKS=OFF"
|
|
"-DGINKGO_BUILD_EXAMPLES=OFF"
|
|
"-DGINKGO_BUILD_HWLOC=OFF"
|
|
];
|
|
native_build_inputs = [
|
|
cmake
|
|
ninja
|
|
cpp_c
|
|
mold
|
|
gtest
|
|
];
|
|
build_inputs = [
|
|
gflags
|
|
rapidjson
|
|
]
|
|
++ lib.optional cudaSupport cudatoolkit
|
|
++ lib.optional hipSupport [ hip hipfft hipsparse hipblas rocrand rocthrust ];
|
|
in stdenvNoCC.mkDerivation {
|
|
pname = "${basename}";
|
|
version = version;
|
|
|
|
src = src;
|
|
|
|
nativeBuildInputs = native_build_inputs;
|
|
|
|
buildInputs = build_inputs;
|
|
|
|
cmakeFlags = base_cmake_flags
|
|
++ lib.optional cudaSupport [
|
|
"-DGINKGO_BUILD_CUDA=ON"
|
|
]
|
|
++ lib.optional (!cudaSupport) [
|
|
"-DGINKGO_BUILD_CUDA=OFF"
|
|
]
|
|
++ lib.optional hipSupport [
|
|
"-DGINKGO_BUILD_HIP=ON"
|
|
]
|
|
++ lib.optional (!hipSupport) [
|
|
"-DGINKGO_BUILD_HIP=OFF"
|
|
]
|
|
++ lib.optional ompSupport [
|
|
"-DGINKGO_BUILD_OMP=ON"
|
|
]
|
|
++ lib.optional (!ompSupport) [
|
|
"-DGINKGO_BUILD_OMP=OFF"
|
|
]
|
|
++ lib.optional mpiSupport [
|
|
"-DGINKGO_BUILD_MPI=ON"
|
|
]
|
|
++ lib.optional (!mpiSupport) [
|
|
"-DGINKGO_BUILD_MPI=OFF"
|
|
];
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
doCheck = false;
|
|
|
|
patches = [
|
|
./ver_1_5_cmake.patch
|
|
];
|
|
}
|