Skip to content

Commit

Permalink
Fixed Server bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
sharathvemula committed Jan 15, 2023
1 parent 650267e commit 7047808
Show file tree
Hide file tree
Showing 19 changed files with 1,055 additions and 142 deletions.
3 changes: 3 additions & 0 deletions waffleClient/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ if (BUILD_STRESS_TESTS)
add_definitions(-DSTRESS_TEST)
endif()

# Storage library
add_subdirectory(libstorage)

# Proxy
add_subdirectory(proxy)

Expand Down
85 changes: 84 additions & 1 deletion waffleClient/cmake-modules/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -281,4 +281,87 @@ if (GENERATE_THRIFT)
add_executable(thriftcompiler IMPORTED GLOBAL)
set_target_properties(thriftcompiler PROPERTIES IMPORTED_LOCATION ${THRIFT_COMPILER})
add_dependencies(thriftcompiler thrift)
endif ()
endif ()


set(CPP_REDIS_CXX_FLAGS "${EXTERNAL_CXX_FLAGS}")
set(CPP_REDIS_C_FLAGS "${EXTERNAL_C_FLAGS}")
set(CPP_REDIS_PREFIX "${PROJECT_BINARY_DIR}/external/cpp_redis")
set(CPP_REDIS_HOME "${CPP_REDIS_PREFIX}")
set(CPP_REDIS_INCLUDE_DIR "${CPP_REDIS_PREFIX}/include")
set(CPP_REDIS_CMAKE_ARGS "-Wno-dev"
"-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
"-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}"
"-DCMAKE_CXX_FLAGS=${CPP_REDIS_CXX_FLAGS}"
"-DCMAKE_C_FLAGS=${CPP_REDIS_C_FLAGS}"
"-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
"-DCMAKE_INSTALL_PREFIX=${CPP_REDIS_PREFIX}"
"-DBUILD_EXAMPLES=OFF"
"-DBUILD_TESTS=OFF"
"-DBUILD_SHARED_LIBS=OFF")
set(CPP_REDIS_STATIC_LIB_NAME "${CMAKE_STATIC_LIBRARY_PREFIX}cpp_redis")
set(CPP_REDIS_TACOPIE_STATIC_LIB_NAME "${CMAKE_STATIC_LIBRARY_PREFIX}tacopie")
set(CPP_REDIS_LIBRARY "${CPP_REDIS_PREFIX}/lib/${CPP_REDIS_STATIC_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(CPP_REDIS_TACOPIE_LIBRARY "${CPP_REDIS_PREFIX}/lib/${CPP_REDIS_TACOPIE_STATIC_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(CPP_REDIS_LIBRARIES ${CPP_REDIS_LIBRARY} ${CPP_REDIS_TACOPIE_LIBRARY})
ExternalProject_Add(cpp_redis
GIT_REPOSITORY https://github.com/Cylix/cpp_redis.git
GIT_TAG ${CPP_REDIS_VERSION}
GIT_SUBMODULES
LIST_SEPARATOR |
CMAKE_ARGS ${CPP_REDIS_CMAKE_ARGS}
LOG_DOWNLOAD ON
LOG_CONFIGURE ON
LOG_BUILD ON
LOG_INSTALL ON)
include_directories(SYSTEM ${CPP_REDIS_INCLUDE_DIR})
message(STATUS "cpp_redis include dir: ${CPP_REDIS_INCLUDE_DIR}")
message(STATUS "cpp_redis static library: ${CPP_REDIS_LIBRARIES}")

set(SSDB_ROCKS_PREFIX "${PROJECT_BINARY_DIR}/external/ssdb_rocks")
set(SSDB_ROCKS_HOME "${SSDB_ROCKS_PREFIX}/src/ssdb_rocks")
set(LEVELDB_PATH "${SSDB_ROCKS_HOME}/deps/rocksdb-master")
set(JEMALLOC_PATH "${SSDB_ROCKS_HOME}/deps/jemalloc-3.3.1")
set(SNAPPY_PATH "${SSDB_ROCKS_HOME}/deps/snappy-1.1.0")

set(LEVELDB_INCLUDE_DIR "${LEVELDB_PATH}/include")
set(JEMALLOC_INCLUDE_DIR "${JEMALLOC_PATH}/include")

set(LEVELDB_LIBRARY "${LEVELDB_PATH}/librocksdb.a")
set(SNAPPY_LIBRARY "${SNAPPY_PATH}/.libs/libsnappy.a")
set(JEMALLOC_LIBRARY "${JEMALLOC_PATH}/lib/libjemalloc.a")

set(SSDB_CLIENT_INCLUDE_DIR "${SSDB_ROCKS_HOME}/api/cpp")
set(SSDB_CLIENT_LIBRARY "${SSDB_ROCKS_HOME}/api/cpp/libssdb.a")

ExternalProject_Add(ssdb_rocks
GIT_REPOSITORY "https://github.com/anuragkh/ssdb-rocks.git"
PREFIX ${SSDB_ROCKS_PREFIX}
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ./build.sh
BUILD_COMMAND "$(MAKE)"
INSTALL_COMMAND ""
LOG_DOWNLOAD ON
LOG_CONFIGURE ON
LOG_BUILD ON
LOG_INSTALL ON)

include_directories(SYSTEM ${LEVELDB_INCLUDE_DIR})
include_directories(SYSTEM ${JEMALLOC_INCLUDE_DIR})
include_directories(SYSTEM ${SSDB_CLIENT_INCLUDE_DIR})

message(STATUS "LevelDB include dir: ${LEVELDB_INCLUDE_DIR}")
message(STATUS "LevelDB library: ${LEVELDB_LIBRARY}")

message(STATUS "Jemalloc include dir: ${JEMALLOC_INCLUDE_DIR}")
message(STATUS "Jemalloc library: ${JEMALLOC_LIBRARY}")

message(STATUS "Snappy library: ${SNAPPY_LIBRARY}")

message(STATUS "SSDB Client include dir: ${SSDB_CLIENT_INCLUDE_DIR}")
message(STATUS "SSDB Client library: ${SSDB_CLIENT_LIBRARY}")

find_package(ZLIB REQUIRED)
include_directories(SYSTEM ${ZLIB_INCLUDE_DIRS})
find_package(BZip2 REQUIRED)
include_directories(SYSTEM ${BZIP2_INCLUDE_DIR})
1 change: 1 addition & 0 deletions waffleClient/libstorage/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set(STORAGE_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/src)
184 changes: 184 additions & 0 deletions waffleClient/libstorage/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.15

# Default target executed when no arguments are given to make.
default_target: all

.PHONY : default_target

# Allow only one "make -f Makefile2" at a time, but pass parallelism.
.NOTPARALLEL:


#=============================================================================
# Special targets provided by cmake.

# Disable implicit rules so canonical targets will work.
.SUFFIXES:


# Remove some rules from gmake that .SUFFIXES does not remove.
SUFFIXES =

.SUFFIXES: .hpux_make_needs_suffix_list


# Suppress display of executed commands.
$(VERBOSE).SILENT:


# A target that is always out of date.
cmake_force:

.PHONY : cmake_force

#=============================================================================
# Set environment variables for the build.

# The shell in which to execute make rules.
SHELL = /bin/sh

# The CMake executable.
CMAKE_COMMAND = /usr/local/Cellar/cmake/3.15.2/bin/cmake

# The command to remove a file.
RM = /usr/local/Cellar/cmake/3.15.2/bin/cmake -E remove -f

# Escaping for special characters.
EQUALS = =

# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /Users/lloydbrown/Research/Pancake/Pancake

# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /Users/lloydbrown/Research/Pancake/Pancake

#=============================================================================
# Targets provided globally by CMake.

# Special rule for the target install/local
install/local: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
/usr/local/Cellar/cmake/3.15.2/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
.PHONY : install/local

# Special rule for the target install/local
install/local/fast: preinstall/fast
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
/usr/local/Cellar/cmake/3.15.2/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
.PHONY : install/local/fast

# Special rule for the target install/strip
install/strip: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
/usr/local/Cellar/cmake/3.15.2/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
.PHONY : install/strip

# Special rule for the target install/strip
install/strip/fast: preinstall/fast
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
/usr/local/Cellar/cmake/3.15.2/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
.PHONY : install/strip/fast

# Special rule for the target install
install: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
/usr/local/Cellar/cmake/3.15.2/bin/cmake -P cmake_install.cmake
.PHONY : install

# Special rule for the target install
install/fast: preinstall/fast
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
/usr/local/Cellar/cmake/3.15.2/bin/cmake -P cmake_install.cmake
.PHONY : install/fast

# Special rule for the target list_install_components
list_install_components:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\""
.PHONY : list_install_components

# Special rule for the target list_install_components
list_install_components/fast: list_install_components

.PHONY : list_install_components/fast

# Special rule for the target rebuild_cache
rebuild_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
/usr/local/Cellar/cmake/3.15.2/bin/cmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : rebuild_cache

# Special rule for the target rebuild_cache
rebuild_cache/fast: rebuild_cache

.PHONY : rebuild_cache/fast

# Special rule for the target edit_cache
edit_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..."
/usr/local/Cellar/cmake/3.15.2/bin/ccmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : edit_cache

# Special rule for the target edit_cache
edit_cache/fast: edit_cache

.PHONY : edit_cache/fast

# The main all target
all: cmake_check_build_system
cd /Users/lloydbrown/Research/Pancake/Pancake && $(CMAKE_COMMAND) -E cmake_progress_start /Users/lloydbrown/Research/Pancake/Pancake/CMakeFiles /Users/lloydbrown/Research/Pancake/Pancake/libstorage/CMakeFiles/progress.marks
cd /Users/lloydbrown/Research/Pancake/Pancake && $(MAKE) -f CMakeFiles/Makefile2 libstorage/all
$(CMAKE_COMMAND) -E cmake_progress_start /Users/lloydbrown/Research/Pancake/Pancake/CMakeFiles 0
.PHONY : all

# The main clean target
clean:
cd /Users/lloydbrown/Research/Pancake/Pancake && $(MAKE) -f CMakeFiles/Makefile2 libstorage/clean
.PHONY : clean

# The main clean target
clean/fast: clean

.PHONY : clean/fast

# Prepare targets for installation.
preinstall: all
cd /Users/lloydbrown/Research/Pancake/Pancake && $(MAKE) -f CMakeFiles/Makefile2 libstorage/preinstall
.PHONY : preinstall

# Prepare targets for installation.
preinstall/fast:
cd /Users/lloydbrown/Research/Pancake/Pancake && $(MAKE) -f CMakeFiles/Makefile2 libstorage/preinstall
.PHONY : preinstall/fast

# clear depends
depend:
cd /Users/lloydbrown/Research/Pancake/Pancake && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
.PHONY : depend

# Help Target
help:
@echo "The following are some of the valid targets for this Makefile:"
@echo "... all (the default if no target is provided)"
@echo "... clean"
@echo "... depend"
@echo "... install/local"
@echo "... install/strip"
@echo "... install"
@echo "... list_install_components"
@echo "... rebuild_cache"
@echo "... edit_cache"
.PHONY : help



#=============================================================================
# Special targets to cleanup operation of make.

# Special rule to run CMake to check the build system integrity.
# No rule that depends on this can have commands that come from listfiles
# because they might be regenerated.
cmake_check_build_system:
cd /Users/lloydbrown/Research/Pancake/Pancake && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system

34 changes: 34 additions & 0 deletions waffleClient/libstorage/cmake_install.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Install script for directory: /Users/lloydbrown/Research/Pancake/Pancake/libstorage

# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")

# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()

# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()

# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()

Loading

0 comments on commit 7047808

Please sign in to comment.