go.sh scripts of several benchmarks modified to pick up $CC, $CFLAGS, $CXXFLAGS,...
[phoronix-static.git] / pgbench / go.sh
blob8e50f4db370e9b0c33334915f9c09412c7eee0b5
1 #!/bin/bash -x
3 # Copyright (C) 2011 Sebastian Pop <sebpop@gmail.com>.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details. A copy of this license
13 # can be downloaded from http://www.gnu.org/copyleft/gpl.html
15 p=`pwd`
16 rm -rf usr postgresql-9.0.1
17 mkdir -p usr
18 tar -xjf postgresql-9.0.1.tar.bz2
19 sed -i -e 's/__FAST_MATH__/foo_bar/g' $p/postgresql-9.0.1/configure
20 sed -i -e 's/__FAST_MATH__/foo_bar/g' $p/postgresql-9.0.1/src/backend/utils/adt/date.c
21 sed -i -e 's/__FAST_MATH__/foo_bar/g' $p/postgresql-9.0.1/src/backend/utils/adt/timestamp.c
22 sed -i -e 's/__FAST_MATH__/foo_bar/g' $p/postgresql-9.0.1/src/interfaces/ecpg/pgtypeslib/interval.c
23 sed -i -e 's/__FAST_MATH__/foo_bar/g' $p/postgresql-9.0.1/src/interfaces/ecpg/pgtypeslib/timestamp.c
24 cd postgresql-9.0.1
25 ./configure --prefix=$p/usr --datadir=$p/usr/data --without-readline --without-zlib
26 make -j $procs CFLAGS="$CFLAGS"
27 make -C contrib/pgbench all
28 make install
29 make -C contrib/pgbench install
30 $p/usr/bin/initdb -D $p/usr/data/db --encoding=SQL_ASCII --locale=C
31 export PGDATA=$p/usr/data/db/
32 export PGPORT=7777
33 $p/usr/bin/pg_ctl start -o '-c checkpoint_segments=8 -c autovacuum=false'
34 sleep 30
35 $p/usr/bin/createdb pgbench
36 $p/usr/bin/pgbench -i -s $procs pgbench
37 sleep 10
38 before=`date +%s.%N`
39 $p/usr/bin/pgbench -t 30000 -c `expr $procs / 2` pgbench > $p/log
40 after=`date +%s.%N`
41 echo "pgbench run time: `echo "$after - $before" | bc`" >> $p/log
42 $p/usr/bin/dropdb pgbench
43 $p/usr/bin/pg_ctl stop
44 cd $p; rm -rf usr postgresql-9.0.1