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 |
---|
2 | set -e |
---|
3 | |
---|
4 | # return true if argument is file in path executable by user |
---|
5 | can_run() { |
---|
6 | which "$1" && test -x `which "$1"` |
---|
7 | } |
---|
8 | |
---|
9 | # show error in ARB and exit |
---|
10 | report_error() { |
---|
11 | SELF=`basename "$0"` |
---|
12 | echo "ARB ERROR: $*" |
---|
13 | arb_message "$SELF failed with: $*" |
---|
14 | } |
---|
15 | |
---|
16 | cpu_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 |
---|
31 | RAXML_STEM=raxmlHPC8-sativa |
---|
32 | if cpu_has_feature avx && can_run ${RAXML_STEM}-AVX.PTHREADS; then |
---|
33 | RAXML=${RAXML_STEM}-AVX.PTHREADS |
---|
34 | elif cpu_has_feature sse3 && can_run ${RAXML_STEM}-SSE3.PTHREADS; then |
---|
35 | RAXML=${RAXML_STEM}-SSE3.PTHREADS |
---|
36 | elif can_run ${RAXML_STEM}-PTHREADS; then |
---|
37 | RAXML=${RAXML_STEM}-PTHREADS |
---|
38 | else |
---|
39 | report_error Could not find working RAxML binary. |
---|
40 | fi |
---|
41 | |
---|
42 | $RAXML $@ |
---|
43 | |
---|
Note: See
TracBrowser
for help on using the repository browser.