forked from intel/BDTK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
149 lines (124 loc) · 5.22 KB
/
Makefile
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# Copyright(c) 2022-2023 Intel Corporation.
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
.PHONY: all clean build debug release \
test-cider test-cider-velox test-debug test-release
BUILD_TYPE := Release
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
CPP_SOURCE_DIR := ${ROOT_DIR}/cpp
CPP_BUILD_DIR := ${ROOT_DIR}/build-${BUILD_TYPE}/cpp
all: release
format-fix:
ci/scripts/check.py format branch --fix
format-check:
clang-format --version
ci/scripts/check.py format branch
header-fix:
ci/scripts/check.py header branch --fix
header-check:
ci/scripts/check.py header branch
lint:
ci/scripts/run_cpplint.py \
--cpplint_binary ci/scripts/cpplint.py \
--exclude_globs ci/scripts/lint_exclusions.txt \
--source_dir ci/scripts/lint_inclusions.txt
clean:
@rm -rf build-*
build-common:
@sed -i "s/COMMAND protoc --proto_path \$${CMAKE_SOURCE_DIR}\/ --cpp_out \$${CMAKE_SOURCE_DIR}/COMMAND protoc --proto_path \$${proto_directory}\/ --cpp_out \$${PROTO_OUTPUT_DIR}/g" ${CPP_SOURCE_DIR}/thirdparty/velox/velox/substrait/CMakeLists.txt
@sed -i "s/velox\/substrait\/proto\///g" ${CPP_SOURCE_DIR}/thirdparty/velox/velox/substrait/proto/substrait/algebra.proto
@sed -i "s/velox\/substrait\/proto\///g" ${CPP_SOURCE_DIR}/thirdparty/velox/velox/substrait/proto/substrait/function.proto
@sed -i "s/velox\/substrait\/proto\///g" ${CPP_SOURCE_DIR}/thirdparty/velox/velox/substrait/proto/substrait/parameterized_types.proto
@sed -i "s/velox\/substrait\/proto\///g" ${CPP_SOURCE_DIR}/thirdparty/velox/velox/substrait/proto/substrait/plan.proto
@sed -i "s/velox\/substrait\/proto\///g" ${CPP_SOURCE_DIR}/thirdparty/velox/velox/substrait/proto/substrait/type_expressions.proto
@sed -i 's|"https://.*arrow.*tar.gz"|"https://github.com/apache/arrow/archive/refs/tags/apache-arrow-8.0.0.tar.gz"|g' ${CPP_SOURCE_DIR}/thirdparty/velox/third_party/CMakeLists.txt
@mkdir -p ${CPP_BUILD_DIR}
@cd ${CPP_BUILD_DIR} && \
cmake -Wno-dev \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DENABLE_FOLLY=OFF \
-DENABLE_JIT_DEBUG=OFF \
-DENABLE_PERF_JIT_LISTENER=OFF\
-DENABLE_INTEL_JIT_LISTENER=OFF \
-DPREFER_STATIC_LIBS=OFF \
-DENABLE_ASN=OFF \
-DCIDER_ENABLE_AVX512=OFF\
-DVELOX_ENABLE_SUBSTRAIT=ON \
-DVELOX_ENABLE_PARQUET=ON \
${EXTRA_OPTIONS} \
$(FORCE_COLOR) \
${CPP_SOURCE_DIR}
build:
VERBOSE=1 cmake --build ${CPP_BUILD_DIR} -j $${CPU_COUNT:-`nproc`} \
|| cmake --build ${CPP_BUILD_DIR}
@mkdir -p ${CPP_BUILD_DIR}/src/cider-velox/function/ \
&& cp -r ${CPP_BUILD_DIR}/src/cider/function/*.bc ${CPP_BUILD_DIR}/src/cider-velox/function/
@mkdir -p ${CPP_BUILD_DIR}/src/cider-velox/benchmark/function/ \
&& cp -r ${CPP_BUILD_DIR}/src/cider/function/*.bc ${CPP_BUILD_DIR}/src/cider-velox/benchmark/function/
icl:
@mkdir -p ${CPP_BUILD_DIR}
@cd ${CPP_BUILD_DIR} && \
cmake -Wno-dev \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DBDTK_ENABLE_ICL=ON \
-DBDTK_ENABLE_CIDER=OFF \
$(FORCE_COLOR) \
${CPP_SOURCE_DIR}
VERBOSE=1 cmake --build ${CPP_BUILD_DIR} -j $${CPU_COUNT:-`nproc`} || \
cmake --build ${CPP_BUILD_DIR}
icl-qat:
@mkdir -p ${CPP_BUILD_DIR}
@cd ${CPP_BUILD_DIR} && \
cmake -Wno-dev \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DBDTK_ENABLE_ICL=ON \
-DICL_WITH_QAT=ON \
-DBDTK_ENABLE_CIDER=OFF \
$(FORCE_COLOR) \
${CPP_SOURCE_DIR}
VERBOSE=1 cmake --build ${CPP_BUILD_DIR} -j $${CPU_COUNT:-`nproc`} || \
cmake --build ${CPP_BUILD_DIR}
debug:
@$(MAKE) build-common BUILD_TYPE=Debug
@$(MAKE) build BUILD_TYPE=Debug
reldeb:
@$(MAKE) build-common BUILD_TYPE=RelWithDebInfo
@$(MAKE) build BUILD_TYPE=RelWithDebInfo
release:
@$(MAKE) build-common BUILD_TYPE=Release
@$(MAKE) build BUILD_TYPE=Release
benchmark:
@$(MAKE) build-common BUILD_TYPE=Release \
EXTRA_OPTIONS="-DENABLE_BENCHMARK=ON -DOPTIMIZE_FOR_NATIVE=OFF"
@$(MAKE) build BUILD_TYPE=Release
test-cider:
@cd ${CPP_BUILD_DIR}/src/cider/tests && \
ctest -j $${CPU_COUNT:-`nproc`} -V
test-cider-velox:
@cd ${CPP_BUILD_DIR}/src/cider-velox/test && \
ctest -j $${CPU_COUNT:-`nproc`} -V
test-with-arrow-format:
bash ci/scripts/test_with_arrow_format.sh '${BUILD_TYPE}'
test-debug:
@$(MAKE) test-cider BUILD_TYPE=Debug
@$(MAKE) test-cider-velox BUILD_TYPE=Debug
test-release:
@$(MAKE) test-cider BUILD_TYPE=Release
@$(MAKE) test-cider-velox BUILD_TYPE=Release
update-copyright:
sed -i '0,/Copyright.*Intel Corporation/s//Copyright(c) 2022-$(shell date +"%Y") Intel Corporation/' `grep Copyright -rl --exclude-dir="build-*" --exclude-dir="thirdparty" --exclude-dir=".cache" .`