suitesparse_4_2: build with openblas

Compared to ATLAS, OpenBLAS offers better performance, faster builds,
and dynamic architecture detection.
This commit is contained in:
Thomas Tuegel 2015-06-03 17:31:34 -05:00
parent b4eb8a5bc3
commit 982aabc561
2 changed files with 28 additions and 24 deletions

View file

@ -1,22 +1,44 @@
{ stdenv, fetchurl, blas, liblapack, gfortran } :
{ stdenv, fetchurl, gfortran, openblas }:
let
int_t = if openblas.blas64 then "int64_t" else "int32_t";
in
stdenv.mkDerivation rec {
version = "4.2.1";
name = "suitesparse-${version}";
src = fetchurl {
url = "http://www.cise.ufl.edu/research/sparse/SuiteSparse/SuiteSparse-${version}.tar.gz" ;
sha256 = "1ga69637x7kdkiy3w3lq9dvva7220bdangv2lch2wx1hpi83h0p8";
sha256 = "1ga69637x7kdkiy3w3lq9dvva7220bdangv2lch2wx1hpi83h0p8";
};
buildInputs = [blas liblapack gfortran] ;
patches = [./disable-metis.patch];
nativeBuildInputs = [ gfortran ];
buildInputs = [ openblas ];
preConfigure = ''
export PREFIX=$out
mkdir -p $out/lib
mkdir -p $out/include
sed -i "SuiteSparse_config/SuiteSparse_config.mk" \
-e 's/METIS .*$/METIS =/' \
-e 's/METIS_PATH .*$/METIS_PATH =/' \
-e '/CHOLMOD_CONFIG/ s/$/-DNPARTITION -DLONGBLAS=${int_t}/' \
-e '/UMFPACK_CONFIG/ s/$/-DLONGBLAS=${int_t}/'
'';
makeFlags = ''PREFIX=\"$(out)\" INSTALL_LIB=$(out)/lib INSTALL_INCLUDE=$(out)/include'';
makeFlags = [
"PREFIX=\"$(out)\""
"INSTALL_LIB=$(out)/lib"
"INSTALL_INCLUDE=$(out)/include"
"BLAS=-lopenblas"
"LAPACK="
];
NIX_CFLAGS = "-fPIC";
meta = with stdenv.lib; {
homepage = http://faculty.cse.tamu.edu/davis/suitesparse.html;
description = "A suite of sparse matrix algorithms";
license = with licenses; [ bsd2 gpl2Plus lgpl21Plus ];
maintainers = with maintainers; [ ttuegel ];
};
}

View file

@ -1,18 +0,0 @@
diff -Nrc SuiteSparse/UMFPACK/Demo/Makefile SuiteSparse-new/UMFPACK/Demo/Makefile
*** SuiteSparse/UMFPACK/Demo/Makefile 2009-11-11 21:09:45.000000000 +0100
--- SuiteSparse-new/UMFPACK/Demo/Makefile 2010-08-02 12:53:16.000000000 +0200
***************
*** 40,46 ****
../../CAMD/Lib/libcamd.a:
( cd ../../CAMD ; $(MAKE) library )
- $(METIS):
- ( cd $(METIS_PATH) && $(MAKE) )
UMFPACK = ../Lib/libumfpack.a ../../AMD/Lib/libamd.a \
--- 40,44 ----
../../CAMD/Lib/libcamd.a:
( cd ../../CAMD ; $(MAKE) library )
UMFPACK = ../Lib/libumfpack.a ../../AMD/Lib/libamd.a \