Skip to content

Instantly share code, notes, and snippets.

@dereneaton
Last active December 3, 2016 18:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dereneaton/73a377c643adaddc83635506a81180af to your computer and use it in GitHub Desktop.
Save dereneaton/73a377c643adaddc83635506a81180af to your computer and use it in GitHub Desktop.
Download and install bpp (v.3.3) locally (into ~/local/src/bpp/src)
## save our current directory so we can come back here when we're done
WORKDIR=$(pwd)
## To install local software I keep a directory in my home dir called 'local/'
## the command below will make this dir if it does not already exist.
mkdir -p ~/local/src/
## move into your local/src directory
cd ~/local/src
## download the file here, since this is where you store source code
curl -LkO http://abacus.gene.ucl.ac.uk/software/bpp3.3.tgz 2>/dev/null
## unpack the archive file and remove the download file
tar -xf bpp3.3.tgz
rm bpp3.3.tgz
## cd into the new bpp directory, and into its src/ directory
cd bpp3.3/src
## compile to create a binary executable called 'bpp'
## if you are on a HPC cluster you _may_ need to load the gcc compiler.
## if you want to suppress the warnings add '2>/dev/null` to the end.
gcc -o bpp -O3 bpp.c tools.c -lm 2>/dev/null
## print the location of your bpp binary and success of installation
success=$(2>&1 ./bpp ../)
if [[ $success == *"bp&p"* ]]
then
(>&2 echo "Hoorah, bp&p was successfully installed here: $(pwd)/bpp")
(>&2 echo "Be sure to call it by entering the full path to the binary above.")
## copy the binary to local bins
cp ./bpp ~/local/bin/
else
(>&2 echo "installation failed -- uncomment '2>/dev/null' to see errors. ")
fi
## cd back home, even though jupyter would do this anyways
cd $WORKDIR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment