You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.6 KiB
Bash

2 years ago
#!/usr/bin/env bash
set -e
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
export CC=/usr/bin/clang-12
export CPP=/usr/bin/clang-cpp-12
export CXX=/usr/bin/clang++-12
export LD=/usr/bin/ld.lld-12
2 years ago
if [ ! -f ${CC} ]; then echo "${CC} not found"; exit; fi
if [ ! -f ${CPP} ]; then echo "${CPP} not found"; exit; fi
if [ ! -f ${CXX} ]; then echo "${CXX} not found"; exit; fi
if [ ! -f ${LD} ]; then echo "${LD} not found"; exit; fi
2 years ago
fi
# gflags
cd gflags
rm -fr cmake_build
2 years ago
mkdir cmake_build && cd cmake_build
cmake ..
make -j 8
cd ../..
# lz4
cd lz4
make clean
2 years ago
make -j 8
cd ..
# zstd
cd zstd
make clean
make -j 8
cd ..
# jemalloc
cd jemalloc
2 years ago
./autogen.sh --disable-debug --with-jemalloc-prefix=''
2 years ago
make -j 8
cd ..
# rocksdb
2 years ago
export CFLAGS=-fPIE
export CXXFLAGS=-fPIE
2 years ago
cd rocksdb
rm -fr cmake_build
mkdir cmake_build && cd cmake_build
2 years ago
# cp ../../thirdparty.inc ../thirdparty.inc
2 years ago
cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_MODULE_PATH="${PWD}/../../lz4;${PWD}/../../zstd" \
-DROCKSDB_BUILD_SHARED=0 \
2 years ago
-DGFLAGS_INCLUDE_DIR=${PWD}/../../gflags/cmake_build/include \
-DGFLAGS_LIBRARIES=${PWD}/../../gflags/cmake_build/lib \
2 years ago
-Dlz4_INCLUDE_DIRS=${PWD}/../../lz4/lib \
-Dlz4_LIBRARIES=${PWD}/../../lz4/lib \
-Dzstd_INCLUDE_DIRS=${PWD}/../../zstd/lib \
-Dzstd_LIBRARIES=${PWD}/../../zstd/lib \
-DJeMalloc_INCLUDE_DIRS=${PWD}/../../jemalloc/include \
-DJeMalloc_LIBRARIES=${PWD}/../../jemalloc/lib \
2 years ago
-DCMAKE_CXX_STANDARD=20 -DWITH_GFLAGS=1 -DWITH_LZ4=1 -DWITH_ZSTD=1 -DUSE_RTTI=1 -DWITH_TESTS=0 \
-DWITH_JEMALLOC=1 -DWITH_BENCHMARK_TOOLS=0 -DWITH_CORE_TOOLS=0 -DWITH_TOOLS=0 ..
make -j 8
cd ..