cntk: 2.4 -> 2.7
Restrict platforms to x86_64-linux.
This commit is contained in:
@@ -1,32 +1,49 @@
|
||||
{ stdenv
|
||||
, lib
|
||||
, buildPythonPackage
|
||||
, pkgs
|
||||
, numpy
|
||||
, scipy
|
||||
, openmpi
|
||||
, enum34
|
||||
, protobuf
|
||||
, pip
|
||||
, python
|
||||
, swig
|
||||
}:
|
||||
|
||||
let
|
||||
cntk = pkgs.cntk;
|
||||
in
|
||||
buildPythonPackage rec {
|
||||
inherit (pkgs.cntk) name version src;
|
||||
inherit (cntk) name version src;
|
||||
|
||||
nativeBuildInputs = [ pkgs.swig pkgs.openmpi ];
|
||||
buildInputs = [ pkgs.cntk pkgs.openmpi ];
|
||||
nativeBuildInputs = [ swig openmpi ];
|
||||
buildInputs = [ cntk openmpi ];
|
||||
propagatedBuildInputs = [ numpy scipy enum34 protobuf pip ];
|
||||
|
||||
CNTK_LIB_PATH = "${pkgs.cntk}/lib";
|
||||
CNTK_COMPONENT_VERSION = pkgs.cntk.version;
|
||||
CNTK_LIB_PATH = "${cntk}/lib";
|
||||
CNTK_COMPONENT_VERSION = cntk.version;
|
||||
CNTK_VERSION = cntk.version;
|
||||
CNTK_VERSION_BANNER = cntk.version;
|
||||
|
||||
postPatch = ''
|
||||
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 = ''
|
||||
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.
|
||||
cp cntk/cntk_py.py $out/${python.sitePackages}/cntk
|
||||
'';
|
||||
@@ -38,10 +55,8 @@ buildPythonPackage rec {
|
||||
'';
|
||||
|
||||
meta = {
|
||||
inherit (pkgs.cntk.meta) homepage description license maintainers;
|
||||
# broken in CNTK 2.4 starting with python-3.7
|
||||
# ("ImportError: cannot import name 'GenericMeta' from 'typing'")
|
||||
broken = stdenv.lib.versionAtLeast python.version "3.7";
|
||||
|
||||
inherit (cntk.meta) homepage description license maintainers platforms;
|
||||
# doesn't support Python 3.7
|
||||
broken = lib.versionAtLeast python.version "3.7";
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user