Commit e686da79 by Ramana Radhakrishnan Committed by Tianqi Chen

Support additional architectures beyond x86_64 in ubuntu_install_java (#3546)

* Support additional architectures beyond x86_64 in ubuntu_install_java

While attempting to get a development environment going for TVM
on my AArch64 desktop I ran into some hardcoding of relevant architectures.
parent 6b669bfa
...@@ -20,5 +20,23 @@ set -o errexit -o nounset ...@@ -20,5 +20,23 @@ set -o errexit -o nounset
set -o pipefail set -o pipefail
apt-get update && apt-get install -y openjdk-8-jdk maven apt-get update && apt-get install -y openjdk-8-jdk maven
test -d "/usr/lib/jvm/java-8-openjdk-amd64/jre" arch=$(uname -m)
echo "export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre" >> /etc/profile jre_arch="unknown"
case $arch in
'x86_64')
jre_arch="amd64"
;;
'aarch64')
jre_arch="arm64"
;;
default)
echo "Unknown architecture $arch" >&2
exit 1
;;
esac
if [ ! -d "/usr/lib/jvm/java-8-openjdk-$jre_arch/jre" ]; then
echo "error: missing openjdk for $jre_arch" >&2
exit 1
fi
echo "export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-$jre_arch/jre" >> /etc/profile
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment