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

Compile in release mode only when build is in release mode #6

Merged
merged 2 commits into from
May 4, 2018

Conversation

dbeckwith
Copy link
Contributor

@dbeckwith dbeckwith commented May 4, 2018

Fixes #5
I feel like the intent is right, but I'm getting a bad-looking error from xargo when it tries to compile without the --release flag:

   Compiling sample-ptx_crate v0.1.0 (file://$HOME/Dropbox/Programming/rust/rust-ptx-builder/tests/fixtures/sample-crate)
   Compiling proxy v0.0.0 (file:///tmp/ptx-builder/sample_ptx_crate/2173c7eb610022fa)
error: linking with `ptx-linker` failed: exit code: 1
  |
  = note: "ptx-linker" "-L" "$HOME/.xargo/lib/rustlib/nvptx64-nvidia-cuda/lib" "/tmp/ptx-builder/sample_ptx_crate/2173c7eb610022fa/target/nvptx64-nvidia-cuda/debug/deps/proxy.3rg6oty3sxxix4x5.rcgu.o" "-o" "/tmp/ptx-builder/sample_ptx_crate/2173c7eb610022fa/target/nvptx64-nvidia-cuda/debug/deps/proxy.ptx" "/tmp/ptx-builder/sample_ptx_crate/2173c7eb610022fa/target/nvptx64-nvidia-cuda/debug/deps/proxy.crate.metadata.rcgu.o" "-L" "/tmp/ptx-builder/sample_ptx_crate/2173c7eb610022fa/target/nvptx64-nvidia-cuda/debug/deps" "-L" "/tmp/ptx-builder/sample_ptx_crate/2173c7eb610022fa/target/debug/deps" "-L" "$HOME/.xargo/lib/rustlib/nvptx64-nvidia-cuda/lib" "-Bstatic" "--whole-archive" "/tmp/rustc.9Iv8OM6g45O1/libsample_ptx_crate-832f87e79ce5cf64.rlib" "--no-whole-archive" "--whole-archive" "/tmp/rustc.9Iv8OM6g45O1/libcore-d30d934963d2f831.rlib" "--no-whole-archive" "/tmp/rustc.9Iv8OM6g45O1/libcompiler_builtins-75beea7828105c3b.rlib" "-shared" "-Bdynamic"
  = note:  [INFO] Going to link 2 bitcode modules and 3 rlibs...
                  
          [DEBUG] Linking bitcode: "/tmp/ptx-builder/sample_ptx_crate/2173c7eb610022fa/target/nvptx64-nvidia-cuda/debug/deps/proxy.3rg6oty3sxxix4x5.rcgu.o"
          error: Invalid record
          

error: aborting due to previous error

error: Could not compile `proxy`.

To learn more, run the command again with --verbose.

Any idea how to solve that?

@denzp
Copy link
Owner

denzp commented May 4, 2018

Interesting, it doesn't crash on my side, albeit I have same versions as Travis, where it fails...
Will try to investigate more details. So far, it looks like a ptx-linker issue.

BTW, I think it still might try to use release assembly, because the path is also specified at:
https://github.com/denzp/rust-ptx-builder/pull/6/files#diff-058d40ebe40b5d40f6ffb05cf3d82dd8R126

@dbeckwith
Copy link
Contributor Author

Yeah I guess ptx-linker can't handle debug symbols or something?

@denzp
Copy link
Owner

denzp commented May 4, 2018

Can you please provide an output of llvm-config --version and, if it's possible, please send me /tmp/ptx-builder/sample_ptx_crate/2173c7eb610022fa/target/nvptx64-nvidia-cuda/debug/deps/proxy.3rg6oty3sxxix4x5.rcgu.o.

I suspect Rust generates 6.0 bitcode that can't be processed by ptx-linker since it depends on LLVM 5.0 on Travis.

@dbeckwith
Copy link
Contributor Author

Yep, I'm using llvm 5.0.0 as required by the llvm-sys 50 crate that's required by ptx-linker.
GitHub won't let me upload that file type, so I just put it in my Dropbox.

@denzp
Copy link
Owner

denzp commented May 4, 2018

Thanks for details!

The file seems fine, it's indeed an LLVM bitcode. Which proves assumption about LLVM version issues... I'll add more strict version requirements for ptx-linker soon.

@denzp
Copy link
Owner

denzp commented May 4, 2018

Sorry for the delay, I'm afraid it's blocked by the denzp/rust-ptx-linker#11 because debug mode is de-facto default mode during development. I think it's important to get the linker updated and published first.

@dbeckwith
Copy link
Contributor Author

No problem! Thanks for helping!

@denzp denzp merged commit 5ff39b5 into denzp:master May 4, 2018
@denzp
Copy link
Owner

denzp commented May 4, 2018

Thanks for the PR!

I updated ptx-linker version requirements in a685c5b and published 0.3.4.

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

Successfully merging this pull request may close these issues.

Debugging produced PTX?
2 participants