Skip to content

Commit

Permalink
Merge pull request #10 from bauman/dan
Browse files Browse the repository at this point in the history
Doc updates
  • Loading branch information
bauman committed Mar 6, 2021
2 parents 74ad692 + 141d769 commit 458d99a
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 13 deletions.
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

0 comments on commit 458d99a

Please sign in to comment.