2010-01-26 14:53:13 +00:00
|
|
|
{ stdenv, fetchurl, gfortran, blas }:
|
2008-10-05 09:01:59 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2010-01-26 14:53:13 +00:00
|
|
|
name = "liblapack-3.2.1";
|
2008-10-05 09:01:59 +00:00
|
|
|
src = fetchurl {
|
2010-01-26 14:53:13 +00:00
|
|
|
url = "http://www.netlib.org/lapack/lapack-3.2.1.tgz";
|
|
|
|
sha256 = "5825f83971157001fd4235514afe8ff5fc16e1c06b2e872e442c242efd6c166d";
|
2008-10-05 09:01:59 +00:00
|
|
|
};
|
|
|
|
|
2010-01-26 14:53:13 +00:00
|
|
|
buildInputs = [gfortran blas];
|
|
|
|
patches = [ ./blas-link.patch ];
|
|
|
|
|
|
|
|
configurePhase = ''
|
2010-01-29 00:17:59 +00:00
|
|
|
echo >make.inc "SHELL = ${stdenv.shell}"
|
2010-01-26 14:53:13 +00:00
|
|
|
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"
|
|
|
|
'';
|
2008-10-05 09:01:59 +00:00
|
|
|
|
|
|
|
buildPhase = ''
|
2010-01-26 14:53:13 +00:00
|
|
|
make clean
|
|
|
|
make lib
|
2010-07-09 13:15:56 +00:00
|
|
|
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
|
2008-10-05 09:01:59 +00:00
|
|
|
'';
|
2010-01-26 14:53:13 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
ensureDir "$out/lib"
|
2010-07-09 13:15:56 +00:00
|
|
|
install -m755 *.a* "$out/lib"
|
2010-01-26 14:53:13 +00:00
|
|
|
install -m755 *.so* "$out/lib"
|
|
|
|
ln -sf liblapack.so.3 "$out/lib/liblapack.so"
|
|
|
|
ln -sf libtmglib.so.3 "$out/lib/libtmglib.so"
|
|
|
|
'';
|
|
|
|
|
2008-10-05 09:01:59 +00:00
|
|
|
meta = {
|
2010-01-26 14:53:13 +00:00
|
|
|
description = "Linear Algebra PACKage";
|
2010-01-26 19:28:09 +00:00
|
|
|
license = "revised-BSD";
|
2010-01-26 14:53:13 +00:00
|
|
|
homepage = "http://www.netlib.org/lapack/";
|
2008-10-05 09:01:59 +00:00
|
|
|
};
|
|
|
|
}
|