annotate src/test/CMakeLists.txt @ 294:f6770c0a24c2

add framework
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Fri, 10 Feb 2017 09:55:44 +0900
parents 2bc63a22dd21
children 8236e4ca6983
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
290
625a19d81ed7 add Cmake
ikkun
parents:
diff changeset
1 cmake_minimum_required(VERSION 2.8)
625a19d81ed7 add Cmake
ikkun
parents:
diff changeset
2
291
87128b876c63 add test
ikkun
parents: 290
diff changeset
3 # add_definitions("-Wall -g -O0")
290
625a19d81ed7 add Cmake
ikkun
parents:
diff changeset
4
292
2bc63a22dd21 add twice
ikkun
parents: 291
diff changeset
5 set(CMAKE_C_COMPILER $ENV{CBC_COMPILER})
294
f6770c0a24c2 add framework
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 292
diff changeset
6 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")
292
2bc63a22dd21 add twice
ikkun
parents: 291
diff changeset
7 SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CUDA_LINK_FLAGS}" )
290
625a19d81ed7 add Cmake
ikkun
parents:
diff changeset
8
291
87128b876c63 add test
ikkun
parents: 290
diff changeset
9 cmake_minimum_required(VERSION 2.8)
87128b876c63 add test
ikkun
parents: 290
diff changeset
10 find_package(CUDA REQUIRED)
87128b876c63 add test
ikkun
parents: 290
diff changeset
11
292
2bc63a22dd21 add twice
ikkun
parents: 291
diff changeset
12 add_custom_command(OUTPUT main.o
2bc63a22dd21 add twice
ikkun
parents: 291
diff changeset
13 DEPENDS main.cu
2bc63a22dd21 add twice
ikkun
parents: 291
diff changeset
14 COMMAND nvcc -O -c main.cu
290
625a19d81ed7 add Cmake
ikkun
parents:
diff changeset
15 )
292
2bc63a22dd21 add twice
ikkun
parents: 291
diff changeset
16
2bc63a22dd21 add twice
ikkun
parents: 291
diff changeset
17 add_executable(cudaExmple main.o test.c)
2bc63a22dd21 add twice
ikkun
parents: 291
diff changeset
18
2bc63a22dd21 add twice
ikkun
parents: 291
diff changeset
19 add_custom_command(OUTPUT twice.o
2bc63a22dd21 add twice
ikkun
parents: 291
diff changeset
20 DEPENDS twice.cu
2bc63a22dd21 add twice
ikkun
parents: 291
diff changeset
21 COMMAND nvcc -O -c twice.cu
2bc63a22dd21 add twice
ikkun
parents: 291
diff changeset
22 )
2bc63a22dd21 add twice
ikkun
parents: 291
diff changeset
23
2bc63a22dd21 add twice
ikkun
parents: 291
diff changeset
24 add_custom_command(OUTPUT multiply.o
2bc63a22dd21 add twice
ikkun
parents: 291
diff changeset
25 DEPENDS multiply.cu
294
f6770c0a24c2 add framework
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 292
diff changeset
26 COMMAND nvcc -std=c++11 -O -c multiply.cu
292
2bc63a22dd21 add twice
ikkun
parents: 291
diff changeset
27 )
2bc63a22dd21 add twice
ikkun
parents: 291
diff changeset
28
294
f6770c0a24c2 add framework
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 292
diff changeset
29 add_executable(twiceExample twice.o multiply.o test.c)
f6770c0a24c2 add framework
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 292
diff changeset
30
f6770c0a24c2 add framework
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 292
diff changeset
31 # target_link_libraries(twiceExample ${CUDA_LIBRARIES} ${MPI_LIBRARIES} ${OPENGL_LIBRARIES})
f6770c0a24c2 add framework
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 292
diff changeset
32