source: trunk/GDE/SATIVA/arb_raxml8_sativa.sh

Last change on this file was 13046, checked in by akozlov, 10 years ago
  • do not rely on symlinks for calling raxml and setting temp dir anymore
  • small bugfixes
File size: 936 bytes
Line 
1#!/bin/bash
2set -e
3
4# return true if argument is file in path executable by user
5can_run() {
6    which "$1" && test -x `which "$1"`
7}
8
9# show error in ARB and exit
10report_error() {
11    SELF=`basename "$0"`
12    echo "ARB ERROR: $*"
13    arb_message "$SELF failed with: $*"
14}
15
16cpu_has_feature() {
17    case `uname` in
18        Darwin)
19            SHOW="sysctl machdep.cpu.features"
20            ;;
21        Linux)
22            SHOW="grep flags /proc/cpuinfo"
23            ;;
24    esac
25    $SHOW | grep -qi "$1"
26}
27
28###### main #####
29
30# select RAxML binary
31RAXML_STEM=raxmlHPC8-sativa
32if cpu_has_feature avx && can_run ${RAXML_STEM}-AVX.PTHREADS; then
33    RAXML=${RAXML_STEM}-AVX.PTHREADS
34elif cpu_has_feature sse3 && can_run ${RAXML_STEM}-SSE3.PTHREADS; then
35    RAXML=${RAXML_STEM}-SSE3.PTHREADS
36elif can_run ${RAXML_STEM}-PTHREADS; then
37    RAXML=${RAXML_STEM}-PTHREADS
38else
39    report_error Could not find working RAxML binary.
40fi
41
42$RAXML $@
43
Note: See TracBrowser for help on using the repository browser.