Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test suite fails #190

Closed
jyp opened this issue May 15, 2018 · 1 comment
Closed

Test suite fails #190

jyp opened this issue May 15, 2018 · 1 comment

Comments

@jyp
Copy link

jyp commented May 15, 2018

When building the test suite fails with this error:

Linking dist/build/FFITest/FFITest ...
Preprocessing test suite 'VarIntTest' for tensorflow-0.1.0.2...
[1 of 1] Compiling Main             ( tests/VarIntTest.hs, dist/build/VarIntTest/VarIntTest-tmp/Main.dyn_o )
Linking dist/build/VarIntTest/VarIntTest ...
running tests
Running 2 test suites...
Test suite FFITest: RUNNING...
ParseAllOps: [Failed]
ERROR: toEnum: unknown value for enum DataType: 22
CallStack (from HasCallStack):
  error, called at dist/build/autogen/Proto/Tensorflow/Core/Framework/Types.hs:207:16 in tensorflow-proto-0.1.0.0-GW6eAirpxxgQS0lqQzXnG:Proto.Tensorflow.Core.Framework.Types

         Test Cases  Total      
 Passed  0           0          
 Failed  1           1          
 Total   1           1          
Test suite FFITest: FAIL
Test suite logged to: dist/test/tensorflow-0.1.0.2-FFITest.log
Test suite VarIntTest: RUNNING...
Test suite VarIntTest: PASS
Test suite logged to: dist/test/tensorflow-0.1.0.2-VarIntTest.log
1 of 2 test suites (1 of 2 test cases) passed.

This is a build using nix:

{ bootstrap ? import <nixpkgs> {} }:

let
  overlays = [
    (self: super: {
      tensorflow-c = super.callPackage ./tf-c.nix {};
      haskellPackages = super.haskellPackages.extend (selfHS: superHS: {
        proto-lens = self.haskell.lib.doJailbreak superHS.proto-lens;
        tensorflow-proto = self.haskell.lib.addBuildTool superHS.tensorflow-proto self.protobuf3_4;
        tensorflow = self.haskell.lib.overrideCabal superHS.tensorflow (drv: { librarySystemDepends = [
          # super.python36Packages.tensorflow
          self.tensorflow-c
          ]; });
      });
    })
  ];

  # NixOS 17.09 HEAD as of 2018-03-21
  pkgs = import (bootstrap.fetchFromGitHub {
    owner = "NixOS";
    repo  = "nixpkgs";
    rev = "fd016e362daf3f608d42204a8407a6a3723032e9";
    sha256 = "06ng6k3s7zq4mx317fl3halczrdichjdl767q7zfnbpjz7k5gs83";
  }) { inherit overlays; config = { allowUnfree = true; }; };
in
  pkgs.stdenv.mkDerivation {
    name = "tensorflow-proto-env";
    buildInputs = [ (pkgs.haskellPackages.ghcWithPackages (hps: with hps; [ tensorflow-proto tensorflow ]) ) ];
  }

Where tf-c.nix is as follows: (note I commented out the usage of CUDA).

{ fetchurl, stdenv, cudatoolkit, cudnn, symlinkJoin, zlib, linuxPackages }:

let cudatoolkit_joined = symlinkJoin {
        name = "${cudatoolkit.name}-unsplit";
        paths = [ cudatoolkit.out cudatoolkit.lib ];
    };

rpath = stdenv.lib.makeLibraryPath [ stdenv.cc.cc.lib zlib  ];
# rpath = stdenv.lib.makeLibraryPath [ stdenv.cc.cc.lib zlib cudatoolkit_joined cudnn linuxPackages.nvidia_x11 ];

in stdenv.mkDerivation rec {
  pname = "tensorflow-c";
  version = "1.8.0";
  name  = "${pname}-${version}";
  src = fetchurl {
   url = "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-${version}.tar.gz";
   sha256 = "0qzy15rc3x961cyi3bqnygrcnw4x69r28xkwhpwrv1r0gi6k73ha";
  };
  
  # src = fetchurl {
  #  url = "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-linux-x86_64-${version}.tar.gz";
  #  sha256 = "0m1g4sqr9as0jgfx7wlyay2nkad6wgvsyk2gvhfkqkq5sm1vbx85";
  # };

  buildCommand = ''
   . $stdenv/setup
   mkdir -pv $out
   tar -C $out -xzf $src
   rrPath="$out/lib/:${rpath}"
   find $out/lib -name '*.so' -exec chmod u+w {} \; # so we can patch later
   echo "RPATH for $out/lib/... = $rrPath"
   find $out/lib -name '*.so' -exec patchelf --set-rpath "$rrPath" {} \;
  '';
}

@fkm3
Copy link
Contributor

fkm3 commented May 16, 2018

I replied at #169 (comment) in more detail.

Can you validate that you've pulled the latest changes and updated the git submodules?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants