Switch from CentOS 5 to CentOS 6 for crossbuilding RocksJava

Summary:
Updates the statically linked libraries from linking against glibc 2.5, to linking against glibc 2.12.
Closes https://github.com/facebook/rocksdb/pull/2405

Differential Revision: D5184132

Pulled By: sagar0

fbshipit-source-id: 7a8ad4cf7e737ca62f29e58938bd49fa02114541
This commit is contained in:
Adam Retter 2017-06-05 12:16:02 -07:00 committed by Facebook Github Bot
parent dba9f3722b
commit 26a8a80711
3 changed files with 11 additions and 20 deletions

View File

@ -1591,12 +1591,12 @@ rocksdbjavastaticrelease: rocksdbjavastatic
rocksdbjavastaticreleasedocker: rocksdbjavastatic rocksdbjavastaticreleasedocker: rocksdbjavastatic
DOCKER_LINUX_X64_CONTAINER=`docker ps -aqf name=rocksdb_linux_x64-be`; \ DOCKER_LINUX_X64_CONTAINER=`docker ps -aqf name=rocksdb_linux_x64-be`; \
if [ -z "$$DOCKER_LINUX_X64_CONTAINER" ]; then \ if [ -z "$$DOCKER_LINUX_X64_CONTAINER" ]; then \
docker container create --attach stdin --attach stdout --attach stderr --volume `pwd`:/rocksdb-host --name rocksdb_linux_x64-be evolvedbinary/rocksjava:centos5_x64-be /rocksdb-host/java/crossbuild/docker-build-linux-centos.sh; \ docker container create --attach stdin --attach stdout --attach stderr --volume `pwd`:/rocksdb-host --name rocksdb_linux_x64-be evolvedbinary/rocksjava:centos6_x64-be /rocksdb-host/java/crossbuild/docker-build-linux-centos.sh; \
fi fi
docker start -a rocksdb_linux_x64-be docker start -a rocksdb_linux_x64-be
DOCKER_LINUX_X86_CONTAINER=`docker ps -aqf name=rocksdb_linux_x86-be`; \ DOCKER_LINUX_X86_CONTAINER=`docker ps -aqf name=rocksdb_linux_x86-be`; \
if [ -z "$$DOCKER_LINUX_X86_CONTAINER" ]; then \ if [ -z "$$DOCKER_LINUX_X86_CONTAINER" ]; then \
docker container create --attach stdin --attach stdout --attach stderr --volume `pwd`:/rocksdb-host --name rocksdb_linux_x86-be evolvedbinary/rocksjava:centos5_x86-be /rocksdb-host/java/crossbuild/docker-build-linux-centos.sh; \ docker container create --attach stdin --attach stdout --attach stderr --volume `pwd`:/rocksdb-host --name rocksdb_linux_x86-be evolvedbinary/rocksjava:centos6_x86-be /rocksdb-host/java/crossbuild/docker-build-linux-centos.sh; \
fi fi
docker start -a rocksdb_linux_x86-be docker start -a rocksdb_linux_x86-be
cd java;jar -cf target/$(ROCKSDB_JAR_ALL) HISTORY*.md cd java;jar -cf target/$(ROCKSDB_JAR_ALL) HISTORY*.md

View File

@ -7,16 +7,17 @@ VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "linux32" do |linux32| config.vm.define "linux32" do |linux32|
linux32.vm.box = "hansode/centos-5.11-i386" linux32.vm.box = "hansode/centos-6.7-i386"
end end
config.vm.define "linux64" do |linux64| config.vm.define "linux64" do |linux64|
linux64.vm.box = "hansode/centos-5.11-x86_64" linux64.vm.box = "hansode/centos-6.7-x86_64"
end end
config.vm.provider "virtualbox" do |v| config.vm.provider "virtualbox" do |v|
v.memory = 2048 v.memory = 2048
v.cpus = 4 v.cpus = 4
v.customize ["modifyvm", :id, "--nictype1", "virtio" ]
end end
config.vm.provision :shell, path: "build-linux-centos.sh" config.vm.provision :shell, path: "build-linux-centos.sh"

View File

@ -2,34 +2,24 @@
set -e set -e
# CentOS 5 is now end of life so we need to switch its repos over to the vault # remove fixed relesever variable present in the hanscode boxes
sed -i -e '/^mirrorlist=/d' -e 's%^#baseurl=http://mirror.centos.org/centos/$releasever/%baseurl=http://vault.centos.org/5.11/%g' /etc/yum.repos.d/CentOS-Base.repo sudo rm -f /etc/yum/vars/releasever
sed -i -e '/^mirrorlist=/d' -e 's%^#baseurl=http://mirror.centos.org/centos/$releasever/%baseurl=http://vault.centos.org/5.11/%g' /etc/yum.repos.d/CentOS-fasttrack.repo
if [ -f /etc/yum.repos.d/libselinux.repo ]; then
sed -i -e '/^mirrorlist=/d' -e 's%^#baseurl=http://mirror.centos.org/centos/$releasever/%baseurl=http://vault.centos.org/5.11/%g' /etc/yum.repos.d/libselinux.repo
fi
# enable EPEL # enable EPEL
sudo yum -y install epel-release sudo yum -y install epel-release
# install all required packages for rocksdb that are available through yum # install all required packages for rocksdb that are available through yum
ARCH=$(uname -i) sudo yum -y install openssl java-1.7.0-openjdk-devel zlib-devel bzip2-devel lz4-devel snappy-devel libzstd-devel
sudo yum -y install openssl java-1.7.0-openjdk-devel.$ARCH zlib-devel bzip2-devel lz4-devel snappy-devel
# install gcc/g++ 4.8.2 via CERN (http://linux.web.cern.ch/linux/devtoolset/) # install gcc/g++ 4.8.2 from tru/devtools-2
sudo wget -O /etc/yum.repos.d/slc5-devtoolset.repo http://linuxsoft.cern.ch/cern/devtoolset/slc5-devtoolset.repo sudo wget -O /etc/yum.repos.d/devtools-2.repo https://people.centos.org/tru/devtools-2/devtools-2.repo
sudo wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-cern http://ftp.mirrorservice.org/sites/ftp.scientificlinux.org/linux/scientific/obsolete/51/i386/RPM-GPG-KEYs/RPM-GPG-KEY-cern sudo yum -y install devtoolset-2-binutils devtoolset-2-gcc devtoolset-2-gcc-c++
sudo yum -y install devtoolset-2
# install gflags # install gflags
wget https://github.com/gflags/gflags/archive/v2.0.tar.gz -O gflags-2.0.tar.gz 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 tar xvfz gflags-2.0.tar.gz; cd gflags-2.0; scl enable devtoolset-2 ./configure; scl enable devtoolset-2 make; sudo make install
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
# install zstandard
wget https://github.com/facebook/zstd/archive/v1.1.3.tar.gz -O zstd-1.1.3.tar.gz
tar zxvf zstd-1.1.3.tar.gz; cd zstd-1.1.3; scl enable devtoolset-2 make; sudo make install
# set java home so we can build rocksdb jars # set java home so we can build rocksdb jars
export JAVA_HOME=/usr/lib/jvm/java-1.7.0 export JAVA_HOME=/usr/lib/jvm/java-1.7.0