Compile CUDA C++ using CMAKE- More than one compilation phase specified -


i trying compile cuda application (on osx yosemite) using cmake. have compilation working makefile:

cxx = nvcc cxx_flags = -c -o3 -arch=sm_21 cxx_libs =  bin = md5_gpu.o  main:     $(cxx) $(cxx_flags) md5_gpu.cu -o $(bin) $(cxx_libs) 

this makefile works, , i've tried port cmake. here attempt @ making cmakelists.txt project:

### cmakelists.txt cuda  cmake_minimum_required(version 2.8) find_package(cuda quiet required)  # pass options nvcc set(cuda_nvcc_flags ${cuda_nvcc_flags};-c -o3 -arch=sm_21)  cuda_compile(md5 md5_gpu.cu)  cuda_add_executable(md5build ${md5}) 

however, when attempt compile cmake (cmake -> make) error thrown reads:

nvcc fatal   : more 1 compilation phase specified cmake error @ cuda_compile_generated_md5_gpu.cu.o.cmake:206 

the additional -c flag superfluous, should work:

find_package(cuda) list(append cuda_nvcc_flags "-arch=sm_21;-o3") cuda_add_executable(md5build md5_gpu.cu) 

Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -