Fixing octave, so plot(1) works.

Linking octave with clapack did not work.

I updated lapack, and additionally I build it with atlas, instead of blas. That should give
better performance. I don't know if atlas builds everywhere though.

On the other hand, maybe some programs linking with liblapack will fail. We'll have to check
the hydra reports.

I plan to remove clapack; liblapack provides a C interface too.


svn path=/nixpkgs/trunk/; revision=32464
This commit is contained in:
Lluís Batlle i Rossell 2012-02-21 21:43:44 +00:00
parent 8cb96ff7b2
commit 5e2de19cc1
4 changed files with 16 additions and 91 deletions

View File

@ -1,5 +1,5 @@
{stdenv, fetchurl, gfortran, readline, ncurses, perl, flex, texinfo, qhull,
libX11, graphicsmagick, pcre, atlas, clapack, texLive }:
libX11, graphicsmagick, pcre, liblapack, texLive, pkgconfig }:
stdenv.mkDerivation rec {
name = "octave-3.4.3";
@ -9,13 +9,9 @@ stdenv.mkDerivation rec {
};
buildInputs = [ gfortran readline ncurses perl flex texinfo qhull libX11
graphicsmagick pcre clapack atlas texLive ];
graphicsmagick pcre liblapack texLive pkgconfig ];
enableParallelBuilding = true;
preConfigure = ''
configureFlagsArray=('--with-blas=-L${atlas}/lib -lf77blas -latlas'
'--with-lapack=-L${clapack}/lib -llapack -lf2c')
'';
configureFlags = [ "--enable-readline" "--enable-dl" ];
}

View File

@ -1,24 +0,0 @@
diff -Naur lapack-3.2.old/SRC/Makefile lapack-3.2/SRC/Makefile
--- lapack-3.2.old/SRC/Makefile 2009-02-04 11:33:35.006839507 +0100
+++ lapack-3.2/SRC/Makefile 2009-02-04 11:33:51.987551506 +0100
@@ -367,7 +367,7 @@
$(ALLAUX)
../$(LAPACKLIB): $(ALLOBJ) $(ALLXOBJ)
- $(ARCH) $(ARCHFLAGS) $@ $(ALLOBJ) $(ALLXOBJ)
+ $(ARCH) $(ARCHFLAGS) $@ $(ALLOBJ) $(ALLXOBJ) ${BLASLIB}
$(RANLIB) $@
single: $(SLASRC) $(ALLAUX) $(SCLAUX)
diff -Naur lapack-3.2.old/TESTING/MATGEN/Makefile lapack-3.2/TESTING/MATGEN/Makefile
--- lapack-3.2.old/TESTING/MATGEN/Makefile 2009-02-04 11:35:10.426806473 +0100
+++ lapack-3.2/TESTING/MATGEN/Makefile 2009-02-04 11:34:42.850565181 +0100
@@ -60,7 +60,7 @@
../../$(TMGLIB): $(SMATGEN) $(CMATGEN) $(SCATGEN) $(DMATGEN) \
$(ZMATGEN) $(DZATGEN)
- $(ARCH) $(ARCHFLAGS) $@ $(ALLOBJ)
+ $(ARCH) $(ARCHFLAGS) $@ $(ALLOBJ) ${BLASLIB}
$(RANLIB) $@
single: $(SMATGEN) $(SCATGEN)

View File

@ -1,66 +1,23 @@
{ stdenv, fetchurl, gfortran, blas }:
{ stdenv, fetchurl, gfortran, atlas, cmake }:
stdenv.mkDerivation {
name = "liblapack-3.2.1";
name = "liblapack-3.4.0";
src = fetchurl {
url = "http://www.netlib.org/lapack/lapack-3.2.1.tgz";
sha256 = "5825f83971157001fd4235514afe8ff5fc16e1c06b2e872e442c242efd6c166d";
url = "http://www.netlib.org/lapack/lapack-3.4.0.tgz";
sha256 = "1sf30v1ps5icg67dvw5sbx5yhypx13am470gqg2f7l04f3wrw4x7";
};
buildInputs = [gfortran blas];
patches = [ ./blas-link.patch ];
propagatedBuildInputs = [ atlas ];
buildInputs = [ gfortran cmake ];
configurePhase = ''
echo >make.inc "SHELL = ${stdenv.shell}"
echo >>make.inc "PLAT ="
echo >>make.inc "FORTRAN = gfortran"
echo >>make.inc "OPTS = -O2 -fPIC"
echo >>make.inc "DRVOPTS = \$(OPTS)"
echo >>make.inc "NOOPT = -O0 -fPIC"
echo >>make.inc "LOADER = gfortran"
echo >>make.inc "LOADOPTS ="
echo >>make.inc "TIMER = INT_ETIME"
echo >>make.inc "ARCH = gfortran"
echo >>make.inc "ARCHFLAGS = -shared -o"
echo >>make.inc "RANLIB = echo"
echo >>make.inc "BLASLIB = -lblas"
echo >>make.inc "LAPACKLIB = liblapack.so.3"
echo >>make.inc "TMGLIB = libtmglib.so.3"
echo >>make.inc "EIGSRCLIB = libeigsrc.so.3"
echo >>make.inc "LINSRCLIB = liblinsrc.so.3"
'';
cmakeFlags = [
"-DUSE_OPTIMIZED_BLAS=ON"
"-DBLAS_ATLAS_f77blas_LIBRARY=${atlas}/lib/libf77blas.a"
"-DBLAS_ATLAS_atlas_LIBRARY=${atlas}/lib/libatlas.a"
"-DCMAKE_Fortran_FLAGS=-fPIC"
];
buildPhase = ''
make clean
make lib
echo >make.inc "SHELL = ${stdenv.shell}"
echo >>make.inc "PLAT ="
echo >>make.inc "FORTRAN = gfortran"
echo >>make.inc "OPTS = -O2 -fPIC"
echo >>make.inc "DRVOPTS = \$(OPTS)"
echo >>make.inc "NOOPT = -O0 -fPIC"
echo >>make.inc "LOADER = gfortran"
echo >>make.inc "LOADOPTS = "
echo >>make.inc "TIMER = INT_ETIME"
echo >>make.inc "ARCH = ar rcs"
echo >>make.inc "RANLIB = ranlib"
echo >>make.inc "BLASLIB = "
echo >>make.inc "ARCHFLAGS ="
echo >>make.inc "LAPACKLIB = liblapack.a"
echo >>make.inc "TMGLIB = tmglib.a"
echo >>make.inc "EIGSRCLIB = eigsrc.a"
echo >>make.inc "LINSRCLIB = linsrc.a"
make clean
make lib
'';
installPhase = ''
ensureDir "$out/lib"
install -m755 *.a* "$out/lib"
install -m755 *.so* "$out/lib"
ln -sf liblapack.so.3 "$out/lib/liblapack.so"
ln -sf libtmglib.so.3 "$out/lib/libtmglib.so"
'';
enableParallelBuilding = true;
meta = {
description = "Linear Algebra PACKage";

View File

@ -2664,11 +2664,7 @@ let
maude = callPackage ../development/interpreters/maude { };
octave = callPackage ../development/interpreters/octave {
clapack = clapack.override {
withPIC = true;
};
};
octave = callPackage ../development/interpreters/octave { };
# mercurial (hg) bleeding edge version
octaveHG = callPackage ../development/interpreters/octave/hg.nix { };