Created
February 13, 2017 23:07
-
-
Save dereneaton/6a833bf9e67e5b3c33fecc51ff052978 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## save our current directory so we can return to it | |
CURDIR=$(pwd) | |
## find the path to our conda bin dir (this _should_ be in our PATH) | |
CONDADIR=$(which conda) | |
CONDABIN=$(dirname $CONDADIR) | |
CONDAPKG=$(dirname $CONDABIN)/pkgs | |
## download bpp source into the conda pkgs dir | |
cd $CONDAPKG/ | |
## 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 | |
mv ./ibpp $CONDABIN/ | |
(>&2 echo "Hoorah, iBPP was successfully installed here: $CONDABIN/ibpp") | |
(>&2 echo "Be sure to call it by entering the full path to the binary above.") | |
else | |
(>&2 echo "installation failed -- uncomment '2>/dev/null' to see errors. ") | |
fi | |
## cd back home, even though jupyter would do this anyways | |
cd $CURDIR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment