Skip to content

Instantly share code, notes, and snippets.

@dereneaton
Last active December 3, 2016 18:46
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/527b87488eede7b670222640fe26878d to your computer and use it in GitHub Desktop.
Save dereneaton/527b87488eede7b670222640fe26878d to your computer and use it in GitHub Desktop.
Download and install iBPP (v.2.1) into ~/local/src/iBPP/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
REPODIR="./iBPP"
REPO="https://github.com/cecileane/iBPP.git"
if [ ! -d $REPODIR ]
then
git clone $REPO $REPODIR
cd $REPODIR/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 ibpp -O3 bpp.c tools.c -lm
gcc -o ibpp-simul -DSIMULATION -O3 bpp.c tools.c -lm
else
cd $REPODIR/src
## done
fi
## print the location of your bpp binary and success of installation
success=$(2>&1 ./ibpp ../)
if [[ $success == *"integrated with traits"* ]]
then
(>&2 echo "Hoorah, iBPP was successfully installed here: $(pwd)/ibpp")
(>&2 echo "Be sure to call it by entering the full path to the binary above.")
## copy binary to local bins
cp ./ibpp ~/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