Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
vsreekanti committed Aug 9, 2019
0 parents commit 0c4389d
Show file tree
Hide file tree
Showing 117 changed files with 11,487 additions and 0 deletions.
82 changes: 82 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Copyright 2019 U.C. Berkeley RISE Lab
#
# Licensed 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.

# project specific
build
vendor/gtest/build
*log*.txt
*tmp*

# ignore compiled byte code
target

# ignore output files from testing
output*

# ignore standard Mac OS X files/dirs
.DS_Store
default.profaw

################################################################################
# vim
################################################################################
# swap
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
# session
Session.vim
# temporary
.netrwhist
*~
# auto-generated tag files
tags
# syntastic
.syntastic_clang_tidy_config
.syntastic_cpp_config

################################################################################
# C++
################################################################################
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

[submodule "common"]
path = common
url = https://github.com/hydro-project/common
47 changes: 47 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright 2018 U.C. Berkeley RISE Lab
#
# Licensed 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.

language: cpp
sudo: required

os:
- linux

dist: trusty

compiler:
- clang

services:
- docker

env:
global:
- PROTOBUF_DIR="$HOME/protobuf"
- PROTOBUF_VERSION=3.9.1
- LCOV_VERSION=1.13

cache:
directories:
- $PROTOBUF_DIR

install:
- ./common/scripts/travis/travis-install.sh

script:
- ./scripts/travis/travis-build.sh

after_success:
- ./scripts/travis/upload-codecov.sh
- ./scripts/travis/docker-build.sh
114 changes: 114 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Copyright 2019 U.C. Berkeley RISE Lab
#
# Licensed 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.

CMAKE_MINIMUM_REQUIRED(VERSION 3.6 FATAL_ERROR)
PROJECT(Anna)

SET(ANNA_VERSION_MAJOR 0)
SET(ANNA_VERSION_MINOR 1)
SET(ANNA_VERSION_PATCH 0)

IF(NOT DEFINED BUILD_TEST)
SET(BUILD_TEST OFF)
ENDIF()

IF(${BUILD_TEST})
ENABLE_TESTING()
ENDIF()

SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_STANDARD_REQUIRED on)

SET(VENDOR_DIR common/vendor)

IF(${CMAKE_CXX_COMPILER} STREQUAL "/usr/bin/clang++")
SET(CMAKE_CXX_FLAGS_COMMON
"-std=c++11 \
-stdlib=libc++ -pthread")
ENDIF()

IF(${CMAKE_CXX_COMPILER} STREQUAL "/usr/bin/g++")
SET(CMAKE_CXX_FLAGS_COMMON
"-std=c++11 -pthread")
ENDIF()

SET(CMAKE_CXX_FLAGS_DEBUG
"${CMAKE_CXX_FLAGS_DEBUG} \
${CMAKE_CXX_FLAGS_COMMON} \
-g -O0 -fprofile-arcs -ftest-coverage")

SET(CMAKE_CXX_FLAGS_RELEASE
"${CMAKE_CXX_FLAGS_RELEASE} \
${CMAKE_CXX_FLAGS_COMMON} \
-O3")

ADD_SUBDIRECTORY(${VENDOR_DIR}/spdlog)
ADD_SUBDIRECTORY(${VENDOR_DIR}/yamlcpp)
ADD_SUBDIRECTORY(${VENDOR_DIR}/zeromq)
ADD_SUBDIRECTORY(${VENDOR_DIR}/zeromqcpp)

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
INCLUDE_DIRECTORIES(${SPDLOG_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${ZEROMQCPP_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${ZEROMQ_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${YAMLCPP_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(common/include)
INCLUDE_DIRECTORIES(include)

INCLUDE(FindProtobuf)
FIND_PACKAGE(Protobuf REQUIRED)
INCLUDE_DIRECTORIES(${PROTOBUF_INCLUDE_DIR})
PROTOBUF_GENERATE_CPP(PROTO_SRC PROTO_HEADER
./common/proto/anna.proto
./common/proto/shared.proto
./include/proto/metadata.proto
)

PROTOBUF_GENERATE_CPP(BPROTO_SRC BPROTO_HEADER
./include/proto/benchmark.proto
)

ADD_LIBRARY(anna-proto ${PROTO_HEADER} ${PROTO_SRC})
ADD_LIBRARY(anna-bench-proto ${BPROTO_HEADER} ${BPROTO_SRC})

FILE(GLOB_RECURSE ZMQ_UTIL_SRC common/include/zmq/*.cpp)
FILE(GLOB_RECURSE ZMQ_UTIL_HEADER common/include/zmq/*.hpp)
ADD_LIBRARY(hydro-zmq STATIC ${ZMQ_UTIL_HEADER} ${ZMQ_UTIL_SRC})
ADD_DEPENDENCIES(hydro-zmq zeromq zeromqcpp spdlog)

IF(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
INCLUDE(common/cmake/clang-format.cmake)
INCLUDE(common/cmake/CodeCoverage.cmake)
ENDIF()

LINK_DIRECTORIES(${ZEROMQ_LINK_DIRS} ${YAMLCPP_LINK_DIRS})

ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(client/cpp)

IF(${BUILD_TEST})
INCLUDE(common/cmake/DownloadProject.cmake)
DOWNLOAD_PROJECT(PROJ googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.8.0
UPDATE_DISCONNECTED 1
)

ADD_SUBDIRECTORY(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR})

INCLUDE_DIRECTORIES(common/mock)
INCLUDE_DIRECTORIES(tests)
ADD_SUBDIRECTORY(common/mock)
ADD_SUBDIRECTORY(tests)
ENDIF()
Loading

0 comments on commit 0c4389d

Please sign in to comment.