rust
rust copied to clipboard
Cannot build without internet
It seems like tensorflow does not build without internet access. I am using version 0.16.0.
error: failed to run custom build command for `tensorflow-sys v0.19.1`
Caused by:
process didn't exit successfully: `./target/release/build/tensorflow-sys-1669628a4601d4b9/build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-env-changed=TENSORFLOW_NO_PKG_CONFIG
…
libtensorflow-sys/build.rs:202: binary_url = "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-1.15.0.tar.gz"
libtensorflow-sys/build.rs:206: base_name = "libtensorflow-cpu-linux-x86_64-1.15.0"
libtensorflow-sys/build.rs:215: file_name = "./target/release/build/tensorflow-sys-589183ae081893f0/out/libtensorflow-cpu-linux-x86_64-1.15.0.tar.gz"
--- stderr
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { description: "Couldn\'t resolve host name", code: 6, extra: Some("Could not resolve host: storage.googleapis.com") }', ~/.cache/cargo/registry/src/github.com-1ecc6299db9ec823/tensorflow-sys-0.19.1/build.rs:225:24
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed
This is expected. If it doesn't find TensorFlow installed locally, it will download a binary. If you want to build without internet access, you'll need to install TensorFlow locally and ensure that it can be found by pkg-config.
I see, thanks. Would there be a way to improve the error message?
Why not support a way to specify the location of libraries manually?
It does support a way to specify the location of libraries manually, and this is through pkg-config. The instructions for this are in https://github.com/tensorflow/rust/blob/master/tensorflow-sys/README.md, specifically the generate-pc.sh step.