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

Running -sys crate's test fails on nightly #71

Closed
nbigaouette-eai opened this issue Mar 16, 2017 · 2 comments
Closed

Running -sys crate's test fails on nightly #71

nbigaouette-eai opened this issue Mar 16, 2017 · 2 comments

Comments

@nbigaouette-eai
Copy link
Contributor

Running tests for the tensorflow-sys crate fails on nightly, even though it works on stable.

This is using the pre-built binary, so libtensorflow.so is located in tensorflow-sys/target/libtensorflow-cpu-linux-x86_64-1.0.0/lib/libtensorflow.so.

(~/tensorflow_rust.git/tensorflow-sys)
 -> cargo +nightly test -vv
       Fresh lazy_static v0.2.4
       Fresh gcc v0.3.43
       Fresh openssl-probe v0.1.0
       Fresh regex-syntax v0.3.9
       Fresh libc v0.2.21
       Fresh filetime v0.1.10
       Fresh memchr v0.1.11
       Fresh aho-corasick v0.5.3
       Fresh utf8-ranges v0.1.3
       Fresh winapi-build v0.1.1
       Fresh pkg-config v0.3.9
       Fresh winapi v0.2.8
       Fresh kernel32-sys v0.2.2
       Fresh thread-id v2.0.0
       Fresh thread_local v0.2.7
       Fresh regex v0.1.80
       Fresh xattr v0.1.11
       Fresh tar v0.4.10
       Fresh miniz-sys v0.1.9
       Fresh flate2 v0.2.17
       Fresh libz-sys v1.0.13
       Fresh openssl-sys v0.9.8
       Fresh curl-sys v0.3.10
       Fresh semver-parser v0.6.2
       Fresh semver v0.5.1
       Fresh curl v0.4.6
       Fresh tensorflow-sys v0.7.0 (file:///home/nbigaouette/tensorflow_rust.git/tensorflow-sys)
    Finished dev [unoptimized + debuginfo] target(s) in 0.1 secs
     Running `/home/nbigaouette/tensorflow_rust.git/target/debug/deps/lib-b2190e536168b674`
/home/nbigaouette/tensorflow_rust.git/target/debug/deps/lib-b2190e536168b674: error while loading shared libraries: libtensorflow.so: cannot open shared object file: No such file or directory
error: test failed

Running the test passes using the stable 1.16:

(~/tensorflow_rust.git/tensorflow-sys)
 -> cargo test -vv
       Fresh gcc v0.3.43
       Fresh regex-syntax v0.3.9
       Fresh winapi-build v0.1.1
       Fresh utf8-ranges v0.1.3
       Fresh pkg-config v0.3.9
       Fresh libc v0.2.21
       Fresh openssl-probe v0.1.0
       Fresh xattr v0.1.11
       Fresh miniz-sys v0.1.9
       Fresh filetime v0.1.10
       Fresh memchr v0.1.11
       Fresh tar v0.4.10
       Fresh libz-sys v1.0.13
       Fresh flate2 v0.2.17
       Fresh winapi v0.2.8
       Fresh lazy_static v0.2.4
       Fresh kernel32-sys v0.2.2
       Fresh aho-corasick v0.5.3
       Fresh thread-id v2.0.0
       Fresh openssl-sys v0.9.8
       Fresh thread_local v0.2.7
       Fresh regex v0.1.80
       Fresh semver-parser v0.6.2
       Fresh semver v0.5.1
       Fresh curl-sys v0.3.10
       Fresh curl v0.4.6
       Fresh tensorflow-sys v0.7.0 (file:///home/nbigaouette/tensorflow_rust.git/tensorflow-sys)
    Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
     Running `/home/nbigaouette/tensorflow_rust.git/target/debug/deps/lib-b2190e536168b674`

running 1 test
test linkage ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured

     Running `/home/nbigaouette/tensorflow_rust.git/target/debug/deps/tensorflow_sys-dde201bfdb2eb731`

running 4 tests
test bindgen_test_layout_TF_Buffer ... ok
test bindgen_test_layout_TF_AttrMetadata ... ok
test bindgen_test_layout_TF_Output ... ok
test bindgen_test_layout_TF_Input ... ok

test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured

   Doc-tests tensorflow-sys
     Running `rustdoc --test /home/nbigaouette/tensorflow_rust.git/tensorflow-sys/src/lib.rs --crate-name tensorflow_sys -L dependency=/home/nbigaouette/tensorflow_rust.git/target/
debug/deps -L native=/home/nbigaouette/tensorflow_rust.git/target/debug/build/miniz-sys-18005000ddedadf4/out -L native=/home/nbigaouette/tensorflow_rust.git/tensorflow-sys/target/l
ibtensorflow-cpu-linux-x86_64-1.0.0/lib -L native=/usr/lib --extern libc=/home/nbigaouette/tensorflow_rust.git/target/debug/deps/liblibc-5dc7b85e748840b4.rlib --extern tensorflow_sys=/home/nbigaou
ette/tensorflow_rust.git/target/debug/deps/libtensorflow_sys-abb7df69fd313205.rlib`

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured

Could this be related to rust-lang/cargo#2478 ? In that case using cargo:rustc-link-search=native={} instead of cargo:rustc-link-search={} should fix this. Unfortunately, it doesn't.

I'm not sure how to fix this...

This is on master (8bd62df).

@nbigaouette-eai
Copy link
Contributor Author

Forgot to give nightly version:

 -> rustup run nightly rustc --version
rustc 1.17.0-nightly (0aeb9c129 2017-03-15)

nbigaouette-eai added a commit to nbigaouette-eai/rust that referenced this issue Mar 17, 2017
A change in cargo nightly (merged on February 7th 2017) changed how
dynamic libraries are loaded. This prevented the `tensorflow-sys` crate's
tests to run.

To fix, simply copy the `libtensorflow.so` pre-built library to `OUT_DIR`
and change `cargo:rustc-link-search=` path so cargo can find it when
running the tests.

See:
* issue: tensorflow#71
* cargo's pull request: rust-lang/cargo#3651
nbigaouette-eai added a commit to nbigaouette-eai/rust that referenced this issue Mar 17, 2017
A change in cargo nightly (merged on February 7th 2017) changed how
dynamic libraries are loaded. This prevented the `tensorflow-sys` crate's
tests to run.

To fix, simply copy the `libtensorflow.so` pre-built library to `OUT_DIR`
and change `cargo:rustc-link-search=` path so cargo can find it when
running the tests.

See:
* issue: tensorflow#71
* cargo's pull request: rust-lang/cargo#3651
@nbigaouette-eai
Copy link
Contributor Author

PR #72 fixes this. Closing.

ramon-garcia pushed a commit to ramon-garcia/tensorflow-rust that referenced this issue May 20, 2023
* As part of tensorflow#69 refactor to break views from core dataset manipulation

* tensorflow#69 Allow for navigatable data sets that are wide
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

1 participant