git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #98500 from doronbehar/pkg/octave/sundials

sundials: assert that lapack and blas are compatible

commit336fd6292016e41140c29b1657545071db87e6fd authorDoron Behar <doron.behar@gmail.com> dateSun 6 Dec 2020, 13:48 (6 years ago) parentc3bd56016a0127
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";