tensorflow-cmake icon indicating copy to clipboard operation
tensorflow-cmake copied to clipboard

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

Open NRKEYES opened this issue 7 years ago • 4 comments

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...

NRKEYES avatar May 19 '18 03:05 NRKEYES

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!

acidtonic avatar Jun 07 '18 18:06 acidtonic

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.

joeylitalien avatar Jun 11 '18 15:06 joeylitalien

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.

MatthewScholefield avatar Sep 11 '18 06:09 MatthewScholefield

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

ShubhamSrivastava93 avatar Jun 04 '19 11:06 ShubhamSrivastava93