about summary refs log tree commit diff
path: root/pkgs/development/interpreters/octave
diff options
context:
space:
mode:
authorThomas Tuegel <ttuegel@gmail.com>2015-06-07 13:45:36 -0500
committerThomas Tuegel <ttuegel@gmail.com>2015-06-07 14:16:37 -0500
commit614c867b29299668dced9ab705bacebcd433bef3 (patch)
tree489b95378aa64c2e9485578c07720a91bc08f47e /pkgs/development/interpreters/octave
parentfa290cb741cb23a04024f09e2018d5ea7bc0e3a3 (diff)
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.)
Diffstat (limited to 'pkgs/development/interpreters/octave')
-rw-r--r--pkgs/development/interpreters/octave/default.nix26
1 files changed, 22 insertions, 4 deletions
diff --git a/pkgs/development/interpreters/octave/default.nix b/pkgs/development/interpreters/octave/default.nix
index 9ad8c2790da60..bdf6f77527775 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