forked from gunrock/graphblast
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
121 lines (119 loc) · 7.99 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# CMakeLists.txt for unittest
# required cmakeversion
cmake_minimum_required(VERSION 2.8)
# packages
find_package(CUDA)
find_package(Boost COMPONENTS program_options REQUIRED)
#find_package(OpenMP REQUIRED)
#set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "." )
#find_package(MKL REQUIRED)
set( PROJ_NAME "/test" )
set( PROJ_PATH ${CMAKE_SOURCE_DIR})
set( PROJ_OUT_PATH ${CMAKE_BINARY_DIR})
set( PROJ_HEADERS "" )
set( PROJ_LIBRARIES "" )
set( PROJ_INCLUDES "./" "ext/moderngpu/include" "ext/cub/cub")
set( mgpu_SRC_FILES "ext/moderngpu/src/mgpucontext.cu" "ext/moderngpu/src/mgpuutil.cpp")
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../bin )
#set( CUDA_CURAND_LIBRARY "$ENV{CUDA_HOME}/lib64/libcurand.so" )
#set( CUDA_CUBLAS_LIBRARY "$ENV{CUDA_HOME}/lib64/libcublas.so" )
set( CUDA_CUSPARSE_LIBRARY "$ENV{CUDA_HOME}/lib64/libcusparse.so" )
#FILE( GLOB_RECURSE PROJ_SOURCES graphblas/*.cu ../graphblas/*.cpp )
#FILE( GLOB_RECURSE PROJ_LIBRARIES ext/cublas1.1/*.cu )
FILE( GLOB_RECURSE PROJ_HEADERS graphblas/*.hpp)
# nvcc flags
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -arch=sm_35 -lineinfo -O3 -use_fast_math -Xptxas=-v")
#set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-fpermissive;-arch=sm_35;-lineinfo;-Xptxas=-v;-dlcm=ca;-maxrregcount=64)
#set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode arch=compute_20,code=sm_21)
# needed for cudamalloc
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-fpermissive -g -m64 -std=c++11" )
#set(CMAKE_CXX_FLAGS "-fpermissive -pg -m64 -std=c++11" )
#set(CMAKE_CXX_FLAGS "-fpermissive -g -m64 -std=c++11 -H" )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
#set(CMAKE_EXE_LINKER_FLAGS "-lpthread")
#set(CMAKE_EXE_LINKER_FLAGS "-Xlinker --verbose")
# ptx generation
#include_directories( ${PROJ_INCLUDES} )
#cuda_compile_ptx( cuda_ptx_files "matrix/main.cu" )
#add_custom_target( ptx ALL DEPENDS ${cuda_ptx_files} ${PROJ_HEADERS} "matrix/main.cu") #SOURCES main.cu ${PROJ_HEADERS} )
# standard compilation
#include_directories( ${PROJ_INCLUDES} ${Boost_INCLUDE_DIRS} ${MKL_INCLUDE_DIR} )
#add_library( graphblas ${PROJ_LIBRARIES} ${PROJ_HEADERS} )
#set_target_properties( graphblas PROPERTIES LINKER_LANGUAGE CXX )
#add_executable( benchmark_spgemm${PROJ_NAME} "benchmark_spgemm/main.cu" )
#target_link_libraries( spgemm${PROJ_NAME} graphblas "/usr/local/lib/libboost_unit_test_framework.a" "/usr/local/lib/libboost_program_options.a" ${MKL_LIBRARIES} )
#target_link_libraries( benchmark_spgemm${PROJ_NAME} graphblas ${Boost_LIBRARIES} ${MKL_LIBRARIES} pthread )
#set_target_properties( benchmark_spgemm${PROJ_NAME} PROPERTIES LINKER_LANGUAGE CXX )
# standard compilation
message( ${Boost_INCLUDE_DIRS} )
message( ${Boost_LIBRARY_DIRS} )
include_directories( ${PROJ_INCLUDES} ${Boost_INCLUDE_DIRS} )
cuda_add_library( graphblas ${PROJ_LIBRARIES} ${PROJ_HEADERS} )
#cuda_add_executable( gmmio "test/gmmio.cu" ) x
#cuda_add_executable( gutil "test/gutil.cu" ) x
#cuda_add_executable( gspmspv "test/gspmspv.cu" ${mgpu_SRC_FILES} )
#cuda_add_executable( gpull "test/gpull.cu" ${mgpu_SRC_FILES} )
#cuda_add_executable( gpush "test/gpush.cu" ${mgpu_SRC_FILES} )
#cuda_add_executable( gpullbench "test/gpullbench.cu" ${mgpu_SRC_FILES} )
#cuda_add_executable( gpushbench "test/gpushbench.cu" ${mgpu_SRC_FILES} )
#cuda_add_executable( gspmvbench "test/gspmvbench.cu" ${mgpu_SRC_FILES} )
#cuda_add_executable( gspmspvbench "test/gspmspvbench.cu" ${mgpu_SRC_FILES} )
cuda_add_executable( gvxm "test/gvxm.cu" ${mgpu_SRC_FILES} )
#cuda_add_executable( gassign "test/gassign.cu" ${mgpu_SRC_FILES} )
cuda_add_executable( greduce "test/greduce.cu" ${mgpu_SRC_FILES} )
cuda_add_executable( gewisemult "test/gewisemult.cu" ${mgpu_SRC_FILES} )
cuda_add_executable( gewiseadd "test/gewiseadd.cu" ${mgpu_SRC_FILES} )
cuda_add_executable( gbfs "example/gbfs.cu" ${mgpu_SRC_FILES} )
cuda_add_executable( gsssp "example/gsssp.cu" ${mgpu_SRC_FILES} )
cuda_add_executable( glgc "example/glgc.cu" ${mgpu_SRC_FILES} )
cuda_add_executable( ggc "example/ggc.cu" ${mgpu_SRC_FILES} )
cuda_add_executable( gmis "example/gmis.cu" ${mgpu_SRC_FILES} )
cuda_add_executable( gmis "example/gtc.cu" ${mgpu_SRC_FILES} )
cuda_add_executable( gbuild "test/gbuild.cu" ${mgpu_SRC_FILES} )
cuda_add_executable( gtrace "test/gtrace.cu" ${mgpu_SRC_FILES} )
#cuda_add_executable( grandbfs "test/grandbfs.cu" ${mgpu_SRC_FILES} )
#cuda_add_executable( gvector "test/gvector.cu" ${mgpu_SRC_FILES} )
#cuda_add_executable( gdensevector "test/gdensevector.cu" ${mgpu_SRC_FILES} )
#cuda_add_executable( gsparsevector "test/gsparsevector.cu" ${mgpu_SRC_FILES} )
#cuda_add_executable( gdescriptor "test/gdescriptor.cu" ${mgpu_SRC_FILES} )
#cuda_add_executable( gbinaryop "test/gbinaryop.cu" ${mgpu_SRC_FILES} )
#cuda_add_executable( gsparsematrix "test/gsparsematrix.cu" ${mgpu_SRC_FILES} )
#cuda_add_executable( gmatrix "test/gmatrix.cu" ) x
#cuda_add_executable( gspmm "test/gspmm.cu" ${mgpu_SRC_FILES} ) x
cuda_add_executable( gspgemm "test/gspgemm.cu" ${mgpu_SRC_FILES} )
#cuda_add_executable( gbspmm "test/gbspmm.cu" ${mgpu_SRC_FILES} ) x
#cuda_add_executable( gbspgemm "test/gbspgemm.cu" ) x
#target_link_libraries( gmmio graphblas ${Boost_LIBRARIES} )
#target_link_libraries( gutil graphblas ${Boost_LIBRARIES} )
#target_link_libraries( gspmspv graphblas ${Boost_LIBRARIES} )
#target_link_libraries( gpull graphblas ${Boost_LIBRARIES} )
#target_link_libraries( gpush graphblas ${Boost_LIBRARIES} )
#target_link_libraries( gpullbench graphblas ${Boost_LIBRARIES} )
#target_link_libraries( gpushbench graphblas ${Boost_LIBRARIES} )
#target_link_libraries( gspmvbench graphblas ${Boost_LIBRARIES} )
#target_link_libraries( gspmspvbench graphblas ${Boost_LIBRARIES} )
target_link_libraries( gvxm graphblas ${Boost_LIBRARIES} )
#target_link_libraries( gassign graphblas ${Boost_LIBRARIES} )
target_link_libraries( greduce graphblas ${Boost_LIBRARIES} )
target_link_libraries( gewisemult graphblas ${Boost_LIBRARIES} )
target_link_libraries( gewiseadd graphblas ${Boost_LIBRARIES} )
target_link_libraries( gbfs graphblas ${Boost_LIBRARIES} )
target_link_libraries( gsssp graphblas ${Boost_LIBRARIES} )
target_link_libraries( glgc graphblas ${Boost_LIBRARIES} )
target_link_libraries( ggc graphblas ${CUDA_CUSPARSE_LIBRARY} ${Boost_LIBRARIES} )
target_link_libraries( gmis graphblas ${Boost_LIBRARIES} )
target_link_libraries( gtc graphblas ${Boost_LIBRARIES} )
target_link_libraries( gbuild graphblas ${Boost_LIBRARIES} )
target_link_libraries( gtrace graphblas ${CUDA_CUSPARSE_LIBRARY} ${Boost_LIBRARIES} )
#target_link_libraries( grandbfs graphblas ${Boost_LIBRARIES} )
#target_link_libraries( gvector graphblas ${Boost_LIBRARIES} )
#target_link_libraries( gdensevector graphblas ${Boost_LIBRARIES} )
#target_link_libraries( gsparsevector graphblas ${Boost_LIBRARIES} )
#target_link_libraries( gdescriptor graphblas ${Boost_LIBRARIES} )
#target_link_libraries( gbinaryop graphblas ${Boost_LIBRARIES} )
#target_link_libraries( gsparsematrix graphblas ${Boost_LIBRARIES} )
#target_link_libraries( gspmm graphblas ${CUDA_CUSPARSE_LIBRARY} ${Boost_LIBRARIES} )
target_link_libraries( gspgemm graphblas ${CUDA_CUSPARSE_LIBRARY} ${Boost_LIBRARIES} )
#target_link_libraries( gbspmm graphblas ${CUDA_CUSPARSE_LIBRARY} ${Boost_LIBRARIES} )
#target_link_libraries( gbspgemm graphblas ${CUDA_CUSPARSE_LIBRARY} ${Boost_LIBRARIES})