2010-01-26 15:53:08 +01:00
|
|
|
{ stdenv, fetchurl, gfortran }:
|
2015-12-11 10:24:27 +01:00
|
|
|
let
|
|
|
|
version = "3.5.0";
|
|
|
|
in
|
2015-10-22 20:11:30 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2015-12-11 10:24:27 +01:00
|
|
|
name = "blas-${version}";
|
2010-01-26 15:53:08 +01:00
|
|
|
src = fetchurl {
|
2015-10-22 20:11:30 +02:00
|
|
|
url = "http://www.netlib.org/blas/${name}.tgz";
|
|
|
|
sha256 = "096a3apnh899abjymjjg8m34hncagkzp9qxw08cms98g71fpfzgg";
|
2010-01-26 15:53:08 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [gfortran];
|
|
|
|
|
|
|
|
configurePhase = ''
|
2010-01-29 01:17:59 +01:00
|
|
|
echo >make.inc "SHELL = ${stdenv.shell}"
|
2010-01-26 15:53:08 +01:00
|
|
|
echo >>make.inc "PLAT = _LINUX"
|
|
|
|
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 "ARCH = gfortran"
|
|
|
|
echo >>make.inc "ARCHFLAGS = -shared -o"
|
|
|
|
echo >>make.inc "RANLIB = echo"
|
2015-12-11 10:24:27 +01:00
|
|
|
echo >>make.inc "BLASLIB = libblas.so.${version}"
|
2010-01-26 15:53:08 +01:00
|
|
|
'';
|
|
|
|
|
2010-07-09 15:15:56 +02:00
|
|
|
buildPhase = ''
|
|
|
|
make
|
|
|
|
echo >>make.inc "ARCHFLAGS = "
|
|
|
|
echo >>make.inc "BLASLIB = libblas.a"
|
|
|
|
echo >>make.inc "ARCH = ar rcs"
|
|
|
|
echo >>make.inc "RANLIB = ranlib"
|
|
|
|
make
|
|
|
|
'';
|
2012-10-18 10:14:06 +02:00
|
|
|
|
|
|
|
installPhase =
|
|
|
|
# FreeBSD's stdenv doesn't use Coreutils.
|
2012-10-18 17:34:49 +02:00
|
|
|
let dashD = if stdenv.isFreeBSD then "" else "-D"; in
|
|
|
|
(stdenv.lib.optionalString stdenv.isFreeBSD "mkdir -p $out/lib ;")
|
|
|
|
+ ''
|
2012-10-18 10:14:06 +02:00
|
|
|
install ${dashD} -m755 libblas.a "$out/lib/libblas.a"
|
2015-12-11 10:24:27 +01:00
|
|
|
install ${dashD} -m755 libblas.so.${version} "$out/lib/libblas.so.${version}"
|
|
|
|
ln -s libblas.so.${version} "$out/lib/libblas.so.3"
|
|
|
|
ln -s libblas.so.${version} "$out/lib/libblas.so"
|
2010-01-26 15:53:08 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Basic Linear Algebra Subprograms";
|
2014-11-06 01:44:33 +01:00
|
|
|
license = stdenv.lib.licenses.publicDomain;
|
2010-01-26 15:53:08 +01:00
|
|
|
homepage = "http://www.netlib.org/blas/";
|
2016-08-02 19:50:55 +02:00
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2010-01-26 15:53:08 +01:00
|
|
|
};
|
|
|
|
}
|