[cmake-developers] [CMake 0013450]: FindCuda: nvcc chockes on -std=c++11

Mantis Bug Tracker mantis at public.kitware.com
Thu Aug 2 09:47:48 EDT 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=13450 
====================================================================== 
Reported By:                Jan Rüegg
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13450
Category:                   Modules
Reproducibility:            always
Severity:                   minor
Priority:                   high
Status:                     new
====================================================================== 
Date Submitted:             2012-08-02 09:47 EDT
Last Modified:              2012-08-02 09:47 EDT
====================================================================== 
Summary:                    FindCuda: nvcc chockes on -std=c++11
Description: 
When adding a library with
CUDA_ADD_LIBRARY
and CUDA_PROPAGATE_HOST_FLAGS is set (as is the default) and -std=c++11 then
making the project crashes since nvcc cannot handle it. Errors like this appear:

Building NVCC (Device) object
AVTLibraries/FutureVideoLibs/CudaPack/CMakeFiles/CudaPack.dir/src/./CudaPack_generated_convolutionSeparable_kernel.cu.o
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/x86_64-unknown-linux-gnu/bits/c++config.h(177):
error: identifier "nullptr" is undefined

/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/x86_64-unknown-linux-gnu/bits/c++config.h(177):
error: expected a ";"


Additional Information: 
Checking if -std=c++11 is enabled and removing it from the flags forwarded to
nvcc should solve the problem. (Something like this:

if(CMAKE_COMPILER_IS_GNUCC)
  string(REPLACE "-std=c++11" "" CUDA_HOST_FLAGS "${CUDA_HOST_FLAGS}")
  string(REPLACE "-std=c++0x" "" CUDA_HOST_FLAGS "${CUDA_HOST_FLAGS}")
endif()

in CUDA_WRAP_SRC)

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-08-02 09:47 Jan Rüegg      New Issue                                    
======================================================================




More information about the cmake-developers mailing list