3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/libraries/science/math/magma/default.nix
Matthew Bauer c85fc341b0 pytorch: update to use passthru's for checks
This makes the checks a little easier to understand - we can just
check it in the passthru. Also increase major check for cuda 11.
2020-09-10 14:23:15 -05:00

56 lines
1.6 KiB
Nix

{ stdenv, fetchurl, cmake, gfortran, ninja, cudatoolkit, libpthreadstubs, lapack, blas }:
with stdenv.lib;
let version = "2.5.3";
in stdenv.mkDerivation {
pname = "magma";
inherit version;
src = fetchurl {
url = "https://icl.cs.utk.edu/projectsfiles/magma/downloads/magma-${version}.tar.gz";
sha256 = "1xjy3irdx0w1zyhvn4x47zni5fwsh6z97xd4yqldz8zrm5lx40n6";
name = "magma-${version}.tar.gz";
};
nativeBuildInputs = [ gfortran cmake ninja ];
buildInputs = [ cudatoolkit libpthreadstubs lapack blas ];
doCheck = false;
preConfigure = ''
export CC=${cudatoolkit.cc}/bin/gcc CXX=${cudatoolkit.cc}/bin/g++
'';
enableParallelBuilding=true;
buildFlags = [ "magma" "magma_sparse" ];
# 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
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";
platforms = platforms.unix;
maintainers = with maintainers; [ tbenst ];
};
passthru.cudatoolkit = cudatoolkit;
}