Add simple NTO viewer
[dormin.git] / tbs
blob465b767c1a2861d83667f5969bb1600f409d2c34
1 #!/bin/sh
3 #set -x
4 set -e
6 h=$(readlink -f $(dirname $0))
7 r=$(readlink -f $h/../..)
8 t=$r/tbs
9 d=MD5
11 export OCAMLRUNPARAM=b
13 if test $h = $PWD; then
14 mkdir -p build
15 cd build
18 if ! md5sum --status -c $d; then
19 md5sum $h/build.ml $h/tbs $t/tbs.cma >$d.tmp
20 ocamlc.opt -o build.cmo -c -g -I $t $h/build.ml
21 ocamlc.opt -g -thread -I $t unix.cma threads.cma tbs.cma build.cmo -o b
22 mv $d.tmp $d
25 #altivec=false
27 case $(hostname) in
28 laptop)
29 cc="gcc-4.3.0"
30 ccopt="-Wall -Werror -Wextra -Wno-unused-function"
31 ccopt="$ccopt -O3 -march=athlon64 -mtune=athlon64 -fprefetch-loop-arrays"
32 # ccopt="$ccopt -mfpmath=sse"
33 ccopt="$ccopt -DTIMING"
36 linmac)
37 cc="$HOME/x/dev/gcc-4.3.0/bin/gcc";
38 #cc=gcc-4.4.1
39 ccopt="-Wall -Werror -Wextra -O3 -Wno-unused-function"
40 ccopt="$ccopt -DTIMING"
41 if $altivec; then
42 ccopt="$ccopt -mcpu=G4 -fno-unit-at-a-time -mtune=power6"
43 ccopt="$ccopt -fprefetch-loop-arrays"
44 ccopt="$ccopt -DG4 -DUSE_ALTIVEC"
45 #ccopt="$ccopt -fprofile-generate"
46 #ccopt="$ccopt -fprofile-use"
47 # ccopt="$ccopt -O0 -g -Wno-unused"
48 else
49 ccopt="$ccopt -fprefetch-loop-arrays -mtune=power6 -mcpu=G4"
50 ccopt="$ccopt -ftree-loop-linear -ftree-vectorize"
51 ccopt="$ccopt --param l1-cache-line-size=32"
55 ps3)
56 cc="gcc-4.3.1 -m32";
57 ccopt="-Wall -Werror -Wextra -O3 -Wno-unused-function";
58 ccopt="$ccopt -fprefetch-loop-arrays -mtune=power6 -mcpu=cell"
59 ccopt="$ccopt --param l1-cache-line-size=128"
60 ccopt="$ccopt -DTIMING"
61 if $altivec; then
62 ccopt="$ccopt -DUSE_ALTIVEC"
63 else
64 ccopt="$ccopt -ftree-loop-linear -ftree-vectorize"
69 cc=cc
70 ccopt=-O2
72 esac
74 targets="dormin imgv"
75 ./b -O src:$h -r -O ccopt:"$ccopt" -O cc:"$cc" $* $targets