Closed intelfx closed 7 years ago
@intelfx Hm interesting, I never ran into a problem with this. Is it also a problem on the main branch of Caffe?
No, it isn't because they don't use c++11.
Ok, but if the user-passed flag is not set to -std=c++11
then will -std c++11
(alternative form) also work?
Never actually seen this being used before, I'll need to do some testing then.
What are the specifications of your system (other than CUDA 7.5 and GCC 5.4)?
FindCUDA.cmake does the following check: if host C++ flags have -std=c++11
but user-passed nvcc flags do not have -std c++11
, then -std c++11
is appended to nvcc flags.
This is CMake 3.6.1, gcc 5.4.0 (normally I have gcc 6.1.1, but CUDA does not like it), CUDA 7.5.18... what else? I'm using fully updated Arch, so for other versions just head to https://packages.archlinux.org.
Ok thanks.
I can't test this locally because the build still fails in obscure toolchain internals (CUDA 7.5 / gcc 5.4), but at least nvcc does not complain about repeated
-std
flag.Note that changing form of
-std=c++11
to-std c++11
is crucial because FindCUDA.cmake machinery fails to check for the-std=c++11
form in user-passed flags and hence appends its own flag, which chokes nvcc. (Who on Earth did decide to consider repeated flags as fatal errors?...)