mxnet: 1.1.0 -> 1.2.1 (#46026)

Update and fix the build:

- Perl is a build-time requirement.
- Fix hardcoded /bin/bash invocation.
This commit is contained in:
Daniël de Kok 2018-09-04 11:37:54 +02:00 committed by xeji
parent 6767396e38
commit 93a5947158

View File

@ -1,5 +1,5 @@
{ stdenv, lib, fetchgit, cmake { stdenv, lib, fetchurl, bash, cmake
, opencv, gtest, openblas, liblapack , opencv, gtest, openblas, liblapack, perl
, cudaSupport ? false, cudatoolkit, nvidia_x11 , cudaSupport ? false, cudatoolkit, nvidia_x11
, cudnnSupport ? false, cudnn , cudnnSupport ? false, cudnn
}: }:
@ -8,16 +8,17 @@ assert cudnnSupport -> cudaSupport;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "mxnet-${version}"; name = "mxnet-${version}";
version = "1.1.0"; version = "1.2.1";
# Submodules needed # Fetching from git does not work at the time (1.2.1) due to an
src = fetchgit { # incorrect hash in one of the submodules. The provided tarballs
url = "https://github.com/apache/incubator-mxnet"; # contain all necessary sources.
rev = "refs/tags/${version}"; src = fetchurl {
sha256 = "1qgns0c70a1gfyil96h17ms736nwdkp9kv496gvs9pkzqzvr6cpz"; url = "https://github.com/apache/incubator-mxnet/releases/download/${version}/apache-mxnet-src-${version}-incubating.tar.gz";
sha256 = "053zbdgs4j8l79ipdz461zc7wyfbfcflmi5bw7lj2q08zm1glnb2";
}; };
nativeBuildInputs = [ cmake ]; nativeBuildInputs = [ cmake perl ];
buildInputs = [ opencv gtest openblas liblapack ] buildInputs = [ opencv gtest openblas liblapack ]
++ lib.optionals cudaSupport [ cudatoolkit nvidia_x11 ] ++ lib.optionals cudaSupport [ cudatoolkit nvidia_x11 ]
@ -30,6 +31,11 @@ stdenv.mkDerivation rec {
] else [ "-DUSE_CUDA=OFF" ]) ] else [ "-DUSE_CUDA=OFF" ])
++ lib.optional (!cudnnSupport) "-DUSE_CUDNN=OFF"; ++ lib.optional (!cudnnSupport) "-DUSE_CUDNN=OFF";
postPatch = ''
substituteInPlace 3rdparty/mkldnn/tests/CMakeLists.txt \
--replace "/bin/bash" "${bash}/bin/bash"
'';
installPhase = '' installPhase = ''
install -Dm755 libmxnet.so $out/lib/libmxnet.so install -Dm755 libmxnet.so $out/lib/libmxnet.so
cp -r ../include $out cp -r ../include $out