Skip to content

Conversation

MarcusDunn
Copy link

Don't know how the tests works (pointers welcome if you'd like a test).

How the other's (CC and CXX) get initialized seems very complex to support stuff like ccache cc. This is about as simple as could be.

Resolves #995

@MarcusDunn MarcusDunn changed the title allow setting nvcc program via CUDA_CXX allow setting nvcc program via CUDACXX Mar 7, 2024
@@ -2402,7 +2404,8 @@ impl Build {
let dlink = out_dir.join(lib_name.to_owned() + "_dlink.o");
let mut nvcc = self.get_compiler().to_command();
nvcc.arg("--device-link").arg("-o").arg(&dlink).arg(dst);
run(&mut nvcc, "nvcc", &self.cargo_output)?;
let program = env::var("CUDACXX").unwrap_or_else(|_| String::from("nvcc"));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you might need to modify cc::Build::get_base_compiler.

This line you modified is for linking with cuda-specific part only.

P.S. I'm not so familiar with the cuda compilation part, so feel free to point out any mistake.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspected this was too easy. I'll take a look.

@MarcusDunn MarcusDunn marked this pull request as draft March 7, 2024 18:20
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.

feature request: Allow setting nvcc executable via env var.
2 participants