Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
84 lines
1.7 KiB
Nix
84 lines
1.7 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
|
|
fetchFromGitHub,
|
|
stdenv,
|
|
|
|
nix-update-script,
|
|
|
|
enableCuda ? config.cudaSupport,
|
|
|
|
# nativeBuildInputs
|
|
cudaPackages,
|
|
gfortran,
|
|
meson,
|
|
ninja,
|
|
pkg-config,
|
|
|
|
# buildInputs
|
|
blas,
|
|
hwloc,
|
|
lapack,
|
|
llvmPackages,
|
|
metis,
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "spral";
|
|
version = "2025.09.18";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "ralna";
|
|
repo = "spral";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-ftyA6zP+VX0fb7e9YKjPCAWYblNyjX/eVeni1tRQIxY=";
|
|
};
|
|
|
|
# Ignore a failing test on darwin
|
|
# ref. https://github.com/ralna/spral/issues/258
|
|
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
|
substituteInPlace tests/ssids/meson.build --replace-fail \
|
|
"spral_tests += [['ssids', 'ssidst', files('ssids.f90')]]" ""
|
|
'';
|
|
|
|
nativeBuildInputs = [
|
|
gfortran
|
|
meson
|
|
ninja
|
|
pkg-config
|
|
]
|
|
++ lib.optionals enableCuda [
|
|
cudaPackages.cuda_nvcc
|
|
];
|
|
|
|
propagatedBuildInputs = lib.optionals enableCuda [
|
|
cudaPackages.cuda_cudart
|
|
cudaPackages.libcublas
|
|
];
|
|
|
|
buildInputs = [
|
|
blas
|
|
(hwloc.override { inherit enableCuda; })
|
|
lapack
|
|
metis
|
|
]
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [ llvmPackages.openmp ];
|
|
|
|
mesonFlags = [ (lib.mesonBool "tests" true) ];
|
|
|
|
LDFLAGS = lib.optionals stdenv.hostPlatform.isDarwin [ "-lomp" ];
|
|
|
|
doCheck = true;
|
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
meta = {
|
|
description = "Sparse Parallel Robust Algorithms Library";
|
|
homepage = "https://github.com/ralna/spral";
|
|
changelog = "https://github.com/ralna/spral/releases/tag/${finalAttrs.src.tag}";
|
|
license = lib.licenses.bsd3;
|
|
maintainers = with lib.maintainers; [ nim65s ];
|
|
};
|
|
})
|