From 8cb6ced793610ef7b5310eece5aff1c6afbf3cbd Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Tue, 26 Jan 2010 14:53:13 +0000 Subject: [PATCH] pkgs/development/libraries/science/math/liblapack: fixed build and updated to version 3.2.1 svn path=/nixpkgs/trunk/; revision=19672 --- .../science/math/liblapack/blas-link.patch | 24 +++++++++ .../science/math/liblapack/default.nix | 53 ++++++++++++++----- pkgs/top-level/all-packages.nix | 6 +-- 3 files changed, 66 insertions(+), 17 deletions(-) create mode 100644 pkgs/development/libraries/science/math/liblapack/blas-link.patch diff --git a/pkgs/development/libraries/science/math/liblapack/blas-link.patch b/pkgs/development/libraries/science/math/liblapack/blas-link.patch new file mode 100644 index 000000000000..7770142be772 --- /dev/null +++ b/pkgs/development/libraries/science/math/liblapack/blas-link.patch @@ -0,0 +1,24 @@ +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) -lblas + $(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) -lblas + $(RANLIB) $@ + + single: $(SMATGEN) $(SCATGEN) diff --git a/pkgs/development/libraries/science/math/liblapack/default.nix b/pkgs/development/libraries/science/math/liblapack/default.nix index fad9218bbc9a..da8fd03c2bb7 100644 --- a/pkgs/development/libraries/science/math/liblapack/default.nix +++ b/pkgs/development/libraries/science/math/liblapack/default.nix @@ -1,25 +1,50 @@ -args: with args; +{ stdenv, fetchurl, gfortran, blas }: stdenv.mkDerivation { - name = "liblapack-3.1.1"; + name = "liblapack-3.2.1"; src = fetchurl { - url = http://www.netlib.org/lapack/lapack.tgz; - sha256 = "0am0yzgqhaz6yzliaxc2cgm2mbqjzwcq70b01migk5231frkbhz4"; + url = "http://www.netlib.org/lapack/lapack-3.2.1.tgz"; + sha256 = "5825f83971157001fd4235514afe8ff5fc16e1c06b2e872e442c242efd6c166d"; }; - buildInputs = [gfortran]; - patches = [ ./gfortran.patch ]; + buildInputs = [gfortran blas]; + patches = [ ./blas-link.patch ]; + + configurePhase = '' + echo >make.inc "SHELL = ${stdenv.bash}/bin/bash" + 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" + ''; buildPhase = '' - cp make.inc.example make.inc - make blaslib - # make lapacklib - cd SRC - make + make clean + make lib ''; + + installPhase = '' + ensureDir "$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" + ''; + meta = { - description = "lapack library"; - license = "Free, copyrighted"; - homepage = http://www.netlib.org/lapac; + description = "Linear Algebra PACKage"; + license = "Free, copyrighted"; + homepage = "http://www.netlib.org/lapack/"; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8cf05ad9ded4..b828b3f961df 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8406,9 +8406,9 @@ let libXmu libXext libXcursor; }; - /* liblapack = import ../development/libraries/science/math/liblapack { - inherit fetchurl stdenv gfortran; - }; */ + liblapack = import ../development/libraries/science/math/liblapack { + inherit fetchurl stdenv gfortran blas; + }; ### SCIENCE/LOGIC