Skip to content

Commit 0c4389d

Browse files
committed
Initial commit
0 parents  commit 0c4389d

File tree

117 files changed

+11487
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+11487
-0
lines changed

.gitignore

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Copyright 2019 U.C. Berkeley RISE Lab
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# project specific
16+
build
17+
vendor/gtest/build
18+
*log*.txt
19+
*tmp*
20+
21+
# ignore compiled byte code
22+
target
23+
24+
# ignore output files from testing
25+
output*
26+
27+
# ignore standard Mac OS X files/dirs
28+
.DS_Store
29+
default.profaw
30+
31+
################################################################################
32+
# vim
33+
################################################################################
34+
# swap
35+
[._]*.s[a-w][a-z]
36+
[._]s[a-w][a-z]
37+
# session
38+
Session.vim
39+
# temporary
40+
.netrwhist
41+
*~
42+
# auto-generated tag files
43+
tags
44+
# syntastic
45+
.syntastic_clang_tidy_config
46+
.syntastic_cpp_config
47+
48+
################################################################################
49+
# C++
50+
################################################################################
51+
# Prerequisites
52+
*.d
53+
54+
# Compiled Object files
55+
*.slo
56+
*.lo
57+
*.o
58+
*.obj
59+
60+
# Precompiled Headers
61+
*.gch
62+
*.pch
63+
64+
# Compiled Dynamic libraries
65+
*.so
66+
*.dylib
67+
*.dll
68+
69+
# Fortran module files
70+
*.mod
71+
*.smod
72+
73+
# Compiled Static libraries
74+
*.lai
75+
*.la
76+
*.a
77+
*.lib
78+
79+
# Executables
80+
*.exe
81+
*.out
82+
*.app

.gitmodules

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
[submodule "common"]
3+
path = common
4+
url = https://github.com/hydro-project/common

.travis.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Copyright 2018 U.C. Berkeley RISE Lab
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
language: cpp
16+
sudo: required
17+
18+
os:
19+
- linux
20+
21+
dist: trusty
22+
23+
compiler:
24+
- clang
25+
26+
services:
27+
- docker
28+
29+
env:
30+
global:
31+
- PROTOBUF_DIR="$HOME/protobuf"
32+
- PROTOBUF_VERSION=3.9.1
33+
- LCOV_VERSION=1.13
34+
35+
cache:
36+
directories:
37+
- $PROTOBUF_DIR
38+
39+
install:
40+
- ./common/scripts/travis/travis-install.sh
41+
42+
script:
43+
- ./scripts/travis/travis-build.sh
44+
45+
after_success:
46+
- ./scripts/travis/upload-codecov.sh
47+
- ./scripts/travis/docker-build.sh

CMakeLists.txt

