Skip to content

Instantly share code, notes, and snippets.

@matthiasdiener
Last active April 24, 2019 01:10
Show Gist options
  • Save matthiasdiener/335fefd33be707c532a919a2971d6b86 to your computer and use it in GitHub Desktop.
Save matthiasdiener/335fefd33be707c532a919a2971d6b86 to your computer and use it in GitHub Desktop.
[OUTDATED] Installation script for rustup/rust on RHEL 7/CentOS 7 PowerPC (ppc64le) (the precompiled rustup binaries do not work on these systems)
#!/bin/bash
set -o nounset -o errexit
# Make sure we are running on ppc64le. If not, need to adjust the URLs below
[[ $(arch) == "ppc64le" ]] || { echo "This script needs to be run on ppc64le, not $(arch)."; exit 1; }
rm -rf rustinst/
mkdir rustinst
cd rustinst
# Download a basic rust installation
wget -c http://www.rpmfind.net/linux/epel/7/ppc64le/Packages/r/rust-1.32.0-1.el7.ppc64le.rpm
wget -c http://www.rpmfind.net/linux/epel/7/ppc64le/Packages/r/rust-std-static-1.32.0-1.el7.ppc64le.rpm
wget -c http://www.rpmfind.net/linux/epel/7/ppc64le/Packages/c/cargo-1.32.0-1.el7.ppc64le.rpm
wget -c http://www.rpmfind.net/linux/epel/7/ppc64le/Packages/l/llvm5.0-libs-5.0.1-7.el7.ppc64le.rpm
# Extract RPMs
for f in *.rpm; do
rpm2cpio $f | cpio -idmv
done
# Get rustup
wget -c https://github.com/rust-lang/rustup.rs/archive/1.16.0.tar.gz
tar xf 1.16.0.tar.gz
cd rustup.rs-1.16.0/
# Compile and run rustup
PATH=$(pwd)/../usr/bin/:$PATH \
LD_LIBRARY_PATH=$(pwd)/../usr/lib64:$(pwd)/../usr/lib64/llvm5.0/lib/:$LD_LIBRARY_PATH \
cargo run --release -- -y # Need -y to avoid rustup finding the basic rust installation above and exiting
# Remove everything if installation successful (ensured by the -o errexit above)
cd ../..
rm -rf rustinst
@matthiasdiener
Copy link
Author

This script is not necessary anymore since rustup 1.18 integrated a fix for ppc64le (rust-lang/rustup#1681)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment