2017-09-16 03:39:25 +02:00
|
|
|
{ stdenv, lib, fetchgit, cmake
|
|
|
|
, opencv, gtest, openblas, liblapack
|
2017-09-17 18:35:47 +02:00
|
|
|
, cudaSupport ? false, cudatoolkit, nvidia_x11
|
2017-09-16 03:39:25 +02:00
|
|
|
, cudnnSupport ? false, cudnn
|
|
|
|
}:
|
|
|
|
|
|
|
|
assert cudnnSupport -> cudaSupport;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "mxnet-${version}";
|
2018-02-25 18:02:20 +01:00
|
|
|
version = "1.1.0";
|
2017-09-16 03:39:25 +02:00
|
|
|
|
|
|
|
# Submodules needed
|
|
|
|
src = fetchgit {
|
|
|
|
url = "https://github.com/apache/incubator-mxnet";
|
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
sha256 = "1qgns0c70a1gfyil96h17ms736nwdkp9kv496gvs9pkzqzvr6cpz";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
|
|
|
buildInputs = [ opencv gtest openblas liblapack ]
|
2017-09-17 18:35:47 +02:00
|
|
|
++ lib.optionals cudaSupport [ cudatoolkit nvidia_x11 ]
|
2017-09-16 03:39:25 +02:00
|
|
|
++ lib.optional cudnnSupport cudnn;
|
|
|
|
|
2018-02-25 18:02:20 +01:00
|
|
|
cmakeFlags =
|
|
|
|
(if cudaSupport then [
|
|
|
|
"-DCUDA_ARCH_NAME=All"
|
|
|
|
"-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/cc"
|
|
|
|
] else [ "-DUSE_CUDA=OFF" ])
|
|
|
|
++ lib.optional (!cudnnSupport) "-DUSE_CUDNN=OFF";
|
2017-09-16 03:39:25 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -Dm755 libmxnet.so $out/lib/libmxnet.so
|
|
|
|
cp -r ../include $out
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler";
|
2018-02-25 17:47:45 +01:00
|
|
|
homepage = https://mxnet.incubator.apache.org/;
|
2017-09-16 03:39:25 +02:00
|
|
|
maintainers = with maintainers; [ abbradar ];
|
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|