Page MenuHome

Add CMake option to control CUDA host compiler -- Cycles Standalone
ClosedPublic

Authored by howetuft (howetuft) on Mar 5 2022, 11:59 AM.

Details

Summary

This revision allows to specify CUDA host compiler (nvcc's -ccbin command line option) when configuring the build. It addresses the case where the C/C++ compiler to be used in CUDA toolchain should be different from the default C/C++ compiler, for instance in case of compilers versions conflicts or multiple installed compilers...

The new CMake option is named CUDA_HOST_COMPILER and can be used as follows:
cmake -DCUDA_HOST_COMPILER=<path-to-host-compiler>

If the option is not specified, the build configuration behaves as previously.

Diff Detail

Event Timeline

howetuft (howetuft) requested review of this revision.Mar 5 2022, 11:59 AM
howetuft (howetuft) created this revision.
howetuft (howetuft) edited the summary of this revision. (Show Details)
Ray Molenkamp (LazyDodo) added inline comments.
src/kernel/CMakeLists.txt
427

This seems unrelated, should probably not be here.

Brecht Van Lommel (brecht) requested changes to this revision.Mar 5 2022, 6:08 PM
Brecht Van Lommel (brecht) added inline comments.
CMakeLists.txt
133–135 ↗(On Diff #48929)

Name it CUDA_HOST_COMPILER for consistency with variables like CUDA_NVCC_EXECUTABLE and CUDA_NVCC_FLAGS that configure the compiler.

Also group it together with all the other CUDA options a bit higher in this file.

src/kernel/CMakeLists.txt
422

This should not be printed for every compiled kernel.

It could be printed in src/cmake/external_libs.cmake after the "Found CUDA" message.

This revision now requires changes to proceed.Mar 5 2022, 6:08 PM
howetuft (howetuft) edited the summary of this revision. (Show Details)
howetuft (howetuft) marked 3 inline comments as done.Mar 5 2022, 10:17 PM

@Ray Molenkamp (LazyDodo) @Brecht Van Lommel (brecht)
Thank you for your comments, I updated diff accordingly.

This revision is now accepted and ready to land.Mar 7 2022, 3:43 PM