-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
65 lines (56 loc) · 2.2 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
cmake_minimum_required(VERSION 2.8)
project("vargas")
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
include_directories(doctest/doctest include htslib cxxopts/src)
link_directories(${PROJECT_SOURCE_DIR}/htslib)
set(MAIN_SOURCES
src/main.cpp
src/graph.cpp
src/utils.cpp
src/varfile.cpp
src/sim.cpp
src/fasta.cpp
src/sam.cpp
src/align_main.cpp
src/scoring.cpp
src/graphman.cpp)
set(HEADERS
include/alignment.h
include/dyn_bitset.h
include/fasta.h
include/graph.h
include/main.h
include/sam.h
include/sim.h
include/utils.h
include/varfile.h
include/align_main.h
include/scoring.h
include/simd.h)
option(BUILD_AVX512BW_INTEL "Use Intel compiler to build for AVX512BW" OFF)
option(BUILD_AVX512BW_GCC "Use GCC compiler to build for AVX512BW" OFF)
option(BUILD_AVX2_INTEL "Use Intel compiler to build for AVX2" OFF)
option(BUILD_AVX2_GCC "Use GCC compiler to build for AVX2" OFF)
if(BUILD_AVX512BW_INTEL)
message(" Building for AVX512BW (Intel)")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd597 -xCORE-AVX512 -DVA_SIMD_USE_AVX512")
elseif(BUILD_AVX512BW_GCC)
message(" Building for AVX512BW (GCC)")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx512bw -DVA_SIMD_USE_AVX512")
elseif(BUILD_AVX2_INTEL)
message(" Building for AVX2 (Intel)")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd597 -xCORE-AVX2 -DVA_SIMD_USE_AVX2")
elseif(BUILD_AVX2_GCC)
message(" Building for AVX2 (GCC)")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx2 -DVA_SIMD_USE_AVX2")
else()
message(" Building for SSE4.1 (GCC)")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1 -DVA_SIMD_USE_SSE")
endif()
add_executable(vargas ${MAIN_SOURCES})
target_link_libraries(vargas hts)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3 -DNDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -pedantic -Wall -Wextra -Wno-unused-function -fno-inline")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_DEBUG}")