Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc updates #10

Merged
merged 2 commits into from
Mar 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .github/workflows/build-and-test-u20.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Bionic Build
name: Build

on:
push:
Expand All @@ -9,13 +9,15 @@ jobs:
build:
runs-on:
- disco-runner
- focal
steps:
- uses: actions/checkout@v2
- name: update system
run:
sudo apt-get update -y;
sudo apt-get upgrade -y;
sudo rm -rf /usr/include/discodb.h /usr/include/ddb*.h /usr/lib/libdiscodb.so
sudo rm -rf /usr/include/discodb.h /usr/include/ddb*.h /usr/lib/libdiscodb.so;
sudo rm -rf /usr/local/include/discodb.h /usr/local/include/ddb*.h /usr/local/lib/libdiscodb.so
- name: install c dependency
run:
sudo apt-get install -y wget libcmph-dev cmake make build-essential luajit;
Expand All @@ -34,14 +36,13 @@ jobs:
run:
rm -rf cmake-release;
mkdir cmake-release && cd cmake-release;
cmake -DCMAKE_BUILD_TYPE=Release ..;
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release ..;
make;
make test;
sudo install libdiscodb.so /usr/lib/libdiscodb.so ;
sudo install ../src/*.h /usr/include/. ;
- name: install python dependency
sudo make install;
- name: install scripting dependency
run:
sudo apt-get install -y python3-dev python3-wheel python3-pip
sudo apt-get install -y python3-dev python3-wheel python3-pip luajit
- name: build python library
run:
cd python;
Expand Down
46 changes: 46 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,29 @@ project(libdiscodb)
# undefined uses the less restrictive implementation
# add_definitions(-DLGPL_IS_OK)


## SECTION 1 -- COMPILE Checks
INCLUDE(CheckIncludeFiles)
INCLUDE (CheckLibraryExists)

option(lgpl-is-ok "use SuperFastHash rather than CityHash" OFF)


CHECK_INCLUDE_FILES(cmph.h HAVE_CMPH_H)
if(NOT HAVE_CMPH_H)
message(SEND_ERROR "CMPH header is required, stopping")
return()
endif()
CHECK_LIBRARY_EXISTS(cmph cmph_config_new "" HAVE_CMPH_LIB)
if(NOT HAVE_CMPH_LIB)
message(SEND_ERROR "cmph library is required, stopping")
return()
endif()
if(lgpl-is-ok)
message("-- requested SuperFastHash with -D lgpl-is-ok, will build with SuperFastHash rather than CityHash")
add_definitions(-DLGPL_IS_OK)
endif()

INCLUDE_DIRECTORIES(/usr/include/ src/ )
LINK_DIRECTORIES(/usr/lib64/)
set(SOURCE_FILES src/ddb_delta.c
Expand All @@ -22,6 +45,22 @@ set(SOURCE_FILES src/ddb_delta.c
src/ddb_map.c
src/ddb_view.c)

set(HEADER_FILES src/ddb_bits.h
src/ddb_cmph.h
src/ddb_delta.h
src/ddb_deltalist.h
src/ddb_hash.h
src/ddb_huffman.h
src/ddb_internal.h
src/ddb_list.h
src/ddb_map.h
src/ddb_membuffer.h
src/ddb_profile.h
src/ddb_queue.h
src/ddb_types.h
src/discodb.h
)


add_library(discodb SHARED ${SOURCE_FILES})

Expand All @@ -43,6 +82,13 @@ target_link_libraries(ddb_merge discodb )
add_executable(ddb_invert src/util/invert.c)
target_link_libraries(ddb_invert discodb )


install(FILES ${HEADER_FILES} DESTINATION include)
install(TARGETS discodb ddb_create ddb_query ddb_merge ddb_invert
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/static)

enable_testing()

add_executable(tddb_from_kv src/tests/create_and_query.c)
Expand Down
2 changes: 0 additions & 2 deletions doc/capi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ capi -- C library to read/write DiscoDBs
The C library is the native control application for reading and writing DiscoDBs


Examples
========

Opening a discodb
------------------
Expand Down
4 changes: 2 additions & 2 deletions doc/luaapi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ The following examples demonstrate a prebuilt ddb obtained using



Examples
========

Basic discodb wrapper for Lua.

libdiscodb.so should be in :code:`LD_LIBRARY_PATH`



Open and list keys
------------------

Expand Down
2 changes: 0 additions & 2 deletions doc/pythonapi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ By default the python API links against libdiscodb at runtime and provides a thi



Examples
========

incrementally adding key/value pairs to a constructor
-----------------------------------------------------
Expand Down