[cmake-developers] CUDA + CMake 2.8/3.0 + OSX Clang does not compile

Adam Strzelecki ono at java.pl
Wed Jun 11 15:38:49 EDT 2014


This is same example sent in my previous mail to this ML:

CMakeLists.txt
==============
cmake_minimum_required(VERSION 2.6)
project(TestCUDA CXX)
find_package(CUDA)
cuda_add_executable(test_cuda test_cuda.cu)

test_cuda.cu
============
int main(int argc, char const *argv[]) { return 0; }


Now running on my Mac with OSX 10.9.3 I get:

[1/2] Building NVCC (Device) object CMakeFiles/test_cuda.dir//./test_cuda_generated_test_cuda.cu.o
FAILED: cd /tmp/cuda/CMakeFiles/test_cuda.dir && /Applications/CMake.app/Contents/bin/cmake -E make_directory /tmp/cuda/CMakeFiles/test_cuda.dir//. && /Applications/CMake.app/Contents/bin/cmake -D verbose:BOOL=OFF -D build_configuration:STRING= -D generated_file:STRING=/tmp/cuda/CMakeFiles/test_cuda.dir//./test_cuda_generated_test_cuda.cu.o -D generated_cubin_file:STRING=/tmp/cuda/CMakeFiles/test_cuda.dir//./test_cuda_generated_test_cuda.cu.o.cubin.txt -P /tmp/cuda/CMakeFiles/test_cuda.dir//test_cuda_generated_test_cuda.cu.o.cmake
nvcc warning : The 'compute_10' and 'sm_10' architectures are deprecated, and may be removed in a future release.
-m64: No such file or directory


There is a simple way to workaround this with:
if(APPLE)
  set(CUDA_HOST_COMPILER /usr/bin/clang)
endif()

But this seems like a bug that should be fixed in CMake itself.

Also I wonder why CUDA support needs all this complicated intermediate .cu.o.cmake scripts. Can we just call nvcc to get object file????

Regards,
-- 
Adam


More information about the cmake-developers mailing list