From 614c867b29299668dced9ab705bacebcd433bef3 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sun, 7 Jun 2015 13:45:36 -0500 Subject: [PATCH] octave: build with openblas The expression inherits integer width from OpenBLAS, so Octave will use 64-bit integers if OpenBLAS supports it. However, this feature in Octave is experimental, so we continue to use OpenBLAS with 32-bit integers by default. (This only applies to the integer width, the pointer width is always the platform-native width.) --- .../interpreters/octave/default.nix | 26 ++++++++++++++++--- pkgs/top-level/all-packages.nix | 1 + 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/pkgs/development/interpreters/octave/default.nix b/pkgs/development/interpreters/octave/default.nix index 9ad8c2790da6..bdf6f7752777 100644 --- a/pkgs/development/interpreters/octave/default.nix +++ b/pkgs/development/interpreters/octave/default.nix @@ -1,10 +1,22 @@ { stdenv, fetchurl, gfortran, readline, ncurses, perl, flex, texinfo, qhull -, libX11, graphicsmagick, pcre, liblapack, pkgconfig, mesa, fltk -, fftw, fftwSinglePrec, zlib, curl, qrupdate +, libX11, graphicsmagick, pcre, pkgconfig, mesa, fltk +, fftw, fftwSinglePrec, zlib, curl, qrupdate, openblas , qt ? null, qscintilla ? null, ghostscript ? null, llvm ? null, hdf5 ? null,glpk ? null , suitesparse ? null, gnuplot ? null, jdk ? null, python ? null }: +let + suitesparseOrig = suitesparse; + qrupdateOrig = qrupdate; +in +# integer width is determined by openblas, so all dependencies must be built +# with exactly the same openblas +let + suitesparse = + if suitesparseOrig != null then suitesparseOrig.override { inherit openblas; } else null; + qrupdate = if qrupdateOrig != null then qrupdateOrig.override { inherit openblas; } else null; +in + stdenv.mkDerivation rec { version = "4.0.0"; name = "octave-${version}"; @@ -14,7 +26,7 @@ stdenv.mkDerivation rec { }; buildInputs = [ gfortran readline ncurses perl flex texinfo qhull libX11 - graphicsmagick pcre liblapack pkgconfig mesa fltk zlib curl + graphicsmagick pcre pkgconfig mesa fltk zlib curl openblas fftw fftwSinglePrec qrupdate ] ++ (stdenv.lib.optional (qt != null) qt) ++ (stdenv.lib.optional (qscintilla != null) qscintilla) @@ -34,7 +46,13 @@ stdenv.mkDerivation rec { # problems on Hydra enableParallelBuilding = false; - configureFlags = [ "--enable-readline" "--enable-dl" ]; + configureFlags = + [ "--enable-readline" + "--enable-dl" + "--with-blas=openblas" + "--with-lapack=openblas" + ] + ++ stdenv.lib.optional openblas.blas64 "--enable-64"; # Keep a copy of the octave tests detailed results in the output # derivation, because someone may care diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9f95e32e9511..69c46414c9e3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4820,6 +4820,7 @@ let glpk = null; suitesparse = null; jdk = null; + openblas = openblasCompat; }; octaveFull = (lowPrio (callPackage ../development/interpreters/octave { fltk = fltk13.override { cfg.xftSupport = true; };