blob: 53a38d0703d4044db06e4e5f1475460a8e02aea6 (
plain)
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
121
122
123
124
125
126
127
128
129
130
131
|
cmake_minimum_required(VERSION 2.8)
project(chill)
set(CHILL_VERSION 0.2.1) # 2.8 doesn't support project version clause
find_package(PythonLibs 2.7 REQUIRED)
find_package(LLVM REQUIRED CONFIG)
add_definitions(${LLVM_DEFINITIONS})
string(TIMESTAMP build_date "\\\"%m/%d/%Y\\\"")
set(CORE_LIBS
omega codegen chillcg parseRel)
set(CORE_SRC
src/dep.cc
src/irtools.cc
src/transformations/loop.cc
src/transformations/loop_basic.cc
src/transformations/loop_datacopy.cc
src/transformations/loop_extra.cc
src/transformations/loop_tile.cc
src/transformations/loop_unroll.cc
src/omegatools.cc
)
set(IR_CHILL_SRC
src/ir_chill.cc
)
set(AST_CHILL_SRC
src/ast/chillASTs.cc
src/ast/node.cpp
)
set(CLANG_FRONTEND
src/frontend/clang.cpp)
set(PYTHON_SRC
src/chillmodule.cc
)
set(PRINTER_SRC
src/printer/generic.cpp
src/printer/dump.cpp
src/printer/cfamily.cpp
)
llvm_map_components_to_libnames(llvm_libs all)
set(clang_libs
clangTooling
clangFrontendTool
clangFrontend
clangDriver
clangSerialization
clangCodeGen
clangParse
clangSema
clangStaticAnalyzerFrontend
clangStaticAnalyzerCheckers
clangStaticAnalyzerCore
clangAnalysis
clangARCMigrate
clangRewrite
clangRewriteFrontend
clangEdit
clangAST
clangLex
clangBasic
)
set(COMMON_FLAGS "-DCHILL_BUILD_DATE=\"${build_date}\" -DCHILL_BUILD_VERSION=\"\\\"${CHILL_VERSION}\\\"\"")
set(CMAKE_CXX_FLAGS "-std=gnu++11 ${COMMON_FLAGS} ${CMAKE_CXX_FLAGS}")
if (DEFINED OMEGAHOME)
link_directories(${OMEGAHOME}/lib)
set(OMEGA_INC ${OMEGAHOME}/include)
else ()
set(OMEGA_INC
${CMAKE_CURRENT_SOURCE_DIR}/lib/omega/include
${CMAKE_CURRENT_SOURCE_DIR}/lib/parserel/include
${CMAKE_CURRENT_SOURCE_DIR}/lib/codegen/include
${CMAKE_CURRENT_SOURCE_DIR}/lib/chillcg/include
)
endif ()
include_directories(
include
lib/chillcg/include
lib/iegenlib/src
${OMEGA_INC}
${LLVM_INCLUDE_DIRS}
${PYTHON_INCLUDE_DIRS})
add_executable(chill
src/chill.cc
${CORE_SRC}
${PYTHON_SRC}
${CLANG_FRONTEND}
${IR_CHILL_SRC}
${AST_CHILL_SRC}
${PRINTER_SRC})
link_directories(${LLVM_LIBRARY_DIRS})
if (${LLVM_PACKAGE_VERSION} VERSION_LESS "3.8") # need to flip llvm with clang
target_link_libraries(chill
${CORE_LIBS}
${clang_libs}
${llvm_libs}
${PYTHON_LIBRARY})
else()
target_link_libraries(chill
${CORE_LIBS}
${llvm_libs}
${clang_libs}
${PYTHON_LIBRARY})
endif()
add_dependencies(chill omega codegen chillcg parseRel)
install(TARGETS chill
RUNTIME DESTINATION bin)
add_subdirectory(lib/omega)
add_subdirectory(lib/codegen)
add_subdirectory(lib/chillcg)
add_subdirectory(lib/parserel)
add_subdirectory(doc)
|