git.iko.soy/typeable/nixpkgs
on master help sign in
sundials: assert that lapack and blas are compatible

Instead of asserting that lapack and blas are both not using 64 bit index size, only make sure they are index size compatible. Plus, do it when evaluating buildInputs, per: https://github.com/NixOS/nixpkgs/pull/94892#discussion_r471110250 Don't pass SUNDIALS_INDEX_TYPE=int32_t if blas && lapack are compiled with 64 bit index size. Bonus: Use checkTarget and not an overrided checkPhase, per: https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/explicit-phases.md

commit16a01272ee2a9b6c0d3af0b356ee869912cfb63c authorDoron Behar <doron.behar@gmail.com> dateWed 23 Sep 2020, 00:41 (6 years ago) parentaa27e2f
1 file changed+17−10
pkgs/development/libraries/sundials/default.nix+17−10
pkgs/development/libraries/sundials/default.nix+17−10
@@ -7,9 +7,8 @@
77, gfortran
88, suitesparse
99, lapackSupport ? true
10−, kluSupport ? true }:
11−
12−assert (!blas.isILP64) && (!lapack.isILP64);
10+, kluSupport ? true
11+}:
1312
1413stdenv.mkDerivation rec {
1514 pname = "sundials";
@@ -17,11 +16,14 @@ stdenv.mkDerivation rec {
1716
1817 buildInputs = [
1918 python
20− ] ++ stdenv.lib.optionals (lapackSupport) [
21− gfortran
22− blas
23− lapack
2419 ]
20+ ++ stdenv.lib.optionals (lapackSupport)
21+ # Check that the same index size is used for both libraries
22+ (assert (blas.isILP64 == lapack.isILP64); [
23+ gfortran
24+ blas
25+ lapack
26+ ])
2527 # KLU support is based on Suitesparse.
2628 # It is tested upstream according to the section 1.1.4 of
2729 # [INSTALL_GUIDE.pdf](https://raw.githubusercontent.com/LLNL/sundials/master/INSTALL_GUIDE.pdf)
@@ -47,17 +49,22 @@ stdenv.mkDerivation rec {
4749 cmakeFlags = [
4850 "-DEXAMPLES_INSTALL_PATH=${placeholder "out"}/share/examples"
4951 ] ++ stdenv.lib.optionals (lapackSupport) [
50− "-DSUNDIALS_INDEX_TYPE=int32_t"
5152 "-DLAPACK_ENABLE=ON"
5253 "-DLAPACK_LIBRARIES=${lapack}/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary}"
5354 ] ++ stdenv.lib.optionals (kluSupport) [
5455 "-DKLU_ENABLE=ON"
5556 "-DKLU_INCLUDE_DIR=${suitesparse.dev}/include"
5657 "-DKLU_LIBRARY_DIR=${suitesparse}/lib"
57− ];
58+ ] ++ stdenv.lib.optionals (lapackSupport && !lapack.isILP64) [
59+ # Use the correct index type according to lapack which is supposed to be
60+ # the same index type compatible with blas, thanks to the assertion of
61+ # buildInputs
62+ "-DSUNDIALS_INDEX_TYPE=int32_t"
63+ ]
64+ ;
5865
5966 doCheck = true;
60− checkPhase = "make test";
67+ checkTarget = "test";
6168
6269 meta = with stdenv.lib; {
6370 description = "Suite of nonlinear differential/algebraic equation solvers";