From f2bf0b2d1e5cdd588026cec86c681efa7539ce64 Mon Sep 17 00:00:00 2001 From: Adam Retter Date: Fri, 16 Aug 2019 16:25:11 -0700 Subject: [PATCH] Fixes for building RocksJava releases on arm64v8 Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/5674 Differential Revision: D16870338 fbshipit-source-id: c8dac644b1479fa734b491f3a8d50151772290f7 --- Makefile | 15 ++++++++++----- java/crossbuild/docker-build-linux-centos.sh | 6 +++--- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index d8b540fcf..742d8ab79 100644 --- a/Makefile +++ b/Makefile @@ -1696,7 +1696,7 @@ JAVA_INCLUDE = -I$(JAVA_HOME)/include/ -I$(JAVA_HOME)/include/linux ifeq ($(PLATFORM), OS_SOLARIS) ARCH := $(shell isainfo -b) else ifeq ($(PLATFORM), OS_OPENBSD) - ifneq (,$(filter $(MACHINE), amd64 arm64 sparc64 aarch64)) + ifneq (,$(filter $(MACHINE), amd64 arm64 aarch64 sparc64)) ARCH := 64 else ARCH := 32 @@ -1705,14 +1705,11 @@ else ARCH := $(shell getconf LONG_BIT) endif -ifeq (,$(findstring ppc,$(MACHINE))) +ifeq (,$(filter $(MACHINE), ppc arm64 aarch64 sparc64)) ROCKSDBJNILIB = librocksdbjni-linux$(ARCH).so else ROCKSDBJNILIB = librocksdbjni-linux-$(MACHINE).so endif -ifneq (,$(findstring aarch64,$(MACHINE))) - ROCKSDBJNILIB = librocksdbjni-linux-$(MACHINE).so -endif ROCKSDB_JAR = rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-linux$(ARCH).jar ROCKSDB_JAR_ALL = rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH).jar ROCKSDB_JAVADOCS_JAR = rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-javadoc.jar @@ -1909,6 +1906,14 @@ rocksdbjavastaticdockerppc64le: mkdir -p java/target docker run --rm --name rocksdb_linux_ppc64le-be --attach stdin --attach stdout --attach stderr --volume `pwd`:/rocksdb-host --env DEBUG_LEVEL=$(DEBUG_LEVEL) evolvedbinary/rocksjava:centos7_ppc64le-be /rocksdb-host/java/crossbuild/docker-build-linux-centos.sh +rocksdbjavastaticdockerarm64v8: + mkdir -p java/target + DOCKER_LINUX_ARM64V8_CONTAINER=`docker ps -aqf name=rocksdb_linux_arm64v8-be`; \ + if [ -z "$$DOCKER_LINUX_ARM64V8_CONTAINER" ]; then \ + docker container create --attach stdin --attach stdout --attach stderr --volume `pwd`:/rocksdb-host --name rocksdb_linux_arm64v8-be evolvedbinary/rocksjava:centos7_arm64v8-be /rocksdb-host/java/crossbuild/docker-build-linux-centos.sh; \ + fi + docker start -a rocksdb_linux_arm64v8-be + rocksdbjavastaticpublish: rocksdbjavastaticrelease rocksdbjavastaticpublishcentral rocksdbjavastaticpublishdocker: rocksdbjavastaticreleasedocker rocksdbjavastaticpublishcentral diff --git a/java/crossbuild/docker-build-linux-centos.sh b/java/crossbuild/docker-build-linux-centos.sh index aedcb8af7..68ee610cb 100755 --- a/java/crossbuild/docker-build-linux-centos.sh +++ b/java/crossbuild/docker-build-linux-centos.sh @@ -12,17 +12,17 @@ cd /rocksdb-local if hash scl 2>/dev/null; then if scl --list | grep -q 'devtoolset-7'; then scl enable devtoolset-7 'make jclean clean' - scl enable devtoolset-7 'PORTABLE=1 make -j6 rocksdbjavastatic' + scl enable devtoolset-7 'PORTABLE=1 make -j2 rocksdbjavastatic' elif scl --list | grep -q 'devtoolset-2'; then scl enable devtoolset-2 'make jclean clean' - scl enable devtoolset-2 'PORTABLE=1 make -j6 rocksdbjavastatic' + scl enable devtoolset-2 'PORTABLE=1 make -j2 rocksdbjavastatic' else echo "Could not find devtoolset" exit 1; fi else make jclean clean - PORTABLE=1 make -j6 rocksdbjavastatic + PORTABLE=1 make -j2 rocksdbjavastatic fi cp java/target/librocksdbjni-linux*.so java/target/rocksdbjni-*-linux*.jar /rocksdb-host/java/target