2014-09-29 23:58:16 +00:00
|
|
|
#!/usr/bin/env bash
|
2019-04-18 17:51:19 +00:00
|
|
|
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
2017-05-10 15:54:46 +00:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2017-06-05 19:16:02 +00:00
|
|
|
# remove fixed relesever variable present in the hanscode boxes
|
|
|
|
sudo rm -f /etc/yum/vars/releasever
|
2017-05-10 15:54:46 +00:00
|
|
|
|
|
|
|
# enable EPEL
|
|
|
|
sudo yum -y install epel-release
|
|
|
|
|
2014-09-29 23:58:16 +00:00
|
|
|
# install all required packages for rocksdb that are available through yum
|
2017-09-21 23:39:22 +00:00
|
|
|
sudo yum -y install openssl java-1.7.0-openjdk-devel zlib-devel bzip2-devel lz4-devel snappy-devel libzstd-devel jemalloc-devel
|
2014-09-29 23:58:16 +00:00
|
|
|
|
2017-06-05 19:16:02 +00:00
|
|
|
# install gcc/g++ 4.8.2 from tru/devtools-2
|
|
|
|
sudo wget -O /etc/yum.repos.d/devtools-2.repo https://people.centos.org/tru/devtools-2/devtools-2.repo
|
|
|
|
sudo yum -y install devtoolset-2-binutils devtoolset-2-gcc devtoolset-2-gcc-c++
|
2015-09-01 18:07:43 +00:00
|
|
|
|
2017-05-10 15:54:46 +00:00
|
|
|
# install gflags
|
2017-03-31 16:59:02 +00:00
|
|
|
wget https://github.com/gflags/gflags/archive/v2.0.tar.gz -O gflags-2.0.tar.gz
|
|
|
|
tar xvfz gflags-2.0.tar.gz; cd gflags-2.0; scl enable devtoolset-2 ./configure; scl enable devtoolset-2 make; sudo make install
|
2014-09-29 23:58:16 +00:00
|
|
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
|
|
|
|
|
|
|
|
# set java home so we can build rocksdb jars
|
2014-10-21 19:18:33 +00:00
|
|
|
export JAVA_HOME=/usr/lib/jvm/java-1.7.0
|
2014-09-29 23:58:16 +00:00
|
|
|
|
|
|
|
# build rocksdb
|
|
|
|
cd /rocksdb
|
2015-09-01 18:07:43 +00:00
|
|
|
scl enable devtoolset-2 'make jclean clean'
|
2018-07-23 20:24:50 +00:00
|
|
|
scl enable devtoolset-2 'PORTABLE=1 make -j8 rocksdbjavastatic'
|
2015-01-31 22:23:59 +00:00
|
|
|
cp /rocksdb/java/target/librocksdbjni-* /rocksdb-build
|
|
|
|
cp /rocksdb/java/target/rocksdbjni-* /rocksdb-build
|