Skip to content

Commit

Permalink
tensorflowNoGpuSupport -> tensorflowWithoutCuda
Browse files Browse the repository at this point in the history
and move expression
  • Loading branch information
FRidh committed Feb 15, 2017
1 parent f53900d commit a069c16
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 35 deletions.
48 changes: 48 additions & 0 deletions pkgs/development/python-modules/tensorflow/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{ stdenv
, fetchurl
, buildPythonPackage
, numpy
, six
, protobuf3_0_0b2
, swig
, mock
, gcc
, zlib
}:

# tensorflow is built from a downloaded wheel, because the upstream
# project's build system is an arcane beast based on
# bazel. Untangling it and building the wheel from source is an open
# problem.

buildPythonPackage rec {
pname = "tensorflow";
version = "0.10.0";
name = "${pname}-${version}";
format = "wheel";

src = fetchurl {
url = if stdenv.isDarwin then
"https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-${version}-py2-none-any.whl" else
"https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-${version}-cp27-none-linux_x86_64.whl";
sha256 = if stdenv.isDarwin then
"1gjybh3j3rn34bzhsxsfdbqgsr4jh50qyx2wqywvcb24fkvy40j9" else
"0g05pa4z6kdy0giz7hjgjgwf4zzr5l8cf1zh247ymixlikn3fnpx";
};

propagatedBuildInputs = [ numpy six protobuf3_0_0b2 swig mock];

preFixup = ''
RPATH="${stdenv.lib.makeLibraryPath [ gcc.cc.lib zlib ]}"
find $out -name '*.so' -exec patchelf --set-rpath "$RPATH" {} \;
'';

doCheck = false;

meta = with stdenv.lib; {
description = "TensorFlow helps the tensors flow (no gpu support)";
homepage = http://tensorflow.org;
license = licenses.asl20;
platforms = with platforms; linux ++ darwin;
};
}
37 changes: 2 additions & 35 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31243,43 +31243,10 @@ EOF
};
};

# tensorflow is built from a downloaded wheel, because the upstream
# project's build system is an arcane beast based on
# bazel. Untangling it and building the wheel from source is an open
# problem.
tensorflow = self.tensorflowWithoutCuda;

tensorflow = self.tensorflowNoGpuSupport;
tensorflowWithoutCuda = callPackage ../development/python-modules/tensorflow { };

tensorflowNoGpuSupport = buildPythonPackage rec {
name = "tensorflow";
version = "0.10.0";
format = "wheel";

src = pkgs.fetchurl {
url = if stdenv.isDarwin then
"https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-${version}-py2-none-any.whl" else
"https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-${version}-cp27-none-linux_x86_64.whl";
sha256 = if stdenv.isDarwin then
"1gjybh3j3rn34bzhsxsfdbqgsr4jh50qyx2wqywvcb24fkvy40j9" else
"0g05pa4z6kdy0giz7hjgjgwf4zzr5l8cf1zh247ymixlikn3fnpx";
};

propagatedBuildInputs = with self; [ numpy six protobuf3_0_0b2 pkgs.swig mock];

preFixup = ''
RPATH="${stdenv.lib.makeLibraryPath [ pkgs.gcc.cc.lib pkgs.zlib ]}"
find $out -name '*.so' -exec patchelf --set-rpath "$RPATH" {} \;
'';

doCheck = false;

meta = {
description = "TensorFlow helps the tensors flow (no gpu support)";
homepage = http://tensorflow.org;
license = licenses.asl20;
platforms = with platforms; linux ++ darwin;
};
};

tensorflowCuDNN = buildPythonPackage rec {
name = "tensorflow";
Expand Down

0 comments on commit a069c16

Please sign in to comment.