From 0b923f0f9aa385e2a60000631526b9397eff88ce Mon Sep 17 00:00:00 2001 From: Chris Riccomini Date: Mon, 29 Sep 2014 16:58:16 -0700 Subject: [PATCH] add centos 5.6 build instead of ubuntu. --- Makefile | 6 +++++- java/crossbuild/Vagrantfile | 7 +++---- java/crossbuild/build-linux-centos.sh | 23 +++++++++++++++++++++++ 3 files changed, 31 insertions(+), 5 deletions(-) create mode 100755 java/crossbuild/build-linux-centos.sh diff --git a/Makefile b/Makefile index 9fc1fe6de..e0c836ec1 100644 --- a/Makefile +++ b/Makefile @@ -554,7 +554,11 @@ rocksdbjavastatic: libz.a libbz2.a libsnappy.a rocksdbjavastaticrelease: rocksdbjavastatic - cd java/crossbuild && vagrant destroy -f && vagrant up + cd java/crossbuild && vagrant destroy -f + vagrant up linux32 + vagrant halt linux32 + vagrant up linux64 + vagrant halt linux64 cd java;jar -cf $(ROCKSDB_JAR_ALL) org/rocksdb/*.class org/rocksdb/util/*.class HISTORY*.md librocksdbjni-*.so librocksdbjni-*.jnilib rocksdbjava: diff --git a/java/crossbuild/Vagrantfile b/java/crossbuild/Vagrantfile index ed591be71..c4b1b1df2 100644 --- a/java/crossbuild/Vagrantfile +++ b/java/crossbuild/Vagrantfile @@ -7,13 +7,11 @@ VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.define "linux32" do |linux32| - linux32.vm.box = "ubuntu/trusty32" - linux32.vm.provision :shell, path: "build-linux.sh" + linux32.vm.box = "hansode/centos-5.6-i386" end config.vm.define "linux64" do |linux64| - linux64.vm.box = "ubuntu/trusty64" - linux64.vm.provision :shell, path: "build-linux.sh" + linux64.vm.box = "hansode/centos-5.6-x86_64" end config.vm.provider "virtualbox" do |v| @@ -21,6 +19,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| v.cpus = 4 end + config.vm.provision :shell, path: "build-linux-centos.sh" config.vm.synced_folder "../", "/rocksdb-build" config.vm.synced_folder "../..", "/rocksdb", type: "rsync" end diff --git a/java/crossbuild/build-linux-centos.sh b/java/crossbuild/build-linux-centos.sh new file mode 100755 index 000000000..55f179b62 --- /dev/null +++ b/java/crossbuild/build-linux-centos.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# install all required packages for rocksdb that are available through yum +ARCH=$(uname -i) +sudo yum -y install java-1.6.0-openjdk-devel.$ARCH zlib zlib-devel bzip2 bzip2-devel + +# install gcc/g++ 4.7 via CERN (http://linux.web.cern.ch/linux/devtoolset/) +sudo wget -O /etc/yum.repos.d/slc5-devtoolset.repo http://linuxsoft.cern.ch/cern/devtoolset/slc5-devtoolset.repo +sudo wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-cern http://ftp.mirrorservice.org/sites/ftp.scientificlinux.org/linux/scientific/51/i386/RPM-GPG-KEYs/RPM-GPG-KEY-cern +sudo yum -y install devtoolset-1.1 +wget http://gflags.googlecode.com/files/gflags-1.6.tar.gz +tar xvfz gflags-1.6.tar.gz; cd gflags-1.6; scl enable devtoolset-1.1 ./configure; scl enable devtoolset-1.1 make; sudo make install +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib + +# set java home so we can build rocksdb jars +export JAVA_HOME=/usr/lib/jvm/java-1.6.0 + +# build rocksdb +cd /rocksdb +scl enable devtoolset-1.1 'make jclean clean' +scl enable devtoolset-1.1 'make -j 4 rocksdbjavastatic' +cp /rocksdb/java/librocksdbjni-* /rocksdb-build +cp /rocksdb/java/rocksdbjni-* /rocksdb-build +