denzp / rust-ptx-linker

The missing puzzle piece for NVPTX experience with Rust
MIT License
52 stars 11 forks source link

Unknown Attribute Error #18

Closed bheisler closed 6 years ago

bheisler commented 6 years ago

After updating to 0.4, I now have a new error:

[PTX] Unable to build a PTX crate!
[PTX]    Compiling proxy v0.0.0 (file:///C:/Users/Brook/AppData/Local/Temp/ptx-builder-0.4/chapter_1_kernel/2777747bd38bda2e)
[PTX] error[E0658]: The attribute `panic_handler` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
[PTX]  --> src\lib.rs:8:1
[PTX]   |
[PTX] 8 | #[panic_handler]
[PTX]   | ^^^^^^^^^^^^^^^^
[PTX]   |
[PTX]   = help: add #![feature(custom_attribute)] to the crate attributes to enable
[PTX]
[PTX] error: aborting due to previous error
[PTX]
[PTX] For more information about this error, try `rustc --explain E0658`.
[PTX] error: Could not compile `proxy`.
[PTX]
[PTX] To learn more, run the command again with --verbose.
$ cargo --version
cargo 1.29.0-nightly (6a7672ef5 2018-08-14)
# nightly-x86_64-pc-windows-gnu
denzp commented 6 years ago

It's related to Rust unstable API change https://github.com/rust-lang/rust/pull/53619. Could you please try with latest nightly?

bheisler commented 6 years ago

Seems to work now. I did have to explicitly set the LIBRARY_PATH variable to include my CUDA libraries, though. That should be handled automatically, at least for the standard installation directories (In my case, "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\lib\x64"). Should I raise an issue for that (and if so, on which repository)?

denzp commented 6 years ago

Did you need LIBRARY_PATH to produce assembly, to build host binary or to run the binary?

If you need it to build the binary, then it probably has to be done at japaric/cuda.

If you need the variable to run the binary, then there is not much we can do. We can't affect a runtime environment during a build process. Probably we can try -rpath linker flag (which specifies where to search for libraries), but I never got it to work with Rust and apparently, it's linux-specific.

bheisler commented 6 years ago

It's required to produce the binary. I'll raise an issue with that repository.