Skip to content

Commit

Permalink
Bump rocksdb 6.6.3 (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
linxGnu authored Jan 30, 2020
1 parent dae2154 commit e720d0c
Show file tree
Hide file tree
Showing 144 changed files with 27,376 additions and 2,534 deletions.
1,095 changes: 1,095 additions & 0 deletions CMakeLists.txt

Large diffs are not rendered by default.

28 changes: 0 additions & 28 deletions Dockerfile

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ go build -tags static

You'll need to build [RocksDB](https://github.com/facebook/rocksdb) v6.3.6+ on your machine.

After that, you can install `gorocksdb` using the following command:
After that, you can install `grocksdb` using the following command:

CGO_CFLAGS="-I/path/to/rocksdb/include" \
CGO_LDFLAGS="-L/path/to/rocksdb -lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy -llz4 -lzstd" \
CGO_LDFLAGS="-L/path/to/rocksdb -lrocksdb -lstdc++ -lm -lz -lsnappy -llz4 -lzstd" \
go get github.com/linxGnu/grocksdb

## Usage
Expand Down
27 changes: 9 additions & 18 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
#!/bin/bash
DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# if [[ "$OSTYPE" == "linux-gnu" ]]; then
# INSTALL_PREFIX=$DIRECTORY/dist/linux_amd64
# elif [[ "$OSTYPE" == "darwin"* ]]; then
# INSTALL_PREFIX=$DIRECTORY/dist/darwin_amd64
# fi

INSTALL_PREFIX=$1

export CFLAGS='-fPIC -O3 -pipe -funroll-loops'
Expand All @@ -17,30 +11,27 @@ mkdir -p $BUILD_PATH

CMAKE_REQUIRED_PARAMS="-DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX}"

cd $BUILD_PATH && wget https://github.com/gflags/gflags/archive/v2.2.2.tar.gz && tar xzf v2.2.2.tar.gz && cd gflags-2.2.2 && \
mkdir -p build_place && cd build_place && cmake -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF $CMAKE_REQUIRED_PARAMS \
-DBUILD_gflags_LIB=ON -DBUILD_gflags_nothreads_LIB=ON .. && make -j16 install/strip && \
cd $BUILD_PATH && rm -rf * && ldconfig

cd $BUILD_PATH && wget https://github.com/madler/zlib/archive/v1.2.11.tar.gz && tar xzf v1.2.11.tar.gz && cd zlib-1.2.11 && \
./configure --prefix=$INSTALL_PREFIX --static && make -j16 install && \
cd $BUILD_PATH && rm -rf * && ldconfig
cd $BUILD_PATH && rm -rf *

cd $BUILD_PATH && wget https://github.com/google/snappy/archive/1.1.8.tar.gz && tar xzf 1.1.8.tar.gz && cd snappy-1.1.8 && \
mkdir -p build_place && cd build_place && cmake $CMAKE_REQUIRED_PARAMS -DSNAPPY_BUILD_TESTS=OFF .. && make install/strip -j16 && \
cd $BUILD_PATH && rm -rf * && ldconfig
cd $BUILD_PATH && rm -rf *

cd $BUILD_PATH && wget https://github.com/lz4/lz4/archive/v1.9.2.tar.gz && tar xzf v1.9.2.tar.gz && cd lz4-1.9.2/contrib/cmake_unofficial && \
cmake $CMAKE_REQUIRED_PARAMS -DLZ4_BUILD_LEGACY_LZ4C=OFF -DBUILD_SHARED_LIBS=OFF -DLZ4_POSITION_INDEPENDENT_LIB=ON && make -j16 install && \
cd $BUILD_PATH && rm -rf * && ldconfig
cd $BUILD_PATH && rm -rf *

cd $BUILD_PATH && wget https://github.com/facebook/zstd/releases/download/v1.4.4/zstd-1.4.4.tar.gz && tar xzf zstd-1.4.4.tar.gz && cd zstd-1.4.4/build/cmake && mkdir -p build_place && cd build_place && \
cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DZSTD_BUILD_PROGRAMS=OFF -DZSTD_BUILD_CONTRIB=OFF -DZSTD_BUILD_STATIC=ON -DZSTD_BUILD_SHARED=OFF -DZSTD_BUILD_TESTS=OFF \
$CMAKE_REQUIRED_PARAMS -DZSTD_ZLIB_SUPPORT=ON -DZSTD_LZMA_SUPPORT=OFF -DCMAKE_BUILD_TYPE=Release .. && make -j16 install && \
cd $BUILD_PATH && rm -rf * && ldconfig
cd $BUILD_PATH && rm -rf *

cd $BUILD_PATH && wget https://github.com/facebook/rocksdb/archive/v6.6.3.tar.gz && tar xzf v6.6.3.tar.gz && cd rocksdb-6.6.3/ && \
cp $DIRECTORY/CMakeLists.txt ./ && \
mkdir -p build_place && cd build_place && cmake -DCMAKE_BUILD_TYPE=Release $CMAKE_REQUIRED_PARAMS -DCMAKE_PREFIX_PATH=$INSTALL_PREFIX -DWITH_TESTS=OFF -DWITH_BENCHMARK_TOOLS=OFF -DWITH_TOOLS=OFF \
-DWITH_GFLAGS=ON -DWITH_MD_LIBRARY=OFF -DWITH_RUNTIME_DEBUG=OFF -DROCKSDB_BUILD_SHARED=OFF -DWITH_SNAPPY=1 -DWITH_LZ4=1 -DWITH_ZLIB=1 -DWITH_ZSTD=1 -Dzstd_INCLUDE_DIRS=$INSTALL_PREFIX/include \
-Dzstd_LIBRARIES=$INSTALL_PREFIX/lib/libzstd.a .. && make -j16 install/strip && rm -rf $INSTALL_PREFIX/lib/*.dylib $INSTALL_PREFIX/lib/*.so && \
cd $BUILD_PATH && rm -rf * && ldconfig
-DWITH_MD_LIBRARY=OFF -DWITH_RUNTIME_DEBUG=OFF -DROCKSDB_BUILD_SHARED=OFF -DWITH_SNAPPY=ON -DWITH_LZ4=ON -DWITH_ZLIB=ON -DWITH_ZSTD=ON -DWITH_BZ2=OFF -WITH_GFLAGS=OFF .. && make -j16 install/strip && \
cd $BUILD_PATH && rm -rf *

rm -rf $INSTALL_PREFIX/bin $INSTALL_PREFIX/share $INSTALL_PREFIX/lib/cmake $INSTALL_PREFIX/lib64/cmake $INSTALL_PREFIX/lib/pkgconfig $INSTALL_PREFIX/lib64/pkgconfig
4 changes: 2 additions & 2 deletions builtin_static_darwin_amd64.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// +build builtin_static
// +build builtin_static !static

package grocksdb

// #cgo CFLAGS: -I ${SRCDIR}/dist/darwin_amd64/include
// #cgo CXXFLAGS: -I ${SRCDIR}/dist/darwin_amd64/include
// #cgo LDFLAGS: -L ${SRCDIR}/dist/darwin_amd64/lib -lrocksdb -pthread -lstdc++ -ldl -lm -lzstd -llz4 -lz -lsnappy -lgflags
// #cgo LDFLAGS: -L${SRCDIR}/dist/darwin_amd64/lib -lrocksdb -pthread -lstdc++ -ldl -lm -lzstd -llz4 -lz -lsnappy
import "C"
8 changes: 4 additions & 4 deletions builtin_static_linux_amd64.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// +build builtin_static
// +build builtin_static !static

package grocksdb

// #cgo CFLAGS: -I ${SRCDIR}/dist/linux_amd64/include
// #cgo CXXFLAGS: -I ${SRCDIR}/dist/linux_amd64/include
// #cgo LDFLAGS: -L ${SRCDIR}/dist/linux_amd64/lib -lrocksdb -pthread -lstdc++ -ldl -lm -lzstd -llz4 -lz -lsnappy -lgflags
// #cgo CFLAGS: -I${SRCDIR}/dist/linux_amd64/include
// #cgo CXXFLAGS: -I${SRCDIR}/dist/linux_amd64/include
// #cgo LDFLAGS: -L${SRCDIR}/dist/linux_amd64/lib -L${SRCDIR}/dist/linux_amd64/lib64 -lrocksdb -pthread -lstdc++ -ldl -lm -lzstd -llz4 -lz -lsnappy
import "C"
117 changes: 0 additions & 117 deletions dist/darwin_amd64/bin/gflags_completions.sh

This file was deleted.

Binary file removed dist/darwin_amd64/bin/lz4
Binary file not shown.
1 change: 0 additions & 1 deletion dist/darwin_amd64/bin/lz4cat

This file was deleted.

1 change: 0 additions & 1 deletion dist/darwin_amd64/bin/unlz4

This file was deleted.

Loading

0 comments on commit e720d0c

Please sign in to comment.