# HG changeset patch # User Shinji KONO # Date 1486691088 -32400 # Node ID f16802b3b580877519a384358cb38dee6d40a197 # Parent 8236e4ca69837df01be1eba95f6695944e0897cf add comment on CMakeLists.txt for cuda test diff -r 8236e4ca6983 -r f16802b3b580 src/test/CMakeLists.txt --- a/src/test/CMakeLists.txt Fri Feb 10 10:08:06 2017 +0900 +++ b/src/test/CMakeLists.txt Fri Feb 10 10:44:48 2017 +0900 @@ -4,8 +4,11 @@ set(NVCCFLAG "-std=c++11" "-g" "-O0" ) -set(CMAKE_C_COMPILER $ENV{CBC_COMPILER}) +# set(CMAKE_C_COMPILER $ENV{CBC_COMPILER}) + set(CUDA_LINK_FLAGS "-framework CUDA -lc++ -Wl,-search_paths_first -Wl,-headerpad_max_install_names /Developer/NVIDIA/CUDA-8.0/lib/libcudart_static.a -Wl,-rpath,/usr/local/cuda/lib") +# for linux use -lcuda + SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CUDA_LINK_FLAGS}" ) cmake_minimum_required(VERSION 2.8) @@ -30,5 +33,9 @@ add_executable(twiceExample twice.o multiply.ptx test.c) +# to compile these, comment out CMAKE_C_COMPILER +# cuda_add_executable(Cudasample_gpu Cudasample_gpu.cu) +# cuda_add_executable(Cudasample_cpu Cudasample_cpu.cu) + # target_link_libraries(twiceExample ${CUDA_LIBRARIES} ${MPI_LIBRARIES} ${OPENGL_LIBRARIES})