3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/libraries/science/math/magma/default.nix

55 lines
1.6 KiB
Nix
Raw Normal View History

2019-05-12 09:00:57 +01:00
{ stdenv, fetchurl, cmake, gfortran, cudatoolkit, libpthreadstubs, liblapack
, mklSupport ? false, mkl ? null
}:
assert !mklSupport || mkl != null;
2016-05-23 22:12:06 +01:00
with stdenv.lib;
2019-05-12 09:00:57 +01:00
let version = "2.5.0";
2016-05-23 22:12:06 +01:00
in stdenv.mkDerivation {
2019-08-13 22:52:01 +01:00
pname = "magma";
inherit version;
2016-05-23 22:12:06 +01:00
src = fetchurl {
url = "https://icl.cs.utk.edu/projectsfiles/magma/downloads/magma-${version}.tar.gz";
2019-05-12 09:00:57 +01:00
sha256 = "0czspk93cv1fy37zyrrc9k306q4yzfxkhy1y4lj937dx8rz5rm2g";
2016-05-23 22:12:06 +01:00
name = "magma-${version}.tar.gz";
};
2019-05-12 09:00:57 +01:00
buildInputs = [ gfortran cudatoolkit libpthreadstubs cmake ]
++ (if mklSupport then [ mkl ] else [ liblapack ]);
2016-05-23 22:12:06 +01:00
doCheck = false;
2019-05-12 09:00:57 +01:00
2019-09-09 00:38:31 +01:00
MKLROOT = optionalString mklSupport mkl;
2016-05-23 22:12:06 +01:00
enableParallelBuilding=true;
2019-05-12 09:00:57 +01:00
buildFlags = [ "magma" "magma_sparse" ];
2016-05-23 22:12:06 +01: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/*.a $out/lib
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 22:12:06 +01:00
platforms = platforms.unix;
2019-05-12 09:00:57 +01:00
maintainers = with maintainers; [ tbenst ];
2016-05-23 22:12:06 +01:00
};
}