30 else if config.rocmSupport
36 assert builtins.elem gpuBackend [ "none" "cuda" "rocm" ];
38 stdenv.mkDerivation rec {
42 src = fetchFromGitHub {
43 owner = "electronic-structure";
46 hash = "sha256-s4rO+dePvtvn41wxCvbqgQGrEckWmfng7sPX2M8OPB0=";
50 substituteInPlace src/gpu/acc_blas_api.hpp \
51 --replace '#include <rocblas.h>' '#include <rocblas/rocblas.h>'
75 ++ lib.optional (gpuBackend == "cuda") cudaPackages.cudatoolkit
76 ++ lib.optionals (gpuBackend == "rocm") [
79 ] ++ lib.optional stdenv.isDarwin llvmPackages.openmp
82 propagatedBuildInputs = [ mpi ];
88 "-DCREATE_FORTRAN_BINDINGS=ON"
92 ++ lib.optionals (gpuBackend == "cuda") [
94 "-DCUDA_TOOLKIT_ROOT_DIR=${cudaPackages.cudatoolkit}"
96 ++ lib.optionals (gpuBackend == "rocm") [
98 "-DHIP_ROOT_DIR=${rocmPackages.clr}"
103 # Can not run parallel checks generally as it requires exactly multiples of 4 MPI ranks
107 ctest --output-on-failure --label-exclude integration_test
108 ctest --output-on-failure -L cpu_serial
113 nativeCheckInputs = [
119 description = "Domain specific library for electronic structure calculations";
120 homepage = "https://github.com/electronic-structure/SIRIUS";
121 license = licenses.bsd2;
122 platforms = platforms.linux;
123 maintainers = [ maintainers.sheepforce ];