is there a way for me to force nvcc
to use something other than the system compiler?
I understand that Fedora 24 is not officially supported with CUDA 8, but long story short I really don’t want to revert to Fedora 23 if at all possible.
I tried a lot of different things, compiling GCC 4.9.2 as well as 5.3.0. Fedora ships with gcc 6 now, which is unsupported. I’m not really sure how the whole stack works, but after installing Intel’s compiler (16 update 4 or something) I realized that icc / icpc actually just wrap around the system compiler.
I installed clang 3.8 and have been trying to get things working with that, since I thought I just messed up compiling gcc, but I realize now that what happens is the system gcc is being used for only compiling the device code. I also don’t really understand clang / llvm, it seems like it could also be pulling an intel and wrapping around the system gcc?
I guess the point of the question is really just in general, making sure the compiler used for host code is the same as device code. It seems strange to me that you can change the host compiler, but then get a bunch of conflicts when device code is compiled since it immediately grabs gcc 6’s include files and fails on a bunch of redefinition errors.
Initially, I thought the issue was I didn’t find the right combination with CMake, but I made a reduced example and wrote a Makefile with some ifdefs that error if GNUC is defined, and they only fail when the device code is compiled – not when pure C++ code is compiled since clang is getting used.
Alternatively, is this something that is configured at the time cuda is installed and/or is there a way for me to have CUDA compiled with a different (i.e. clang) compiler?
I am sorry if this is not the right place to ask this question, there were a lot of potential causes for this scenario but I feel that the issue is with CUDA, not CMake, or custom gcc compilations (?..still a novice…).
It seems like this may even be a feature? Otherwise CMake would probably expose something like CUDA_DEVICE_COMPILER and set it to CUDA_HOST_COMPILER?
Thank you for any impressions / suggestions / help!