Merge pull request #106586 from doronbehar/pkg/octave/misc

octave: Use latest jdk & Allow 64 bit indices
This commit is contained in:
Michael Raskin 2020-12-21 11:30:08 +00:00 committed by GitHub
commit ee383a53dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 82 additions and 105 deletions

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
@ -41,7 +43,7 @@
, jdk ? null , jdk ? null
, python ? null , python ? null
, overridePlatforms ? null , overridePlatforms ? null
, sundials_2 ? null , sundials ? null
# - Build Octave Qt GUI: # - Build Octave Qt GUI:
, enableQt ? false , enableQt ? false
, qtbase ? null , qtbase ? null
@ -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,34 +113,36 @@ 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
] ]
++ (stdenv.lib.optionals enableQt [ ++ stdenv.lib.optionals enableQt [
qtbase qtbase
qtsvg qtsvg
qscintilla qscintilla
]) ]
++ (stdenv.lib.optional (ghostscript != null) ghostscript) ++ stdenv.lib.optionals (ghostscript != null) [ ghostscript ]
++ (stdenv.lib.optional (hdf5 != null) hdf5) ++ stdenv.lib.optionals (hdf5 != null) [ hdf5 ]
++ (stdenv.lib.optional (glpk != null) glpk) ++ stdenv.lib.optionals (glpk != null) [ glpk ]
++ (stdenv.lib.optional (suitesparse != null) suitesparse) ++ stdenv.lib.optionals (suitesparse != null) [ suitesparse' ]
++ (stdenv.lib.optional (enableJava) jdk) ++ stdenv.lib.optionals (enableJava) [ jdk ]
++ (stdenv.lib.optional (sundials_2 != null) sundials_2) ++ stdenv.lib.optionals (sundials != null) [ sundials ]
++ (stdenv.lib.optional (gnuplot != null) gnuplot) ++ stdenv.lib.optionals (gnuplot != null) [ gnuplot ]
++ (stdenv.lib.optional (python != null) python) ++ stdenv.lib.optionals (python != null) [ python ]
++ (stdenv.lib.optionals (!stdenv.isDarwin) [ libGL libGLU libX11 ]) ++ stdenv.lib.optionals (!stdenv.isDarwin) [ libGL libGLU libX11 ]
++ (stdenv.lib.optionals (stdenv.isDarwin) [ libiconv ++ stdenv.lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Accelerate libiconv
darwin.apple_sdk.frameworks.Cocoa ]) darwin.apple_sdk.frameworks.Accelerate
darwin.apple_sdk.frameworks.Cocoa
]
; ;
nativeBuildInputs = [ nativeBuildInputs = [
pkgconfig pkgconfig
@ -115,12 +152,12 @@ mkDerivation rec {
fftwSinglePrec fftwSinglePrec
texinfo texinfo
] ]
++ (stdenv.lib.optional (sundials_2 != null) sundials_2) ++ stdenv.lib.optionals (sundials != null) [ sundials ]
++ (stdenv.lib.optional enableJIT llvm) ++ stdenv.lib.optionals enableJIT [ llvm ]
++ (stdenv.lib.optionals enableQt [ ++ stdenv.lib.optionals enableQt [
qtscript qtscript
qttools qttools
]) ]
; ;
doCheck = !stdenv.isDarwin; doCheck = !stdenv.isDarwin;
@ -128,14 +165,14 @@ 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")
] ]
++ (if stdenv.isDarwin then [ "--enable-link-all-dependencies" ] else [ ]) ++ stdenv.lib.optionals stdenv.isDarwin [ "--enable-link-all-dependencies" ]
++ stdenv.lib.optionals enableReadline [ "--enable-readline" ] ++ stdenv.lib.optionals enableReadline [ "--enable-readline" ]
++ stdenv.lib.optionals stdenv.isDarwin [ "--with-x=no" ] ++ stdenv.lib.optionals stdenv.isDarwin [ "--with-x=no" ]
++ stdenv.lib.optionals enableQt [ "--with-qt=5" ] ++ stdenv.lib.optionals enableQt [ "--with-qt=5" ]
@ -149,14 +186,20 @@ mkDerivation rec {
''; '';
passthru = { passthru = {
inherit version;
sitePath = "share/octave/${version}/site"; sitePath = "share/octave/${version}/site";
blas = blas';
lapack = lapack';
qrupdate = qrupdate';
arpack = arpack';
suitesparse = suitesparse';
inherit python;
inherit enableQt enableJIT enableReadline enableJava;
}; };
meta = { meta = {
homepage = "https://www.gnu.org/software/octave/"; homepage = "https://www.gnu.org/software/octave/";
license = stdenv.lib.licenses.gpl3Plus; license = stdenv.lib.licenses.gpl3Plus;
maintainers = with stdenv.lib.maintainers; [raskin]; maintainers = with stdenv.lib.maintainers; [ raskin doronbehar ];
description = "Scientific Pragramming Language"; description = "Scientific Pragramming Language";
# https://savannah.gnu.org/bugs/?func=detailitem&item_id=56425 is the best attempt to fix JIT # https://savannah.gnu.org/bugs/?func=detailitem&item_id=56425 is the best attempt to fix JIT
broken = enableJIT; broken = enableJIT;

View File

@ -25,10 +25,10 @@ stdenv.mkDerivation rec {
"BLAS=-L${blas}/lib -lblas" "BLAS=-L${blas}/lib -lblas"
"PREFIX=${placeholder "out"}" "PREFIX=${placeholder "out"}"
${stdenv.lib.optionalString blas.isILP64 ${stdenv.lib.optionalString blas.isILP64
# Use their FFLAGS along with `-fdefault-integer-8`. If another # If another application intends to use qrupdate compiled with blas with
# application intends to use arpack, it should add this to it's FFLAGS as # 64 bit support, it should add this to it's FFLAGS as well. See (e.g):
# well. Otherwise (e.g): https://savannah.gnu.org/bugs/?50339 # https://savannah.gnu.org/bugs/?50339
"FFLAGS=-fimplicit-none -O3 -funroll-loops -fdefault-integer-8" "FFLAGS=-fdefault-integer-8"
} }
) )
''; '';

View File

@ -1,59 +0,0 @@
{ stdenv
, cmake
, fetchurl
, python
# GNU Octave needs KLU for ODE solvers
, suitesparse
, blas, lapack
, gfortran
, lapackSupport ? true }:
assert (!blas.isILP64) && (!lapack.isILP64);
stdenv.mkDerivation rec {
pname = "sundials";
version = "2.7.0";
buildInputs = [ python ] ++ stdenv.lib.optionals (lapackSupport) [
gfortran
suitesparse
];
nativeBuildInputs = [ cmake ];
src = fetchurl {
url = "https://computation.llnl.gov/projects/${pname}/download/${pname}-${version}.tar.gz";
sha256 = "01513g0j7nr3rh7hqjld6mw0mcx5j9z9y87bwjc16w2x2z3wm7yk";
};
patches = [
(fetchurl {
# https://github.com/LLNL/sundials/pull/19
url = "https://github.com/LLNL/sundials/commit/1350421eab6c5ab479de5eccf6af2dcad1eddf30.patch";
sha256 = "0g67lixp9m85fqpb9rzz1hl1z8ibdg0ldwq5z6flj5zl8a7cw52l";
})
];
cmakeFlags = [
"-DEXAMPLES_INSTALL_PATH=${placeholder "out"}/share/examples"
] ++ stdenv.lib.optionals (lapackSupport) [
"-DSUNDIALS_INDEX_TYPE=int32_t"
# GNU Octave needs KLU for ODE solvers
"-DKLU_ENABLE=ON"
"-DKLU_INCLUDE_DIR=${suitesparse}/include"
"-DKLU_LIBRARY_DIR=${suitesparse}/lib"
"-DLAPACK_ENABLE=ON"
"-DLAPACK_LIBRARIES=${lapack}/lib/lapack${stdenv.hostPlatform.extensions.sharedLibrary};${blas}/lib/blas${stdenv.hostPlatform.extensions.sharedLibrary}"
];
# flaky tests, and patch in https://github.com/LLNL/sundials/pull/21 doesn't apply cleanly for sundials_3
doCheck = false;
checkPhase = "make test";
meta = with stdenv.lib; {
description = "Suite of nonlinear differential/algebraic equation solvers";
homepage = "https://computation.llnl.gov/projects/sundials";
platforms = platforms.all;
maintainers = with maintainers; [ idontgetoutmuch ];
license = licenses.bsd3;
};
}

View File

@ -10561,19 +10561,16 @@ in
octave = callPackage ../development/interpreters/octave { octave = callPackage ../development/interpreters/octave {
python = python3; python = python3;
mkDerivation = stdenv.mkDerivation; mkDerivation = stdenv.mkDerivation;
jdk = jdk8; # TODO: remove override https://github.com/NixOS/nixpkgs/pull/89731
}; };
octave-jit = callPackage ../development/interpreters/octave { octave-jit = callPackage ../development/interpreters/octave {
python = python3; python = python3;
enableJIT = true; enableJIT = true;
mkDerivation = stdenv.mkDerivation; mkDerivation = stdenv.mkDerivation;
jdk = jdk8; # TODO: remove override https://github.com/NixOS/nixpkgs/pull/89731
}; };
octaveFull = libsForQt5.callPackage ../development/interpreters/octave { octaveFull = libsForQt5.callPackage ../development/interpreters/octave {
python = python3; python = python3;
enableQt = true; enableQt = true;
overridePlatforms = ["x86_64-linux" "x86_64-darwin"]; overridePlatforms = ["x86_64-linux" "x86_64-darwin"];
jdk = jdk8; # TODO: remove override https://github.com/NixOS/nixpkgs/pull/89731
}; };
ocropus = callPackage ../applications/misc/ocropus { }; ocropus = callPackage ../applications/misc/ocropus { };
@ -16195,10 +16192,6 @@ in
python = python3; python = python3;
}; };
sundials_2 = callPackage ../development/libraries/sundials/2.x.nix {
python = python3;
};
sutils = callPackage ../tools/misc/sutils { }; sutils = callPackage ../tools/misc/sutils { };
svrcore = callPackage ../development/libraries/svrcore { }; svrcore = callPackage ../development/libraries/svrcore { };

View File

@ -9,7 +9,7 @@ let
blasUsers = [ blasUsers = [
# "julia_07" "julia_10" "julia_11" "julia_13" "octave" "octaveFull" # "julia_07" "julia_10" "julia_11" "julia_13" "octave" "octaveFull"
"fflas-ffpack" "linbox" "R" "ipopt" "hpl" "rspamd" "octopus" "fflas-ffpack" "linbox" "R" "ipopt" "hpl" "rspamd" "octopus"
"sundials" "sundials_2" "superlu" "suitesparse_5_3" "suitesparse_4_4" "sundials" "superlu" "suitesparse_5_3" "suitesparse_4_4"
"suitesparse_4_2" "scs" "scalapack" "petsc" "cholmod-extra" "suitesparse_4_2" "scs" "scalapack" "petsc" "cholmod-extra"
"arpack" "qrupdate" "libcint" "iml" "globalarrays" "arrayfire" "armadillo" "arpack" "qrupdate" "libcint" "iml" "globalarrays" "arrayfire" "armadillo"
"xfitter" "lammps" "plink-ng" "quantum-espresso" "siesta" "xfitter" "lammps" "plink-ng" "quantum-espresso" "siesta"