forked from 9rum/flatflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (34 loc) · 1.45 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
# Adapted from https://github.com/pytorch/pytorch/blob/v2.4.0/Makefile
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
# This makefile does nothing but delegating the actual building to CMake.
CMAKE_BUILD_TYPE ?= Release
CMAKE_CXX_STANDARD ?= 20
FLATFLOW_BUILD_TESTS ?= OFF
.PHONY: all generate test clean
all:
@mkdir -p build && \
cd build && \
cmake .. \
-DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) \
-DCMAKE_CXX_STANDARD=$(CMAKE_CXX_STANDARD) \
-DFLATFLOW_BUILD_TESTS=$(FLATFLOW_BUILD_TESTS) && \
$(MAKE)
generate:
@mkdir -p tmp/rpc && \
mv flatflow/__init__.py tmp && \
mv flatflow/rpc/__init__.py tmp/rpc && \
./build/third_party/flatbuffers/flatc -c -o flatflow/rpc flatflow/rpc/empty.fbs && \
./build/third_party/flatbuffers/flatc -c -o flatflow/rpc -I . --keep-prefix flatflow/rpc/communicator.fbs && \
./build/third_party/flatbuffers/flatc -p flatflow/rpc/empty.fbs && \
./build/third_party/flatbuffers/flatc -p --grpc -I . flatflow/rpc/communicator.fbs && \
./build/third_party/flatbuffers/flatc -c -o tests/data tests/data/dataset_test.fbs && \
./build/third_party/flatbuffers/flatc -c -o tests/scheduler tests/scheduler/scheduler_test.fbs && \
mv tmp/__init__.py flatflow && \
mv tmp/rpc/__init__.py flatflow/rpc && \
rm -r tmp
test:
@ctest --test-dir build
clean:
@rm -r build