54 lines
1.6 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, cmake, gfortran, ninja, cudatoolkit, libpthreadstubs, lapack, blas }:
2016-05-23 21:12:06 +00:00
with stdenv.lib;
let version = "2.5.3";
2016-05-23 21:12:06 +00:00
in stdenv.mkDerivation {
2019-08-13 21:52:01 +00:00
pname = "magma";
inherit version;
2016-05-23 21:12:06 +00:00
src = fetchurl {
url = "https://icl.cs.utk.edu/projectsfiles/magma/downloads/magma-${version}.tar.gz";
sha256 = "1xjy3irdx0w1zyhvn4x47zni5fwsh6z97xd4yqldz8zrm5lx40n6";
2016-05-23 21:12:06 +00:00
name = "magma-${version}.tar.gz";
};
nativeBuildInputs = [ gfortran cmake ninja ];
buildInputs = [ cudatoolkit libpthreadstubs lapack blas ];
2016-05-23 21:12:06 +00:00
doCheck = false;
2019-05-12 01:00:57 -07:00
2019-10-20 17:06:31 -04:00
preConfigure = ''
export CC=${cudatoolkit.cc}/bin/gcc CXX=${cudatoolkit.cc}/bin/g++
'';
2016-05-23 21:12:06 +00:00
enableParallelBuilding=true;
2019-05-12 01:00:57 -07:00
buildFlags = [ "magma" "magma_sparse" ];
2016-05-23 21:12:06 +00:00
# MAGMA's default CMake setup does not care about installation. So we copy files directly.
installPhase = ''
mkdir -p $out
mkdir -p $out/include
mkdir -p $out/lib
mkdir -p $out/lib/pkgconfig
cp -a ../include/*.h $out/include
#cp -a sparse-iter/include/*.h $out/include
cp -a lib/*.so $out/lib
2016-05-23 21:12:06 +00:00
cat ../lib/pkgconfig/magma.pc.in | \
sed -e s:@INSTALL_PREFIX@:"$out": | \
sed -e s:@CFLAGS@:"-I$out/include": | \
sed -e s:@LIBS@:"-L$out/lib -lmagma -lmagma_sparse": | \
sed -e s:@MAGMA_REQUIRED@:: \
> $out/lib/pkgconfig/magma.pc
'';
meta = with stdenv.lib; {
description = "Matrix Algebra on GPU and Multicore Architectures";
license = licenses.bsd3;
homepage = "http://icl.cs.utk.edu/magma/index.html";
2016-05-23 21:12:06 +00:00
platforms = platforms.unix;
2019-05-12 01:00:57 -07:00
maintainers = with maintainers; [ tbenst ];
2016-05-23 21:12:06 +00:00
};
}