+114
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Copyright 2019 U.C. Berkeley RISE Lab
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
CMAKE_MINIMUM_REQUIRED(VERSION 3.6 FATAL_ERROR)
16+
PROJECT(Anna)
17+
18+
SET(ANNA_VERSION_MAJOR 0)
19+
SET(ANNA_VERSION_MINOR 1)
20+
SET(ANNA_VERSION_PATCH 0)
21+
22+
IF(NOT DEFINED BUILD_TEST)
23+
SET(BUILD_TEST OFF)
24+
ENDIF()
25+
26+
IF(${BUILD_TEST})
27+
ENABLE_TESTING()
28+
ENDIF()
29+
30+
SET(CMAKE_CXX_STANDARD 11)
31+
SET(CMAKE_CXX_STANDARD_REQUIRED on)
32+
33+
SET(VENDOR_DIR common/vendor)
34+
35+
IF(${CMAKE_CXX_COMPILER} STREQUAL "/usr/bin/clang++")
36+
SET(CMAKE_CXX_FLAGS_COMMON
37+
"-std=c++11 \
38+
-stdlib=libc++ -pthread")
39+
ENDIF()
40+
41+
IF(${CMAKE_CXX_COMPILER} STREQUAL "/usr/bin/g++")
42+
SET(CMAKE_CXX_FLAGS_COMMON
43+
"-std=c++11 -pthread")
44+
ENDIF()
45+
46+
SET(CMAKE_CXX_FLAGS_DEBUG
47+
"${CMAKE_CXX_FLAGS_DEBUG} \
48+
${CMAKE_CXX_FLAGS_COMMON} \
49+
-g -O0 -fprofile-arcs -ftest-coverage")
50+
51+
SET(CMAKE_CXX_FLAGS_RELEASE
52+
"${CMAKE_CXX_FLAGS_RELEASE} \
53+
${CMAKE_CXX_FLAGS_COMMON} \
54+
-O3")
55+
56+
ADD_SUBDIRECTORY(${VENDOR_DIR}/spdlog)
57+
ADD_SUBDIRECTORY(${VENDOR_DIR}/yamlcpp)
58+
ADD_SUBDIRECTORY(${VENDOR_DIR}/zeromq)
59+
ADD_SUBDIRECTORY(${VENDOR_DIR}/zeromqcpp)
60+
61+
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
62+
INCLUDE_DIRECTORIES(${SPDLOG_INCLUDE_DIRS})
63+
INCLUDE_DIRECTORIES(${ZEROMQCPP_INCLUDE_DIRS})
64+
INCLUDE_DIRECTORIES(${ZEROMQ_INCLUDE_DIRS})
65+
INCLUDE_DIRECTORIES(${YAMLCPP_INCLUDE_DIRS})
66+
INCLUDE_DIRECTORIES(common/include)
67+
INCLUDE_DIRECTORIES(include)
68+
69+
INCLUDE(FindProtobuf)
70+
FIND_PACKAGE(Protobuf REQUIRED)
71+
INCLUDE_DIRECTORIES(${PROTOBUF_INCLUDE_DIR})
72+
PROTOBUF_GENERATE_CPP(PROTO_SRC PROTO_HEADER
73+
./common/proto/anna.proto
74+
./common/proto/shared.proto
75+
./include/proto/metadata.proto
76+
)
77+
78+
PROTOBUF_GENERATE_CPP(BPROTO_SRC BPROTO_HEADER
79+
./include/proto/benchmark.proto
80+
)
81+
82+
ADD_LIBRARY(anna-proto ${PROTO_HEADER} ${PROTO_SRC})
83+
ADD_LIBRARY(anna-bench-proto ${BPROTO_HEADER} ${BPROTO_SRC})
84+
85+
FILE(GLOB_RECURSE ZMQ_UTIL_SRC common/include/zmq/*.cpp)
86+
FILE(GLOB_RECURSE ZMQ_UTIL_HEADER common/include/zmq/*.hpp)
87+
ADD_LIBRARY(hydro-zmq STATIC ${ZMQ_UTIL_HEADER} ${ZMQ_UTIL_SRC})
88+
ADD_DEPENDENCIES(hydro-zmq zeromq zeromqcpp spdlog)
89+
90+
IF(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
91+
INCLUDE(common/cmake/clang-format.cmake)
92+
INCLUDE(common/cmake/CodeCoverage.cmake)
93+
ENDIF()
94+
95+
LINK_DIRECTORIES(${ZEROMQ_LINK_DIRS} ${YAMLCPP_LINK_DIRS})
96+
97+
ADD_SUBDIRECTORY(src)
98+
ADD_SUBDIRECTORY(client/cpp)
99+
100+
IF(${BUILD_TEST})
101+
INCLUDE(common/cmake/DownloadProject.cmake)
102+
DOWNLOAD_PROJECT(PROJ googletest
103+
GIT_REPOSITORY https://github.com/google/googletest.git
104+
GIT_TAG release-1.8.0
105+
UPDATE_DISCONNECTED 1
106+
)
107+
108+
ADD_SUBDIRECTORY(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR})
109+
110+
INCLUDE_DIRECTORIES(common/mock)
111+
INCLUDE_DIRECTORIES(tests)
112+
ADD_SUBDIRECTORY(common/mock)
113+
ADD_SUBDIRECTORY(tests)
114+
ENDIF()

0 commit comments

Comments
 (0)