Last active
September 12, 2018 17:25
-
-
Save dereneaton/5fe28d14c69c786c76d144c85a794fdc to your computer and use it in GitHub Desktop.
Install bpp 3.3 into your conda dir
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/ | |
curl -LkO http://abacus.gene.ucl.ac.uk/software/bpp3.3.tgz 2>/dev/null | |
tar -xf bpp3.3.tgz | |
rm bpp3.3.tgz | |
## ensure permissions of src files, and cd to src/ | |
chmod -R +rwx bpp3.3/ | |
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 | |
## comment this out if you do not have AVX | |
gcc -o bpp_avx -O3 -DUSE_AVX -mavx bpp.c tools.c -lm 2>/dev/null | |
## build mccoal | |
gcc -o MCcoal -DSIMULATION 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 | |
## move to conda bin | |
mv ./bpp $CONDABIN/ | |
mv ./bpp_avx $CONDABIN/ | |
mv ./MCcoal $CONDABIN/ | |
(>&2 echo "Hoorah, bp&p was successfully installed in: $CONDABIN/bpp") | |
else | |
(>&2 echo "installation failed -- uncomment '2>/dev/null' to see errors. ") | |
fi | |
cd $CURDIR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment