mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-28 00:24:18 +00:00
4f0dadbf38
After final improvements to the official formatter implementation, this commit now performs the first treewide reformat of Nix files using it. This is part of the implementation of RFC 166. Only "inactive" files are reformatted, meaning only files that aren't being touched by any PR with activity in the past 2 months. This is to avoid conflicts for PRs that might soon be merged. Later we can do a full treewide reformat to get the rest, which should not cause as many conflicts. A CI check has already been running for some time to ensure that new and already-formatted files are formatted, so the files being reformatted here should also stay formatted. This commit was automatically created and can be verified using nix-builda08b3a4d19
.tar.gz \ --argstr baseRevb32a094368
result/bin/apply-formatting $NIXPKGS_PATH
87 lines
2.1 KiB
Nix
87 lines
2.1 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
cmake,
|
|
fetchurl,
|
|
python,
|
|
blas,
|
|
lapack,
|
|
gfortran,
|
|
suitesparse,
|
|
lapackSupport ? true,
|
|
kluSupport ? true,
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "sundials";
|
|
version = "7.1.1";
|
|
|
|
outputs = [
|
|
"out"
|
|
"examples"
|
|
];
|
|
|
|
src = fetchurl {
|
|
url = "https://github.com/LLNL/sundials/releases/download/v${version}/sundials-${version}.tar.gz";
|
|
hash = "sha256-6n1u37UkSN39wexI+JpyH+bAolnBD471b2D83th6lLs=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
cmake
|
|
gfortran
|
|
];
|
|
|
|
buildInputs =
|
|
[
|
|
python
|
|
]
|
|
++
|
|
lib.optionals (lapackSupport)
|
|
# Check that the same index size is used for both libraries
|
|
(
|
|
assert (blas.isILP64 == lapack.isILP64);
|
|
[
|
|
blas
|
|
lapack
|
|
]
|
|
)
|
|
# KLU support is based on Suitesparse. It is tested upstream according to the
|
|
# section 1.1.4.2 of INSTALL_GUIDE.pdf found in the source tarball.
|
|
++ lib.optionals (kluSupport) [
|
|
suitesparse
|
|
];
|
|
|
|
cmakeFlags =
|
|
[
|
|
"-DEXAMPLES_INSTALL_PATH=${placeholder "examples"}/share/examples"
|
|
]
|
|
++ lib.optionals (lapackSupport) [
|
|
"-DENABLE_LAPACK=ON"
|
|
"-DLAPACK_LIBRARIES=${lapack}/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary}"
|
|
]
|
|
++ lib.optionals (kluSupport) [
|
|
"-DENABLE_KLU=ON"
|
|
"-DKLU_INCLUDE_DIR=${suitesparse.dev}/include"
|
|
"-DKLU_LIBRARY_DIR=${suitesparse}/lib"
|
|
]
|
|
++ [
|
|
(
|
|
# Use the correct index type according to lapack and blas used. They are
|
|
# already supposed to be compatible but we check both for extra safety. 64
|
|
# should be the default but we prefer to be explicit, for extra safety.
|
|
if blas.isILP64 then "-DSUNDIALS_INDEX_SIZE=64" else "-DSUNDIALS_INDEX_SIZE=32"
|
|
)
|
|
];
|
|
|
|
doCheck = true;
|
|
checkTarget = "test";
|
|
|
|
meta = with lib; {
|
|
description = "Suite of nonlinear differential/algebraic equation solvers";
|
|
homepage = "https://computing.llnl.gov/projects/sundials";
|
|
platforms = platforms.all;
|
|
maintainers = with maintainers; [ idontgetoutmuch ];
|
|
license = licenses.bsd3;
|
|
};
|
|
}
|