octave: Support 64 bit indices arrays

Add a build argument `use64BitIdx`, and comment explaining how it
affects the build - it modifies the deps to make sure they are all
compatible with each other.

+53 -13
+53 -13
pkgs/development/interpreters/octave/default.nix
··· 23 23 , fftwSinglePrec 24 24 , zlib 25 25 , curl 26 - , qrupdate 27 26 , blas, lapack 28 - , arpack 27 + # These two should use the same lapack and blas as the above 28 + , qrupdate, arpack, suitesparse ? null 29 + # If set to true, the above 5 deps are overriden to use the blas and lapack 30 + # with 64 bit indexes support. If all are not compatible, the build will fail. 31 + , use64BitIdx ? false 29 32 , libwebp 30 33 , gl2ps 31 34 , ghostscript ? null 32 35 , hdf5 ? null 33 36 , glpk ? null 34 - , suitesparse ? null 35 37 , gnuplot ? null 36 38 # - Include support for GNU readline: 37 39 , enableReadline ? true ··· 56 58 , darwin 57 59 }: 58 60 59 - assert (!blas.isILP64) && (!lapack.isILP64); 60 - 61 - mkDerivation rec { 61 + let 62 + # Not always evaluated 63 + blas' = if use64BitIdx then 64 + blas.override { 65 + isILP64 = true; 66 + } 67 + else 68 + blas 69 + ; 70 + lapack' = if use64BitIdx then 71 + lapack.override { 72 + isILP64 = true; 73 + } 74 + else 75 + lapack 76 + ; 77 + qrupdate' = qrupdate.override { 78 + # If use64BitIdx is false, this override doesn't evaluate to a new 79 + # derivation, as blas and lapack are not overriden. 80 + blas = blas'; 81 + lapack = lapack'; 82 + }; 83 + arpack' = arpack.override { 84 + blas = blas'; 85 + lapack = lapack'; 86 + }; 87 + # Not always suitesparse is required at all 88 + suitesparse' = if suitesparse != null then 89 + suitesparse.override { 90 + blas = blas'; 91 + lapack = lapack'; 92 + } 93 + else 94 + null 95 + ; 96 + in mkDerivation rec { 62 97 version = "6.1.0"; 63 98 pname = "octave"; 64 99 ··· 78 113 fltk 79 114 zlib 80 115 curl 81 - blas 82 - lapack 116 + blas' 117 + lapack' 83 118 libsndfile 84 119 fftw 85 120 fftwSinglePrec 86 121 portaudio 87 - qrupdate 88 - arpack 122 + qrupdate' 123 + arpack' 89 124 libwebp 90 125 gl2ps 91 126 ] ··· 97 132 ++ stdenv.lib.optionals (ghostscript != null) [ ghostscript ] 98 133 ++ stdenv.lib.optionals (hdf5 != null) [ hdf5 ] 99 134 ++ stdenv.lib.optionals (glpk != null) [ glpk ] 100 - ++ stdenv.lib.optionals (suitesparse != null) [ suitesparse ] 135 + ++ stdenv.lib.optionals (suitesparse != null) [ suitesparse' ] 101 136 ++ stdenv.lib.optionals (enableJava) [ jdk ] 102 137 ++ stdenv.lib.optionals (sundials_2 != null) [ sundials_2 ] 103 138 ++ stdenv.lib.optionals (gnuplot != null) [ gnuplot ] ··· 130 165 enableParallelBuilding = true; 131 166 132 167 # See https://savannah.gnu.org/bugs/?50339 133 - F77_INTEGER_8_FLAG = if blas.isILP64 then "-fdefault-integer-8" else ""; 168 + F77_INTEGER_8_FLAG = if use64BitIdx then "-fdefault-integer-8" else ""; 134 169 135 170 configureFlags = [ 136 171 "--with-blas=blas" 137 172 "--with-lapack=lapack" 138 - (if blas.isILP64 then "--enable-64" else "--disable-64") 173 + (if use64BitIdx then "--enable-64" else "--disable-64") 139 174 ] 140 175 ++ stdenv.lib.optionals stdenv.isDarwin [ "--enable-link-all-dependencies" ] 141 176 ++ stdenv.lib.optionals enableReadline [ "--enable-readline" ] ··· 153 188 passthru = { 154 189 inherit version; 155 190 sitePath = "share/octave/${version}/site"; 191 + blas = blas'; 192 + lapack = lapack'; 193 + qrupdate = qrupdate'; 194 + arpack = arpack'; 195 + suitesparse = suitesparse'; 156 196 }; 157 197 158 198 meta = {