Skip to content

Instantly share code, notes, and snippets.

@ctbarna
Created September 22, 2011 23:51
Show Gist options
  • Save ctbarna/1236387 to your computer and use it in GitHub Desktop.
Save ctbarna/1236387 to your computer and use it in GitHub Desktop.
# Shell script to install PARI/GP
VERSION=2.5.0
URL=http://pari.math.u-bordeaux.fr/pub/pari/unix/pari-$VERSION.tar.gz
DATE=`date +%s`
# Credit to http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in
DIR="$( cd "$( dirname "$0" )" && pwd )"
mkdir $DIR/tmp$DATE
cd $DIR/tmp$DATE
trap 'echo "Cleaning up..."; cd $DIR; rm -rf tmp$DATE' 0 2 3
echo "Downloading $URL..."
curl -C - -O $URL
echo "Unpacking pari-$VERSION.tar.gz"
tar -xzf pari-$VERSION.tar.gz
cd pari-$VERSION
echo "Configuring pari-$VERSION"
./Configure
echo "Building and installing pari-$VERSION. Enter your password."
sudo make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment