summary refs log tree commit diff
path: root/pkgs/applications/science/math
diff options
context:
space:
mode:
authorDaniƫl de Kok <me@github.danieldk.eu>2018-09-04 11:37:54 +0200
committerxeji <36407913+xeji@users.noreply.github.com>2018-09-04 11:37:54 +0200
commit93a594715881e626a61488042a5796d253914f7e (patch)
treee1cf1cc33536e38f0d2ddf8ae3742a2741b40ba2 /pkgs/applications/science/math
parent6767396e380b39128e5decf30d6cb87481a75490 (diff)
downloadnixlib-93a594715881e626a61488042a5796d253914f7e.tar
nixlib-93a594715881e626a61488042a5796d253914f7e.tar.gz
nixlib-93a594715881e626a61488042a5796d253914f7e.tar.bz2
nixlib-93a594715881e626a61488042a5796d253914f7e.tar.lz
nixlib-93a594715881e626a61488042a5796d253914f7e.tar.xz
nixlib-93a594715881e626a61488042a5796d253914f7e.tar.zst
nixlib-93a594715881e626a61488042a5796d253914f7e.zip
mxnet: 1.1.0 -> 1.2.1 (#46026)
Update and fix the build:

- Perl is a build-time requirement.
- Fix hardcoded /bin/bash invocation.
Diffstat (limited to 'pkgs/applications/science/math')
-rw-r--r--pkgs/applications/science/math/mxnet/default.nix26
1 files changed, 16 insertions, 10 deletions
diff --git a/pkgs/applications/science/math/mxnet/default.nix b/pkgs/applications/science/math/mxnet/default.nix
index ce9c214b3f0c..a3043bcf6952 100644
--- a/pkgs/applications/science/math/mxnet/default.nix
+++ b/pkgs/applications/science/math/mxnet/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, lib, fetchgit, cmake
-, opencv, gtest, openblas, liblapack
+{ stdenv, lib, fetchurl, bash, cmake
+, opencv, gtest, openblas, liblapack, perl
 , cudaSupport ? false, cudatoolkit, nvidia_x11
 , cudnnSupport ? false, cudnn
 }:
@@ -8,16 +8,17 @@ assert cudnnSupport -> cudaSupport;
 
 stdenv.mkDerivation rec {
   name = "mxnet-${version}";
-  version = "1.1.0";
-
-  # Submodules needed
-  src = fetchgit {
-    url = "https://github.com/apache/incubator-mxnet";
-    rev = "refs/tags/${version}";
-    sha256 = "1qgns0c70a1gfyil96h17ms736nwdkp9kv496gvs9pkzqzvr6cpz";
+  version = "1.2.1";
+
+  # Fetching from git does not work at the time (1.2.1) due to an
+  # incorrect hash in one of the submodules. The provided tarballs
+  # contain all necessary sources.
+  src = fetchurl {
+    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 ]
               ++ lib.optionals cudaSupport [ cudatoolkit nvidia_x11 ]
@@ -30,6 +31,11 @@ stdenv.mkDerivation rec {
     ] else [ "-DUSE_CUDA=OFF" ])
     ++ lib.optional (!cudnnSupport) "-DUSE_CUDNN=OFF";
 
+  postPatch = ''
+    substituteInPlace 3rdparty/mkldnn/tests/CMakeLists.txt \
+      --replace "/bin/bash" "${bash}/bin/bash"
+  '';
+
   installPhase = ''
     install -Dm755 libmxnet.so $out/lib/libmxnet.so
     cp -r ../include $out