Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 199735388423
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1260b05279b9
Choose a head ref
  • 1 commit
  • 3 files changed
  • 1 contributor

Commits on Jun 2, 2019

  1. cntk: 2.4 -> 2.7

    Restrict platforms to x86_64-linux.
    abbradar committed Jun 2, 2019

    Verified

    This commit was signed with the committer’s verified signature.
    costrouc Christopher Ostrouchov
    Copy the full SHA
    1260b05 View commit details
Showing with 30 additions and 27 deletions.
  1. +3 −4 pkgs/applications/science/math/cntk/default.nix
  2. +0 −11 pkgs/applications/science/math/cntk/fix_std_bind.patch
  3. +27 −12 pkgs/development/python-modules/cntk/default.nix
7 changes: 3 additions & 4 deletions pkgs/applications/science/math/cntk/default.nix
Original file line number Diff line number Diff line change
@@ -18,17 +18,15 @@ let

in stdenv.mkDerivation rec {
name = "CNTK-${version}";
version = "2.4";
version = "2.7";

# Submodules
src = fetchgit {
url = "https://github.com/Microsoft/CNTK";
rev = "v${version}";
sha256 = "0m28wb0ljixcpi14g3gcfiraimh487yxqhd9yrglgyvjb69x597y";
sha256 = "18l9k7s966a26ywcf7flqyhm61788pcb9fj3wk61jrmgkhy2pcns";
};

patches = [ ./fix_std_bind.patch ];

nativeBuildInputs = [ cmake ];

buildInputs = [ openblas opencv3 libzip boost protobuf openmpi ]
@@ -87,6 +85,7 @@ in stdenv.mkDerivation rec {
homepage = https://github.com/Microsoft/CNTK;
description = "An open source deep-learning toolkit";
license = if onebitSGDSupport then licenses.unfreeRedistributable else licenses.mit;
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ abbradar ];
};
}
11 changes: 0 additions & 11 deletions pkgs/applications/science/math/cntk/fix_std_bind.patch

This file was deleted.

39 changes: 27 additions & 12 deletions pkgs/development/python-modules/cntk/default.nix
Original file line number Diff line number Diff line change
@@ -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";
};
}