cjweeks / tensorflow-cmake

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

protobuf archive not found #11

Closed werner-rammer closed 7 years ago

werner-rammer commented 7 years ago

protobuf.sh looks for the URL to download Protobuf from: PROTOBUF_URL=$(echo "${PROTOBUF_TEXT}" | sed -n ${URL}) || fail

This does not work with Tensorflow 1.0 (or at least in my installation), because the workspace.bzl lists 2 urls instead of a single url (what the regexp expects). For example:

native.http_archive(
      name = "protobuf",
      urls = [
          "http://bazel-mirror.storage.googleapis.com/github.com/google/protobuf/archive/2b7430d96aeff2bb624c8d52182ff5e4b9f7f18a.tar.gz",
          "https://github.com/google/protobuf/archive/2b7430d96aeff2bb624c8d52182ff5e4b9f7f18a.tar.gz",
      ],
      sha256 = "e5d3d4e227a0f7afb8745df049bbd4d55474b158ca5aaa2a0e31099af24be1d0",
      strip_prefix = "protobuf-2b7430d96aeff2bb624c8d52182ff5e4b9f7f18a",
  )

A quick and dirty workaround is to specify the URLs hard-coded:

PROTOBUF_URL="http://bazel-mirror.storage.googleapis.com/github.com/google/protobuf/archive/2b7430d96aeff2bb624c8d52182ff5e4b9f7f18a.tar.gz"
    PROTOBUF_ARCHIVE="2b7430d96aeff2bb624c8d52182ff5e4b9f7f18a.tar.gz"
cjweeks commented 7 years ago

I recently implemented a pattern for multiple URLs in the eigen.sh script; I will add this functionality to protobuf.sh shortly.

cjweeks commented 7 years ago

I Just added a commit that I believe should fix this issue; let me know if it works for you.

werner-rammer commented 7 years ago

yes, it works! Excerpt of the output:

Finding Protobuf version in tensorflow/tensorflow/ using method 0...
Finding Protobuf version in tensorflow/tensorflow/ using method 1...

Found Protobuf information in tensorflow/tensorflow/:
Protobuf URL:  http://bazel-mirror.storage.googleapis.com/github.com/google/protobuf/archive/2b7430d96aeff2bb624c8d52182ff5e4b9f7f18a.tar.gz,https://github.com/google/protobuf/archive/2b7430d96aeff2bb624c8d52182ff5e4b9f7f18a.tar.gz,
Protobuf folder:  protobuf-2b7430d96aeff2bb624c8d52182ff5e4b9f7f18a

Thanks for the quick fix!

cjweeks commented 7 years ago

No problem at all. I will close this issue now, but feel free to re-open it or open a new one if further issues arise.