-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
74 lines (62 loc) · 3.02 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
cmake_minimum_required(VERSION 3.14)
project(MaskedSpGEMM
VERSION 0.1
LANGUAGES C CXX)
macro(add_example _name _src)
message(${CMAKE_CURRENT_SOURCE_DIR})
add_executable(${_name} ${_src}
${PROJECT_SOURCE_DIR}/GTgraph/R-MAT/graph.o
${PROJECT_SOURCE_DIR}/GTgraph/R-MAT/utils.o
${PROJECT_SOURCE_DIR}/GTgraph/R-MAT/init.o
${PROJECT_SOURCE_DIR}/GTgraph/R-MAT/globals.o
${PROJECT_SOURCE_DIR}/PaRMAT/Release/src/GraphGen_notSorted.o
${PROJECT_SOURCE_DIR}/PaRMAT/Release/src/utils.o
${PROJECT_SOURCE_DIR}/PaRMAT/Release/src/Edge.o
${PROJECT_SOURCE_DIR}/PaRMAT/Release/src/Square.o
${PROJECT_SOURCE_DIR}/PaRMAT/Release/src/GraphGen_sorted.o)
target_include_directories(${_name} PRIVATE ${PROJECT_SOURCE_DIR}/GTgraph/sprng2.0-lite/include)
target_link_directories(${_name} PRIVATE ${PROJECT_SOURCE_DIR}/GTgraph/sprng2.0-lite/lib)
target_link_libraries(${_name} libsprng.a)
target_include_directories(${_name} PRIVATE ${PROJECT_SOURCE_DIR}/GraphBLAS/Include)
target_link_directories(${_name} PRIVATE ${PROJECT_SOURCE_DIR}/GraphBLAS/build)
target_link_libraries(${_name} libgraphblas.so)
find_package(OpenMP REQUIRED)
target_link_libraries(${_name} OpenMP::OpenMP_CXX)
# target_include_directories(${_name} PRIVATE /opt/tbb/include/)
# target_link_libraries(${_name} /opt/tbb/lib/intel64/gcc4.8/libtbb.so)
# target_link_libraries(${_name} /opt/tbb/lib/intel64/gcc4.8/libtbbmalloc.so)
target_compile_definitions(${_name} PRIVATE CPP)
target_compile_features(${_name} PUBLIC cxx_std_17)
endmacro()
include(FetchContent)
FetchContent_Declare(
otx
GIT_REPOSITORY https://github.com/srki/otx.git
)
FetchContent_MakeAvailable(otx)
add_example(masked-all benchmarks/MaskedAllSpGEMM.cpp)
add_example(complement-masked-all benchmarks/ComplementMaskedSpGEMM.cpp)
add_example(tricnt-all benchmarks/TriCntAll.cpp)
add_example(tricnt-all-grb benchmarks/TriCntAllGrb.cpp)
add_example(ktruss-all-grb benchmarks/KTrussAllGrb.cpp)
add_example(bc-all-grb benchmarks/BCAllGrb.cpp)
# add_example(test-grb sample/test_grb.cpp)
if (BUILD_HEATMAP)
add_example(heatmap benchmarks/HeatMap.cpp)
target_link_libraries(heatmap otx-cpp)
endif ()
if (BUILD_TESTS)
add_subdirectory(test)
endif ()
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
message(STATUS "C compiler flags: ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_DEBUG}")
message(STATUS "C++ compiler flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}")
elseif (CMAKE_BUILD_TYPE STREQUAL "Release")
message(STATUS "C compiler flags: ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_RELEASE}")
message(STATUS "C++ compiler flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
elseif (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
message(STATUS "C compiler flags: ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_RELWITHDEBINFO}")
message(STATUS "C++ compiler flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
else ()
message("Build type unknown.")
endif ()