[CMake] Incorrect setting of CUDA_HOST_COMPILER on macosx

Pat Marion pat.marion at kitware.com
Tue Mar 26 19:41:33 EDT 2013


Hi,

FindCUDA.cmake sets CUDA_HOST_COMPILER to CMAKE_C_COMPILER.  I think that
the CUDA_HOST_COMPILER variable was introduced in cmake 2.8.10.  The issue
is that on macosx, CMAKE_C_COMPILER defaults to /usr/bin/cc which is clang,
and clang is not a supported cuda compiler.  One workaround is to set
CUDA_HOST_COMPILER to /usr/bin/gcc on macosx.

Here is the nvidia documentation that states the requirement "The
gcccompiler and toolchain installed using Xcode "

http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-mac-os-x/


This bug related to CUDA_HOST_COMPILER shows up on the issue trackers of a
few different projects, for example:

http://code.opencv.org/issues/2504
http://dev.pointclouds.org/issues/979


I made a commit for pcl that demonstrates a possible workaround, but I'm
interested to have some insight from the cmake community regarding what the
best workaround might be.

https://github.com/patmarion/pcl-1/commit/29a12df7a6218fb3ebdee01c086b21d31d457519


Thanks!
Pat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130327/bbef807b/attachment.htm>


More information about the CMake mailing list