2007-12-04 13:14:30 +00:00
|
|
|
#ident "Copyright (c) 2007 Tokutek Inc. All rights reserved."
|
|
|
|
|
2007-09-19 18:55:08 +00:00
|
|
|
# standard build: make
|
2007-11-29 21:34:11 +00:00
|
|
|
# build with Berkeley DB 4.1: make BDBDIR=/usr/local/BerkeleyDB.4.1
|
|
|
|
# build with TokuDB: make BDBDIR=~/svn/tokudb
|
2007-12-18 16:24:53 +00:00
|
|
|
# build with g++: make CC=g++
|
2007-09-19 18:55:08 +00:00
|
|
|
|
2008-05-13 02:35:50 +00:00
|
|
|
HERE = db-benchmark-test
|
|
|
|
ifeq ($(SUMMARIZE),1)
|
|
|
|
SUMMARIZE_CMD = ;if test $$? = 0; then printf "%-60sPASS\n" $(HERE)/$@; else printf "%-60sFAIL\n" $(HERE)/$@ ; test 0 = 1; fi
|
|
|
|
QUIET = -q
|
|
|
|
else
|
|
|
|
SUMMARIZE_CMD =
|
|
|
|
QUIET =
|
|
|
|
endif
|
|
|
|
|
2007-10-01 21:19:53 +00:00
|
|
|
BENCHDBS = bench.bdb/ bench.tokudb
|
2007-09-19 18:55:08 +00:00
|
|
|
|
2007-11-29 21:34:11 +00:00
|
|
|
OPTFLAGS = -O2
|
2008-03-12 08:30:49 +00:00
|
|
|
CFLAGS = -Wall -Werror -g $(OPTFLAGS) $(GCOV_FLAGS) $(PROF_FLAGS)
|
2007-09-19 18:55:08 +00:00
|
|
|
# CFLAGS += -pg
|
|
|
|
|
2007-11-29 21:34:11 +00:00
|
|
|
ifdef BDBDIR
|
|
|
|
BDB_CPPFLAGS = -I$(BDBDIR)/include
|
|
|
|
BDB_LDFLAGS = -L$(BDBDIR)/lib -ldb -lpthread -Wl,-rpath,$(BDBDIR)/lib
|
2007-09-19 18:55:08 +00:00
|
|
|
else
|
2007-11-29 21:34:11 +00:00
|
|
|
BDB_CPPFLAGS =
|
|
|
|
BDB_LDFLAGS = -ldb
|
2007-09-19 18:55:08 +00:00
|
|
|
endif
|
2008-02-01 14:31:38 +00:00
|
|
|
TDB_CPPFLAGS = -I../include
|
2008-02-27 21:02:31 +00:00
|
|
|
TDB_LDFLAGS = -L../lib -ltokudb -Wl,-rpath,$(PWD)/../lib
|
2007-09-19 18:55:08 +00:00
|
|
|
|
2008-01-23 21:30:20 +00:00
|
|
|
TARGET_BDB = db-benchmark-test-bdb
|
|
|
|
TARGET_TDB = db-benchmark-test-tokudb
|
|
|
|
TARGETS = $(TARGET_BDB) $(TARGET_TDB)
|
2007-09-19 18:55:08 +00:00
|
|
|
|
2008-04-02 23:40:36 +00:00
|
|
|
default: build
|
|
|
|
build: $(TARGETS)
|
2007-09-19 18:55:08 +00:00
|
|
|
|
2008-05-15 13:11:55 +00:00
|
|
|
check: check-default check-xfast check-x
|
2008-01-23 21:30:20 +00:00
|
|
|
|
|
|
|
check-default: $(TARGET_TDB)
|
2008-05-13 02:35:50 +00:00
|
|
|
$(VGRIND) ./$(TARGET_TDB) $(QUIET) $(SUMMARIZE_CMD)
|
2008-01-23 21:30:20 +00:00
|
|
|
|
|
|
|
check-x: $(TARGET_TDB)
|
2008-05-15 13:11:55 +00:00
|
|
|
$(VGRIND) ./$(TARGET_TDB) $(QUIET) -x --xcount 1000 --periter 100000 10 $(SUMMARIZE_CMD)
|
2008-01-23 21:30:20 +00:00
|
|
|
|
2008-02-29 20:49:18 +00:00
|
|
|
|
|
|
|
# A fast transaction test that detects #455.
|
|
|
|
check-xfast: $(TARGET_TDB)
|
2008-05-13 02:35:50 +00:00
|
|
|
./$(TARGET_TDB) $(QUIET) --noserial -x --valsize 1000 --cachesize 8000000 --xcount 1000 --periter 20000 --env xfast.dir 1 $(SUMMARIZE_CMD)
|
2008-02-29 20:49:18 +00:00
|
|
|
|
|
|
|
|
2007-09-19 18:55:08 +00:00
|
|
|
clean:
|
2008-01-18 14:43:32 +00:00
|
|
|
rm -rf $(TARGETS) $(BENCHDBS) *.gcno *.gcda *.gcov
|
2007-10-01 21:19:53 +00:00
|
|
|
|
2008-03-12 08:36:02 +00:00
|
|
|
# A hack to make gprof work. See #515.
|
|
|
|
ifeq ($(PROF_FLAGS),-pg)
|
2008-04-08 15:20:36 +00:00
|
|
|
OFILES = \
|
|
|
|
../src/ydb.o ../src/errors.o ../src/elocks.o \
|
|
|
|
../newbrt/brt.o ../newbrt/brt-serialize.o ../newbrt/brt-verify.o ../newbrt/cachetable.o ../newbrt/fifo.o ../newbrt/key.o ../newbrt/memory.o ../newbrt/mempool.o ../newbrt/gpma.o ../newbrt/leafentry.o ../newbrt/ybt.o ../newbrt/primes.o ../newbrt/log.o ../newbrt/fingerprint.o ../newbrt/log_code.o ../newbrt/roll.o ../newbrt/toku_assert.o ../newbrt/recover.o \
|
|
|
|
../src/lock_tree/locktree.o ../src/lock_tree/rth.o ../src/lock_tree/lth.o ../src/lock_tree/idlth.o ../src/lock_tree/db_id.o \
|
2008-05-17 21:33:07 +00:00
|
|
|
../src/range_tree/rangetree.o
|
2008-03-12 08:36:02 +00:00
|
|
|
db-benchmark-test-tokudb: db-benchmark-test.c
|
|
|
|
$(CC) $(CFLAGS) $(TDB_CPPFLAGS) $(OFILES) -lz $< -o $@ -DDIRSUF=tokudb
|
|
|
|
else
|
2007-10-01 21:19:53 +00:00
|
|
|
db-benchmark-test-tokudb: db-benchmark-test.c
|
2008-02-01 14:31:38 +00:00
|
|
|
$(CC) $(CFLAGS) $(TDB_CPPFLAGS) $(TDB_LDFLAGS) $< -o $@ -DDIRSUF=tokudb
|
2008-03-12 08:36:02 +00:00
|
|
|
endif
|
2007-10-01 21:19:53 +00:00
|
|
|
db-benchmark-test-bdb: db-benchmark-test.c
|
2008-02-01 14:31:38 +00:00
|
|
|
$(CC) $(CFLAGS) $(BDB_CPPFLAGS) $(BDB_LDFLAGS) $< -o $@ -DDIRSUF=bdb
|
2008-05-08 22:50:45 +00:00
|
|
|
|
2008-05-09 02:57:33 +00:00
|
|
|
PARGS =
|
2008-05-08 22:52:59 +00:00
|
|
|
ptest0 ptest1 ptest2 ptest3 ptest4 ptest5 ptest6 ptest7: db-benchmark-test-tokudb
|
2008-05-09 02:57:33 +00:00
|
|
|
./db-benchmark-test-tokudb --env $@.dir $(PARGS)
|
2008-05-08 22:50:45 +00:00
|
|
|
parallel-test-8: ptest0 ptest1 ptest2 ptest3 ptest4 ptest5 ptest6 ptest7
|