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.
This commit is contained in:
Doron Behar 2020-12-10 20:32:06 +02:00
parent 674c5953b9
commit 67888e5bac

View file

@ -23,15 +23,17 @@
, fftwSinglePrec , fftwSinglePrec
, zlib , zlib
, curl , curl
, qrupdate
, blas, lapack , blas, lapack
, arpack # These two should use the same lapack and blas as the above
, qrupdate, arpack, suitesparse ? null
# If set to true, the above 5 deps are overriden to use the blas and lapack
# with 64 bit indexes support. If all are not compatible, the build will fail.
, use64BitIdx ? false
, libwebp , libwebp
, gl2ps , gl2ps
, ghostscript ? null , ghostscript ? null
, hdf5 ? null , hdf5 ? null
, glpk ? null , glpk ? null
, suitesparse ? null
, gnuplot ? null , gnuplot ? null
# - Include support for GNU readline: # - Include support for GNU readline:
, enableReadline ? true , enableReadline ? true
@ -56,9 +58,42 @@
, darwin , darwin
}: }:
assert (!blas.isILP64) && (!lapack.isILP64); let
# Not always evaluated
mkDerivation rec { blas' = if use64BitIdx then
blas.override {
isILP64 = true;
}
else
blas
;
lapack' = if use64BitIdx then
lapack.override {
isILP64 = true;
}
else
lapack
;
qrupdate' = qrupdate.override {
# If use64BitIdx is false, this override doesn't evaluate to a new
# derivation, as blas and lapack are not overriden.
blas = blas';
lapack = lapack';
};
arpack' = arpack.override {
blas = blas';
lapack = lapack';
};
# Not always suitesparse is required at all
suitesparse' = if suitesparse != null then
suitesparse.override {
blas = blas';
lapack = lapack';
}
else
null
;
in mkDerivation rec {
version = "6.1.0"; version = "6.1.0";
pname = "octave"; pname = "octave";
@ -78,14 +113,14 @@ mkDerivation rec {
fltk fltk
zlib zlib
curl curl
blas blas'
lapack lapack'
libsndfile libsndfile
fftw fftw
fftwSinglePrec fftwSinglePrec
portaudio portaudio
qrupdate qrupdate'
arpack arpack'
libwebp libwebp
gl2ps gl2ps
] ]
@ -97,7 +132,7 @@ mkDerivation rec {
++ stdenv.lib.optionals (ghostscript != null) [ ghostscript ] ++ stdenv.lib.optionals (ghostscript != null) [ ghostscript ]
++ stdenv.lib.optionals (hdf5 != null) [ hdf5 ] ++ stdenv.lib.optionals (hdf5 != null) [ hdf5 ]
++ stdenv.lib.optionals (glpk != null) [ glpk ] ++ stdenv.lib.optionals (glpk != null) [ glpk ]
++ stdenv.lib.optionals (suitesparse != null) [ suitesparse ] ++ stdenv.lib.optionals (suitesparse != null) [ suitesparse' ]
++ stdenv.lib.optionals (enableJava) [ jdk ] ++ stdenv.lib.optionals (enableJava) [ jdk ]
++ stdenv.lib.optionals (sundials_2 != null) [ sundials_2 ] ++ stdenv.lib.optionals (sundials_2 != null) [ sundials_2 ]
++ stdenv.lib.optionals (gnuplot != null) [ gnuplot ] ++ stdenv.lib.optionals (gnuplot != null) [ gnuplot ]
@ -130,12 +165,12 @@ mkDerivation rec {
enableParallelBuilding = true; enableParallelBuilding = true;
# See https://savannah.gnu.org/bugs/?50339 # See https://savannah.gnu.org/bugs/?50339
F77_INTEGER_8_FLAG = if blas.isILP64 then "-fdefault-integer-8" else ""; F77_INTEGER_8_FLAG = if use64BitIdx then "-fdefault-integer-8" else "";
configureFlags = [ configureFlags = [
"--with-blas=blas" "--with-blas=blas"
"--with-lapack=lapack" "--with-lapack=lapack"
(if blas.isILP64 then "--enable-64" else "--disable-64") (if use64BitIdx then "--enable-64" else "--disable-64")
] ]
++ stdenv.lib.optionals stdenv.isDarwin [ "--enable-link-all-dependencies" ] ++ stdenv.lib.optionals stdenv.isDarwin [ "--enable-link-all-dependencies" ]
++ stdenv.lib.optionals enableReadline [ "--enable-readline" ] ++ stdenv.lib.optionals enableReadline [ "--enable-readline" ]
@ -153,6 +188,11 @@ mkDerivation rec {
passthru = { passthru = {
inherit version; inherit version;
sitePath = "share/octave/${version}/site"; sitePath = "share/octave/${version}/site";
blas = blas';
lapack = lapack';
qrupdate = qrupdate';
arpack = arpack';
suitesparse = suitesparse';
}; };
meta = { meta = {