cntk: 2.4 -> 2.7
Restrict platforms to x86_64-linux.
This commit is contained in:
parent
1997353884
commit
1260b05279
@ -18,17 +18,15 @@ let
|
|||||||
|
|
||||||
in stdenv.mkDerivation rec {
|
in stdenv.mkDerivation rec {
|
||||||
name = "CNTK-${version}";
|
name = "CNTK-${version}";
|
||||||
version = "2.4";
|
version = "2.7";
|
||||||
|
|
||||||
# Submodules
|
# Submodules
|
||||||
src = fetchgit {
|
src = fetchgit {
|
||||||
url = "https://github.com/Microsoft/CNTK";
|
url = "https://github.com/Microsoft/CNTK";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "0m28wb0ljixcpi14g3gcfiraimh487yxqhd9yrglgyvjb69x597y";
|
sha256 = "18l9k7s966a26ywcf7flqyhm61788pcb9fj3wk61jrmgkhy2pcns";
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = [ ./fix_std_bind.patch ];
|
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake ];
|
nativeBuildInputs = [ cmake ];
|
||||||
|
|
||||||
buildInputs = [ openblas opencv3 libzip boost protobuf openmpi ]
|
buildInputs = [ openblas opencv3 libzip boost protobuf openmpi ]
|
||||||
@ -87,6 +85,7 @@ in stdenv.mkDerivation rec {
|
|||||||
homepage = https://github.com/Microsoft/CNTK;
|
homepage = https://github.com/Microsoft/CNTK;
|
||||||
description = "An open source deep-learning toolkit";
|
description = "An open source deep-learning toolkit";
|
||||||
license = if onebitSGDSupport then licenses.unfreeRedistributable else licenses.mit;
|
license = if onebitSGDSupport then licenses.unfreeRedistributable else licenses.mit;
|
||||||
|
platforms = [ "x86_64-linux" ];
|
||||||
maintainers = with maintainers; [ abbradar ];
|
maintainers = with maintainers; [ abbradar ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
diff -ru3 CNTK-old/Source/CNTKv2LibraryDll/EvaluatorWrapper.h CNTK-new/Source/CNTKv2LibraryDll/EvaluatorWrapper.h
|
|
||||||
--- CNTK-old/Source/CNTKv2LibraryDll/EvaluatorWrapper.h 1970-01-01 03:00:01.000000000 +0300
|
|
||||||
+++ CNTK-new/Source/CNTKv2LibraryDll/EvaluatorWrapper.h 2018-02-25 18:16:16.330269647 +0300
|
|
||||||
@@ -9,6 +9,7 @@
|
|
||||||
#include <boost/noncopyable.hpp>
|
|
||||||
#include <memory>
|
|
||||||
#include <vector>
|
|
||||||
+#include <functional>
|
|
||||||
|
|
||||||
#include "CNTKLibrary.h"
|
|
||||||
#include "CNTKLibraryC.h"
|
|
@ -1,32 +1,49 @@
|
|||||||
{ stdenv
|
{ stdenv
|
||||||
|
, lib
|
||||||
, buildPythonPackage
|
, buildPythonPackage
|
||||||
, pkgs
|
, pkgs
|
||||||
, numpy
|
, numpy
|
||||||
, scipy
|
, scipy
|
||||||
|
, openmpi
|
||||||
, enum34
|
, enum34
|
||||||
, protobuf
|
, protobuf
|
||||||
, pip
|
, pip
|
||||||
, python
|
, python
|
||||||
|
, swig
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
cntk = pkgs.cntk;
|
||||||
|
in
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
inherit (pkgs.cntk) name version src;
|
inherit (cntk) name version src;
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgs.swig pkgs.openmpi ];
|
nativeBuildInputs = [ swig openmpi ];
|
||||||
buildInputs = [ pkgs.cntk pkgs.openmpi ];
|
buildInputs = [ cntk openmpi ];
|
||||||
propagatedBuildInputs = [ numpy scipy enum34 protobuf pip ];
|
propagatedBuildInputs = [ numpy scipy enum34 protobuf pip ];
|
||||||
|
|
||||||
CNTK_LIB_PATH = "${pkgs.cntk}/lib";
|
CNTK_LIB_PATH = "${cntk}/lib";
|
||||||
CNTK_COMPONENT_VERSION = pkgs.cntk.version;
|
CNTK_COMPONENT_VERSION = cntk.version;
|
||||||
|
CNTK_VERSION = cntk.version;
|
||||||
|
CNTK_VERSION_BANNER = cntk.version;
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
cd bindings/python
|
cd bindings/python
|
||||||
sed -i 's,"libmpi.so.12","${pkgs.openmpi}/lib/libmpi.so",g' cntk/train/distributed.py
|
sed -i 's,"libmpi.so.12","${openmpi}/lib/libmpi.so",g' cntk/train/distributed.py
|
||||||
|
|
||||||
|
# Remove distro and libs checks; they aren't compatible with NixOS and besides we guarantee
|
||||||
|
# compatibility by providing a package.
|
||||||
|
cat <<EOF > cntk/cntk_py_init.py
|
||||||
|
def cntk_check_distro_info():
|
||||||
|
pass
|
||||||
|
def cntk_check_libs():
|
||||||
|
pass
|
||||||
|
EOF
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
rm -rf $out/${python.sitePackages}/cntk/libs
|
rm -rf $out/${python.sitePackages}/cntk/libs
|
||||||
ln -s ${pkgs.cntk}/lib $out/${python.sitePackages}/cntk/libs
|
ln -s ${cntk}/lib $out/${python.sitePackages}/cntk/libs
|
||||||
# It's not installed for some reason.
|
# It's not installed for some reason.
|
||||||
cp cntk/cntk_py.py $out/${python.sitePackages}/cntk
|
cp cntk/cntk_py.py $out/${python.sitePackages}/cntk
|
||||||
'';
|
'';
|
||||||
@ -38,10 +55,8 @@ buildPythonPackage rec {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
inherit (pkgs.cntk.meta) homepage description license maintainers;
|
inherit (cntk.meta) homepage description license maintainers platforms;
|
||||||
# broken in CNTK 2.4 starting with python-3.7
|
# doesn't support Python 3.7
|
||||||
# ("ImportError: cannot import name 'GenericMeta' from 'typing'")
|
broken = lib.versionAtLeast python.version "3.7";
|
||||||
broken = stdenv.lib.versionAtLeast python.version "3.7";
|
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user