Code Monkey home page Code Monkey logo

Comments (10)

foucault avatar foucault commented on August 26, 2024

It builds properly here with rustc 1.15.0-nightly (2217bd771 2016-11-25). Please note that you also need gcc and ar along with rust to build the native component, but I suppose they should be installed by default in the docker image. Additionally, make sure that the location of the libxnvctrl static library is correct in the Makefile. If nothing works, run cargo build again with a single thread (-j1) and verbose output (-v) to find out more.

from nvfancontrol.

nazar-pc avatar nazar-pc commented on August 26, 2024

Both gcc and ar are present, libxnvctrl is also located correctly:

root@780c7a9abd21:/rust# ls -al /usr/lib | grep libXNVCtrl
-rw-r--r-- 1 root root   20524 Oct 17  2014 libXNVCtrl.a
lrwxrwxrwx 1 root root      15 Oct 17  2014 libXNVCtrl.so -> libXNVCtrl.so.0
lrwxrwxrwx 1 root root      19 Oct 17  2014 libXNVCtrl.so.0 -> libXNVCtrl.so.0.0.0
-rw-r--r-- 1 root root   18632 Oct 17  2014 libXNVCtrl.so.0.0.0

Here is the output with single thread and verbose output:

root@780c7a9abd21:/rust# cargo build -j1 -v
       Fresh winapi v0.2.8
       Fresh log v0.3.6
       Fresh semver v0.1.20
       Fresh getopts v0.2.14
   Compiling libc v0.2.17
     Running `rustc /root/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.17/src/lib.rs --crate-name libc --crate-type lib -g --cfg feature=\"default\" --cfg feature=\"use_std\" -C metadata=38a11e2c014183dd -C extra-filename=-38a11e2c014183dd --out-dir /rust/target/debug/deps --emit=dep-info,link -L dependency=/rust/target/debug/deps --cap-lints allow`

       Fresh rustc_version v0.1.7
   Compiling bitflags v0.4.0
     Running `rustc /root/.cargo/registry/src/github.com-1ecc6299db9ec823/bitflags-0.4.0/src/lib.rs --crate-name bitflags --crate-type lib -g -C metadata=d6e9c9f26754b52f -C extra-filename=-d6e9c9f26754b52f --out-dir /rust/target/debug/deps --emit=dep-info,link -L dependency=/rust/target/debug/deps --cap-lints allow`
       Fresh cfg-if v0.1.0
   Compiling nix v0.7.0
     Running `/rust/target/debug/build/nix-a4eb866b27c5afd7/build-script-build`
   Compiling nvctrl v0.1.0 (file:///rust/src/nvctrl)
     Running `/rust/target/debug/build/nvctrl-beba15aebcc2b6bb/build-script-build`
error: failed to run custom build command for `nvctrl v0.1.0 (file:///rust/src/nvctrl)`
process didn't exit successfully: `/rust/target/debug/build/nvctrl-beba15aebcc2b6bb/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { repr: Os { code: 2, message: "No such file or directory" } }', ../src/libcore/result.rs:837
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Maybe there are some additional dependencies that are only present in your environment or something like this?

Can you try version from mentioned docker image? Latest commit in this repository is older than the rustc version I'm using, so it should be fine.

from nvfancontrol.

nazar-pc avatar nazar-pc commented on August 26, 2024

Updated Rust to latest rustc 1.15.0-nightly (1c448574b 2016-11-28), still the same issue

from nvfancontrol.

foucault avatar foucault commented on August 26, 2024

I doubt it's a problem with rust, it seems like the C code is not building properly. Can you please cd to src/nvctrl and run OUT_DIR=. make ? Sorry, I am not comfortable with docker so I can't test it with docker at least for now.

from nvfancontrol.

nazar-pc avatar nazar-pc commented on August 26, 2024

OK, appears that following packages are also needed:

  • nvidia-* (nvidia-375 in my case)
  • libx11-xcb-dev

Now I'm getting a different error:

root@540d11ba4446:/source# RUST_BACKTRACE=1 /usr/bin/cargo build -j1 --release -v
       Fresh void v1.0.2
       Fresh xdg v2.0.0
       Fresh winapi-build v0.1.1
       Fresh winapi v0.2.8
       Fresh bitflags v0.4.0
   Compiling nvctrl v0.1.0 (file:///source/src/nvctrl)
     Running `/source/target/release/build/nvctrl-394da3cdea818096/build-script-build`
error: failed to run custom build command for `nvctrl v0.1.0 (file:///source/src/nvctrl)`
Process didn't exit successfully: `/source/target/release/build/nvctrl-394da3cdea818096/build-script-build` (exit code: 101)
--- stdout
mkdir -p /source/target/release/build/nvctrl-394da3cdea818096/out/build
gcc -c -o /source/target/release/build/nvctrl-394da3cdea818096/out/build/libnvctrl_c.o -static -O2 -fPIC -Wall -pedantic -Wl,-Bdynamic -lX11 -lXext -Wl,-Bstatic -lXNVCtrl nvctrl_c.c
echo -e "CREATE /source/target/release/build/nvctrl-394da3cdea818096/out/build/libnvctrl_c.a\nADDLIB /usr/lib/libXNVCtrl.a\nADDMOD /source/target/release/build/nvctrl-394da3cdea818096/out/build/libnvctrl_c.o\nSAVE\nEND" | ar -M
Syntax error in archive script, line 1
Syntax error in archive script, line 1
Makefile:17: recipe for target 'library' failed

--- stderr
ar: no output archive specified yet
make: *** [library] Error 9
thread 'main' panicked at 'assertion failed: ret.success()', src/nvctrl/build.rs:11
stack backtrace:
   1:     0x5588236bd8aa - std::sys::imp::backtrace::tracing::imp::write::h944c02ac40aee2d7
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:42
   2:     0x5588236c12ef - std::panicking::default_hook::{{closure}}::h6875a2976258b020
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:247
   3:     0x5588236c0eee - std::panicking::default_hook::h88ffbc5922643264
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:263
   4:     0x5588236c16d7 - std::panicking::rust_panic_with_hook::ha5aed1dfc0e220e3
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:451
   5:     0x5588236b3473 - std::panicking::begin_panic::h5f0a1fd8f4de57ec
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:413
   6:     0x5588236b61d0 - build_script_build::main::h08b0ae86132052e7
                        at /source/src/nvctrl/build.rs:11
   7:     0x5588236cbe0a - __rust_maybe_catch_panic
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libpanic_unwind/lib.rs:97
   8:     0x5588236c1cda - std::rt::lang_start::h5d71a3afaaa4b2ff
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:332
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panic.rs:351
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/rt.rs:57
   9:     0x5588236b64c2 - main
  10:     0x7faeb97783f0 - __libc_start_main
  11:     0x5588236b2cf9 - _start
  12:                0x0 - <unknown>

from nvfancontrol.

nazar-pc avatar nazar-pc commented on August 26, 2024

I see /source/target/release/build/nvctrl-394da3cdea818096/out/build/libnvctrl_c.o file, but not /source/target/release/build/nvctrl-394da3cdea818096/out/build/libnvctrl_c.a

from nvfancontrol.

nazar-pc avatar nazar-pc commented on August 26, 2024

It seems that ar complains about the first line in generated

CREATE /source/target/release/build/nvctrl-394da3cdea818096/out/build/libnvctrl_c.a
ADDLIB /usr/lib/libXNVCtrl.a
ADDMOD /source/target/release/build/nvctrl-394da3cdea818096/out/build/libnvctrl_c.o
SAVE
END

from nvfancontrol.

nazar-pc avatar nazar-pc commented on August 26, 2024

Fix for above issue is in #2

Now I'm left with following:

root@540d11ba4446:/source# RUST_BACKTRACE=1 /usr/bin/cargo build -j1 --release -v
       Fresh winapi-build v0.1.1
       Fresh bitflags v0.4.0
       Fresh winapi v0.2.8
       Fresh cfg-if v0.1.0
       Fresh getopts v0.2.14
       Fresh semver v0.1.20
       Fresh rustc_version v0.1.7
       Fresh xdg v2.0.0
       Fresh log v0.3.6
       Fresh libc v0.2.17
   Compiling nvctrl v0.1.0 (file:///source/src/nvctrl)
     Running `rustc src/nvctrl/build.rs --crate-name build_script_build --crate-type bin -g --out-dir /source/target/release/build/nvctrl-394da3cdea818096 --emit=dep-info,link -L dependency=/source/target/release/deps -L dependency=/source/target/release/deps`
     Running `/source/target/release/build/nvctrl-394da3cdea818096/build-script-build`
     Running `rustc src/nvctrl/lib.rs --crate-name nvctrl --crate-type lib -C opt-level=3 -C metadata=19b50dc7c7302c85 -C extra-filename=-19b50dc7c7302c85 --out-dir /source/target/release/deps --emit=dep-info,link -L dependency=/source/target/release/deps -L dependency=/source/target/release/deps --extern libc=/source/target/release/deps/liblibc-ad32fde1bd850538.rlib -L /source/target/release/build/nvctrl-394da3cdea818096/out/build -l static=nvctrl_c -l X11 -l Xext`
error: could not find native static library `nvctrl_c`, perhaps an -L flag is missing?

error: Could not compile `nvctrl`.

Caused by:
  Process didn't exit successfully: `rustc src/nvctrl/lib.rs --crate-name nvctrl --crate-type lib -C opt-level=3 -C metadata=19b50dc7c7302c85 -C extra-filename=-19b50dc7c7302c85 --out-dir /source/target/release/deps --emit=dep-info,link -L dependency=/source/target/release/deps -L dependency=/source/target/release/deps --extern libc=/source/target/release/deps/liblibc-ad32fde1bd850538.rlib -L /source/target/release/build/nvctrl-394da3cdea818096/out/build -l static=nvctrl_c -l X11 -l Xext` (exit code: 101)

from nvfancontrol.

nazar-pc avatar nazar-pc commented on August 26, 2024

It was actually caused by more dependencies needed, all of them are reflected in #3
Now it finally compiles:)

from nvfancontrol.

foucault avatar foucault commented on August 26, 2024

Thanks, good detective work!

from nvfancontrol.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.