[CMake] FindCuda compiler flag problems

James Bigler jamesbigler at gmail.com
Tue May 12 00:42:36 EDT 2015


The issue is that nvcc doesn't accept host compiler flags that are C++
only.  It does understand a version of the command directly (-std c++11).

There should be a fix for this in TOT.  See if you can grab a nightly and
test it out.

James

On Mon, May 11, 2015 at 10:54 AM, Wesley Smith <wesley.hoke at gmail.com>
wrote:

> Hi,
> I'm trying to compile w/ CUDA on Centos6 using Cuda7 and C++11.  When
> I have host propagate flags on, the CXX flags get mangles with escapes
> like this:
>
> ,\"-fPIE\",\"--std=c++11\",\"-DGLM_FORCE_RADIANS\",\"-g\"
>
>
> which causes a ton of errors.  If I turn host propagate flags off, I
> then have to manually add --std=c++11 to the NVCC flags.  The problem
> is that since I have CUDA_SEPARABLE_COMPILATION ON, the linker step
> also gets --std=c++11, which is an error and compilation fails as a
> result.  So, how do I resolve this?  Is there a way to have NVCC flags
> only for compilation and not for linking?  Alternatively, is there a
> way to avoid the crazy string escapes on the CXX flags passed to NVCC?
>
>
> thanks,
> wes
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150511/02c11d4f/attachment.html>


More information about the CMake mailing list