Skip to content

nvcc: Allow host compiler different to CXX - #435

Open
kopperp wants to merge 1 commit into
cms-patatrack:masterfrom
kopperp:cuda.nvcc_bin
Open

nvcc: Allow host compiler different to CXX#435
kopperp wants to merge 1 commit into
cms-patatrack:masterfrom
kopperp:cuda.nvcc_bin

Conversation

@kopperp

@kopperp kopperp commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

CUDA uses the environment variable NVCC_CCBIN to specify the host compiler used by nvcc, e.g., in case of an incompatible system GCC version. Respect this variable in the Makefile.

CUDA uses the environment variable `NVCC_CCBIN` to specify the host compiler used by nvcc, e.g., in case of an incompatible system GCC version. Respect this variable in the Makefile.
@fwyzard

fwyzard commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Can't we simple set CXX to a compiler supported by CUDA ?

We try to avoid mixing compilers 🤷🏻‍♂️

@kopperp

kopperp commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

Sure, that also works. You avoid mixing compilers but you need to change CXX when entering/leaving the project.

NVCC_CCBIN can be set globally and is only active for CUDA, with all the upsides and downsides. This MR doesn't really favor any choice, just giving you the option 🤷‍♂️

@kopperp

kopperp commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

Actually, with the current Makefile, setting CXX has no effect since we hardcode to g++. Should we go the CXX route then in a new PR?

@fwyzard

fwyzard commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

make CXX=/path/to/another/compiler should work ?

@kopperp

kopperp commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

make CXX=/path/to/another/compiler should work ?

make CXX='g++-15' cuda does indeed work, the CXX environment variable does not.

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.

2 participants