-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
48 lines (39 loc) · 1.44 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
cmake_minimum_required(VERSION 3.17)
project(vertexwise_triangle_counting LANGUAGES CXX C)
set(CMAKE_CXX_STANDARD 17)
if (NOT VERBOSE)
set(CMAKE_REQUIRED_QUIET ON)
endif ()
option(ENABLE_CLANGTIDY "Enable clang-tidy support?" OFF)
option(ENABLE_OPENCILK "Enable OpenCilk support?" OFF)
option(ENABLE_OPENMP "Enable OpenMP support?" OFF)
option(ENABLE_PTHREADS "Enable OpenMP support?" OFF)
add_library(coo2csc OBJECT coo2csc.c coo2csc.h)
add_library(mmio OBJECT mmio.h mmio.c)
find_package(PkgConfig)
if (ENABLE_CLANGTIDY)
include(FindClangTidy.cmake)
endif ()
if (ENABLE_OPENCILK)
include(FindOpenCilk.cmake)
endif ()
if (ENABLE_PTHREADS)
include(FindPthreads.cmake)
endif ()
if (ENABLE_OPENMP)
set(CMAKE_C_COMPILER gcc)
set(CMAKE_CXX_COMPILER g++)
add_executable(triangle_v3_openmp triangle_v3_openmp.cpp)
add_executable(triangle_v4_openmp triangle_v4_openmp.cpp)
find_package(OpenMP)
if (OpenMP_CXX_FOUND)
target_link_libraries(triangle_v3_openmp PUBLIC OpenMP::OpenMP_CXX mmio coo2csc)
target_link_libraries(triangle_v4_openmp PUBLIC OpenMP::OpenMP_CXX mmio coo2csc)
add_compile_options(-ftree-vectorize -O3)
endif ()
endif ()
add_compile_options(-O3)
add_executable(triangle_v3_serial triangle_v3_serial.cpp)
target_link_libraries(triangle_v3_serial PUBLIC mmio coo2csc)
add_executable(triangle_v4_serial triangle_v4_serial.cpp)
target_link_libraries(triangle_v4_serial PUBLIC mmio coo2csc)