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

View File

@ -25,10 +25,10 @@ stdenv.mkDerivation rec {
"BLAS=-L${blas}/lib -lblas"
"PREFIX=${placeholder "out"}"
${stdenv.lib.optionalString blas.isILP64
# Use their FFLAGS along with `-fdefault-integer-8`. If another
# application intends to use arpack, it should add this to it's FFLAGS as
# well. Otherwise (e.g): https://savannah.gnu.org/bugs/?50339
"FFLAGS=-fimplicit-none -O3 -funroll-loops -fdefault-integer-8"
# If another application intends to use qrupdate compiled with blas with
# 64 bit support, it should add this to it's FFLAGS as well. See (e.g):
# https://savannah.gnu.org/bugs/?50339
"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 {
python = python3;
mkDerivation = stdenv.mkDerivation;
jdk = jdk8; # TODO: remove override https://github.com/NixOS/nixpkgs/pull/89731
};
octave-jit = callPackage ../development/interpreters/octave {
python = python3;
enableJIT = true;
mkDerivation = stdenv.mkDerivation;
jdk = jdk8; # TODO: remove override https://github.com/NixOS/nixpkgs/pull/89731
};
octaveFull = libsForQt5.callPackage ../development/interpreters/octave {
python = python3;
enableQt = true;
overridePlatforms = ["x86_64-linux" "x86_64-darwin"];
jdk = jdk8; # TODO: remove override https://github.com/NixOS/nixpkgs/pull/89731
};
ocropus = callPackage ../applications/misc/ocropus { };
@ -16195,10 +16192,6 @@ in
python = python3;
};
sundials_2 = callPackage ../development/libraries/sundials/2.x.nix {
python = python3;
};
sutils = callPackage ../tools/misc/sutils { };
svrcore = callPackage ../development/libraries/svrcore { };

View File

@ -9,7 +9,7 @@ let
blasUsers = [
# "julia_07" "julia_10" "julia_11" "julia_13" "octave" "octaveFull"
"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"
"arpack" "qrupdate" "libcint" "iml" "globalarrays" "arrayfire" "armadillo"
"xfitter" "lammps" "plink-ng" "quantum-espresso" "siesta"