cjweeks / tensorflow-cmake

Integrate TensorFlow with CMake projects effortlessly
MIT License
331 stars 83 forks source link

protobuf and eigen scripts don't seem to be working. #39

Open NRKEYES opened 6 years ago

NRKEYES commented 6 years ago

I might be missing something obvious, but no matter what I have tried so far these commands fail. Was there something in an update that broke this? It seems to be related to a GREP issue.

sudo ./protobuf.sh install ~/Chemistry/tensorFlow cmake/Modules cmake/Modules Finding Protobuf version in /Users/nkeyes/Chemistry/tensorFlow using method 0... usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]] [-e pattern] [-f file] [--binary-files=value] [--color=when] [--context[=num]] [--directories=action] [--label] [--line-buffered] [--null] [pattern] [file ...] Finding Protobuf version in /Users/nkeyes/Chemistry/tensorFlow using method 1... usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]] [-e pattern] [-f file] [--binary-files=value] [--color=when] [--context[=num]] [--directories=action] [--label] [--line-buffered] [--null] [pattern] [file ...] Finding Protobuf version in /Users/nkeyes/Chemistry/tensorFlow using method 2... usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]] [-e pattern] [-f file] [--binary-files=value] [--color=when] [--context[=num]] [--directories=action] [--label] [--line-buffered] [--null] [pattern] [file ...] Finding Protobuf version in /Users/nkeyes/Chemistry/tensorFlow using method 3... usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]] [-e pattern] [-f file] [--binary-files=value] [--color=when] [--context[=num]] [--directories=action] [--label] [--line-buffered] [--null] [pattern] [file ...] Finding Protobuf version in /Users/nkeyes/Chemistry/tensorFlow using method 4...

acidtonic commented 6 years ago

I ran into a similar issue but for me the grep just never matched.

I manually looked into the workspace.bzl file and the eigen entry used to be inside a "native.new_http_archive" entry but now it's in "tf_http_archive" thus the regex needs to be changed.

#ARCHIVE_HEADER="native.new_http_archive\(\s*"
ARCHIVE_HEADER="tf_http_archive\(\s*"

After commenting out the original and using the replacement line shown above, everything works again.

For the protobuf.sh script the same thing happened but the fix was slightly different.

#HTTP_HEADER="native.http_archive\(\s"
HTTP_HEADER="tf_http_archive\(\s"

Good luck!

joeylitalien commented 6 years ago

Apple switched from GNU grep to BSD grep in MacOS 10.8 so the two scripts will fail on Darwin due to the unknown -P grep option. Following @acidtonic fix, if you do brew install grep and replace every occurrences of grep by ggrep, you should be able to run both scripts on Mac, assuming you also have wget installed.

MatthewScholefield commented 5 years ago

Another problem is that for me, <tensorflow-source>/tensorflow/workspace.bzl had been changed to use vairables for protobuf urls which messed things up. To fix it I had to manually remove the PROTOBUF_URLS (or something similar) variable and replace it with the actual constant value.

ShubhamSrivastava93 commented 5 years ago

I manually set

  PROTOBUF_URLS = ["https://mirror.bazel.build/github.com/google/protobuf/archive/v3.6.0.tar.gz",
    "https://github.com/google/protobuf/archive/v3.6.0.tar.gz", ]
  PROTOBUF_URL="https://mirror.bazel.build/github.com/google/protobuf/archive/v3.6.0.tar.gz"
  PROTOBUF_FOLDER="protobuf-3.6.0"

Note: set the values according to your /tensorflow/workspace.bzl