From c13952175c037ea938b9cd0403a76cb288d18d8e Mon Sep 17 00:00:00 2001 From: Theodore Ni <3806110+tjni@users.noreply.github.com> Date: Thu, 22 Sep 2022 16:49:05 -0700 Subject: [PATCH 1/2] mxnet: 1.8.0 -> 1.9.1 --- .../science/math/mxnet/default.nix | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/pkgs/applications/science/math/mxnet/default.nix b/pkgs/applications/science/math/mxnet/default.nix index abff55413cec..599d97639742 100644 --- a/pkgs/applications/science/math/mxnet/default.nix +++ b/pkgs/applications/science/math/mxnet/default.nix @@ -1,4 +1,4 @@ -{ config, stdenv, lib, fetchurl, fetchpatch, bash, cmake +{ config, stdenv, lib, fetchurl, bash, cmake , opencv3, gtest, blas, gomp, llvmPackages, perl , cudaSupport ? config.cudaSupport or false, cudaPackages ? {}, nvidia_x11 , cudnnSupport ? cudaSupport @@ -13,28 +13,14 @@ assert cudnnSupport -> cudaSupport; stdenv.mkDerivation rec { pname = "mxnet"; - version = "1.8.0"; + version = "1.9.1"; src = fetchurl { name = "apache-mxnet-src-${version}-incubating.tar.gz"; url = "https://dlcdn.apache.org/incubator/mxnet/${version}/apache-mxnet-src-${version}-incubating.tar.gz"; - hash = "sha256-la/5hYlaukCcCNVRRRCuOLiEkM+2KBqzpf8PWCbI21Q="; + hash = "sha256-EephMoF02MKblvNBl34D3rC/Sww3rOZY+T442euMkyI="; }; - patches = [ - # Fix build error https://github.com/apache/incubator-mxnet/issues/19405 - (fetchpatch { - name = "mxnet-fix-gcc-linker-error-1.patch"; - url = "https://github.com/apache/incubator-mxnet/commit/78e31d66d19e385ca4ef73245ce79a47e375d8d1.diff"; - sha256 = "sha256-UfmGhh4RbvrEOXe6IJxHm1Aqpy1gS6gHxrX5KQBXjv4="; - }) - (fetchpatch { - name = "mxnet-fix-gcc-linker-error-2.patch"; - url = "https://github.com/apache/incubator-mxnet/commit/9bfe3116aabd01049fdbd90855cb245a30b795df.diff"; - sha256 = "sha256-BL7Zf7Bgn0qpai9HbQ6LBxZNa3iLjVJSe5nxZgqI/fw="; - }) - ]; - nativeBuildInputs = [ cmake perl ]; buildInputs = [ opencv3 gtest blas.provider ] From 5ac4f45f728fc44ddc95f7beabbdc0b9102e508f Mon Sep 17 00:00:00 2001 From: Theodore Ni <3806110+tjni@users.noreply.github.com> Date: Thu, 22 Sep 2022 16:50:21 -0700 Subject: [PATCH 2/2] mxnet: patch to fix build on aarch64-darwin The patches autodetect when the system is x86 and supports SSE. --- .../applications/science/math/mxnet/default.nix | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/science/math/mxnet/default.nix b/pkgs/applications/science/math/mxnet/default.nix index 599d97639742..9a1b550d882d 100644 --- a/pkgs/applications/science/math/mxnet/default.nix +++ b/pkgs/applications/science/math/mxnet/default.nix @@ -1,4 +1,4 @@ -{ config, stdenv, lib, fetchurl, bash, cmake +{ config, stdenv, lib, fetchurl, fetchpatch, bash, cmake , opencv3, gtest, blas, gomp, llvmPackages, perl , cudaSupport ? config.cudaSupport or false, cudaPackages ? {}, nvidia_x11 , cudnnSupport ? cudaSupport @@ -21,6 +21,21 @@ stdenv.mkDerivation rec { hash = "sha256-EephMoF02MKblvNBl34D3rC/Sww3rOZY+T442euMkyI="; }; + patches = [ + # Remove the following two patches when updating mxnet to 2.0. + (fetchpatch { + name = "1-auto-disable-sse-for-non-x86.patch"; + url = "https://github.com/apache/incubator-mxnet/commit/55e69871d4cadec51a8bbb6700131065388cb0b9.patch"; + hash = "sha256-uaMpM0F9HRtEBXz2ewB/dlbuKaY5/RineCPUE2T6CHU="; + }) + (fetchpatch { + name = "2-auto-disable-sse-for-non-x86.patch"; + url = "https://github.com/apache/incubator-mxnet/commit/c1b96f562f55dfa024ac941d7b104f00e239ee0f.patch"; + excludes = ["ci/docker/runtime_functions.sh"]; + hash = "sha256-r1LbC8ueRooW5tTNakAlRSJ+9aR4WXXoEKx895DgOs4="; + }) + ]; + nativeBuildInputs = [ cmake perl ]; buildInputs = [ opencv3 gtest blas.provider ]