diff --git a/config.h b/config.h index 4e74b2c..1d0273a 100644 --- a/config.h +++ b/config.h @@ -147,6 +147,18 @@ #define RNG_C 1ull #endif /* LINUX */ +#ifdef MAC +#define _POSIX_C_SOURCE 200112L +#define _POSIX_SOURCE +#define STDLIB_HAS_GETOPT +#define SUPPORT_64BITS +#define DSS_HUGE long +#define HUGE_FORMAT "%ld" +#define HUGE_DATE_FORMAT "%02ld" +#define RNG_A 6364136223846793005ull +#define RNG_C 1ull +#endif /* MAC */ + #ifdef SUN #define STDLIB_HAS_GETOPT #define RNG_A 6364136223846793005ull diff --git a/driver.c b/driver.c index 7904439..a3bc3e5 100644 --- a/driver.c +++ b/driver.c @@ -425,7 +425,7 @@ partial (int tbl, int s) if (verbose > 0) { - fprintf (stderr, "\tStarting to load stage %d of %d for %s...", + fprintf (stderr, "\tStarting to load stage %d of %ld for %s...", s, children, tdefs[tbl].comment); } @@ -751,7 +751,7 @@ main (int ac, char **av) { if (verbose > 0) fprintf (stderr, - "Generating update pair #%d for %s", + "Generating update pair #%ld for %s", upd_num + 1, tdefs[ORDER_LINE].comment); insert_orders_segment=0; insert_lineitem_segment=0; diff --git a/dss.h b/dss.h index 96c9f58..d9394f1 100644 --- a/dss.h +++ b/dss.h @@ -484,7 +484,7 @@ int dbg_print(int dt, FILE *tgt, void *data, int len, int eol); sprintf(tgt, "%02d-%02d-19%02d", mn, dy, yr) #else #define PR_DATE(tgt, yr, mn, dy) \ -sprintf(tgt, "19%02d-%02d-%02d", yr, mn, dy) +sprintf(tgt, "19%02ld-%02ld-%02ld", yr, mn, dy) #endif /* DATE_FORMAT */ /* diff --git a/makefile b/makefile new file mode 100644 index 0000000..b72d51a --- /dev/null +++ b/makefile @@ -0,0 +1,198 @@ +# +# $Id: makefile.suite,v 1.25 2009/10/22 19:10:21 jms Exp $ +# +# Revision History +# =================== +# $Log: makefile.suite,v $ +# Revision 1.25 2009/10/22 19:10:21 jms +# update revision to 2.9.0, disable bug55 fix +# +# Revision 1.24 2009/10/22 19:06:10 jms +# update revision to 2.9.0, disable bug55 fix +# +# Revision 1.23 2009/06/28 14:01:08 jms +# bug fix for DOP +# +# Revision 1.22 2008/09/15 16:37:46 jms +# release 2.8.0 makefile.suite +# +# Revision 1.21 2008/03/21 18:26:54 jms +# recursive zip for reference data, chmod for update_release +# +# Revision 1.20 2008/03/21 17:38:39 jms +# changes for 2.6.3 +# +# Revision 1.19 2007/03/08 20:36:03 jms +# update release number to 2.6.1 +# +# Revision 1.18 2007/02/06 18:15:56 jms +# remove update release from general target +# +# Revision 1.17 2007/01/25 19:35:50 jms +# add sln file used by VS2005 +# +# Revision 1.16 2007/01/05 20:05:41 jms +# update release number +# +# Revision 1.15 2006/09/07 17:25:57 jms +# correct dss.ddl +# +# Revision 1.14 2006/08/01 17:21:22 jms +# fix bad merge +# +# Revision 1.13 2006/08/01 16:55:44 jms +# move to 2.4.1 +# +# Revision 1.12 2006/06/29 20:46:17 jms +# 2.4.0 changes from Meikel +# +# Revision 1.10 2006/05/25 22:30:44 jms +# qgen porting for 32b/64b +# +# Revision 1.9 2006/04/26 23:17:09 jms +# checking release.h prior to release build +# +# Revision 1.8 2006/04/26 23:03:00 jms +# release 2.3.4-1 +# +# Revision 1.7 2006/04/12 18:13:58 jms +# release 2.3.3 +# +# Revision 1.6 2006/03/09 18:59:19 jms +# move to version 2.3.2 +# +# Revision 1.5 2006/01/28 23:54:32 jms +# add reference data to release +# +# Revision 1.4 2005/10/28 03:00:32 jms +# fix release target +# +# Revision 1.3 2005/10/28 02:54:14 jms +# increment build count with each release creation +# +# Revision 1.2 2005/01/03 20:08:58 jms +# change line terminations +# +# Revision 1.1.1.1 2004/11/24 23:31:47 jms +# re-establish external server +# +# Revision 1.5 2004/03/26 20:39:23 jms +# add tpch tag to release files +# +# Revision 1.4 2004/03/16 14:45:57 jms +# correct release target in makefile +# +# Revision 1.3 2004/03/02 20:49:01 jms +# simplify distributions, add Windows IDE files +# releases should use make release from now on +# +# Revision 1.2 2004/02/18 14:05:53 jms +# porting changes for LINUX and 64 bit RNG +# +# Revision 1.1.1.1 2003/04/03 18:54:21 jms +# recreation after CVS crash +# +# Revision 1.1.1.1 2003/04/03 18:54:21 jms +# initial checkin +# +# +# +################ +## CHANGE NAME OF ANSI COMPILER HERE +################ +CC = gcc +# Current values for DATABASE are: INFORMIX, DB2, TDAT (Teradata) +# SQLSERVER, SYBASE, ORACLE +# Current values for MACHINE are: ATT, DOS, HP, IBM, ICL, MVS, +# SGI, SUN, U2200, VMS, LINUX, WIN32 +# Current values for WORKLOAD are: TPCH +DATABASE= ORACLE +MACHINE = MAC +WORKLOAD = TPCH +# +CFLAGS = -g -DDBNAME=\"dss\" -D$(MACHINE) -D$(DATABASE) -D$(WORKLOAD) -DRNG_TEST -D_FILE_OFFSET_BITS=64 +LDFLAGS = -O +# The OBJ,EXE and LIB macros will need to be changed for compilation under +# Windows NT +OBJ = .o +EXE = +LIBS = -lm +# +# NO CHANGES SHOULD BE NECESSARY BELOW THIS LINE +############### +VERSION=2 +RELEASE=13 +PATCH=0 +BUILD=`grep BUILD release.h | cut -f3 -d' '` +NEW_BUILD=`expr ${BUILD} + 1` +TREE_ROOT=/tmp/tree +# +PROG1 = dbgen$(EXE) +PROG2 = qgen$(EXE) +PROGS = $(PROG1) $(PROG2) +# +HDR1 = dss.h rnd.h config.h dsstypes.h shared.h bcd2.h rng64.h release.h +HDR2 = tpcd.h permute.h +HDR = $(HDR1) $(HDR2) +# +SRC1 = build.c driver.c bm_utils.c rnd.c print.c load_stub.c bcd2.c \ + speed_seed.c text.c permute.c rng64.c +SRC2 = qgen.c varsub.c +SRC = $(SRC1) $(SRC2) +# +OBJ1 = build$(OBJ) driver$(OBJ) bm_utils$(OBJ) rnd$(OBJ) print$(OBJ) \ + load_stub$(OBJ) bcd2$(OBJ) speed_seed$(OBJ) text$(OBJ) permute$(OBJ) \ + rng64$(OBJ) +OBJ2 = build$(OBJ) bm_utils$(OBJ) qgen$(OBJ) rnd$(OBJ) varsub$(OBJ) \ + text$(OBJ) bcd2$(OBJ) permute$(OBJ) speed_seed$(OBJ) rng64$(OBJ) +OBJS = $(OBJ1) $(OBJ2) +# +SETS = dists.dss +DOC=README HISTORY PORTING.NOTES BUGS +DDL = dss.ddl dss.ri +WINDOWS_IDE = tpch.dsw dbgen.dsp tpch.sln tpch.vcproj qgen.vcproj +OTHER=makefile.suite $(SETS) $(DDL) $(WINDOWS_IDE) +# case is *important* in TEST_RES +TEST_RES = O.res L.res c.res s.res P.res S.res n.res r.res +# +DBGENSRC=$(SRC1) $(HDR1) $(OTHER) $(DOC) $(SRC2) $(HDR2) $(SRC3) +FQD=queries/1.sql queries/2.sql queries/3.sql queries/4.sql queries/5.sql queries/6.sql queries/7.sql \ + queries/8.sql queries/9.sql queries/10.sql queries/11.sql queries/12.sql queries/13.sql \ + queries/14.sql queries/15.sql queries/16.sql queries/17.sql queries/18.sql queries/19.sql queries/20.sql \ + queries/21.sql queries/22.sql +VARIANTS= variants/8a.sql variants/12a.sql variants/13a.sql variants/14a.sql variants/15a.sql +ANS = answers/q1.out answers/q2.out answers/q3.out answers/q4.out answers/q5.out answers/q6.out answers/q7.out answers/q8.out \ + answers/q9.out answers/q10.out answers/q11.out answers/q12.out answers/q13.out answers/q14.out answers/q15.out \ + answers/q16.out answers/q17.out answers/q18.out answers/q19.out answers/q20.out answers/q21.out answers/q22.out +QSRC = $(FQD) $(VARIANTS) $(ANS) +TREE_DOC=tree.readme tree.changes appendix.readme appendix.version answers.readme queries.readme variants.readme +REFERENCE=reference/[tcR]* +REFERENCE_DATA=referenceData/[13]* +SCRIPTS= check55.sh column_split.sh dop.sh gen_tasks.sh last_row.sh load_balance.sh new55.sh check_dirs.sh +ALLSRC=$(DBGENSRC) $(REFERENCE) $(QSRC) $(SCRIPTS) +JUNK = +# +all: $(PROGS) +$(PROG1): $(OBJ1) $(SETS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ1) $(LIBS) +$(PROG2): permute.h $(OBJ2) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ2) $(LIBS) +clean: + rm -f $(PROGS) $(OBJS) $(JUNK) +lint: + lint $(CFLAGS) -u -x -wO -Ma -p $(SRC1) + lint $(CFLAGS) -u -x -wO -Ma -p $(SRC2) + +tar: $(ALLSRC) + tar cvhf - $(ALLSRC) --exclude .svn\*/\* |gzip - > tpch_${VERSION}_${RELEASE}_${PATCH}.tar.gz + tar cvhf - $(REFERENCE_DATA) --exclude .svn\*/\* |gzip - > reference_${VERSION}_${RELEASE}_${PATCH}.tar.gz +zip: $(ALLSRC) + zip -r tpch_${VERSION}_${RELEASE}_${PATCH}.zip $(ALLSRC) -x *.svn* + zip -r reference_${VERSION}_${RELEASE}_${PATCH}.zip $(REFERENCE_DATA) -x *.svn* +release: + make -f makefile.suite tar + make -f makefile.suite zip + ( cd tests; sh test_list.sh `date '+%Y%m%d'` ) +rnd$(OBJ): rnd.h +$(OBJ1): $(HDR1) +$(OBJ2): dss.h tpcd.h config.h rng64.h release.h diff --git a/print.c b/print.c index 97044f9..95b4511 100644 --- a/print.c +++ b/print.c @@ -135,7 +135,7 @@ dbg_print(int format, FILE *target, void *data, int len, int sep) } dollars = cents / 100; cents %= 100; - fprintf(target, "%ld.%02ld", dollars, cents); + fprintf(target, "%d.%02d", dollars, cents); break; case DT_CHR: fprintf(target, "%c", *(char *)data); diff --git a/qgen.c b/qgen.c index 0bd138c..8a098cb 100644 --- a/qgen.c +++ b/qgen.c @@ -453,14 +453,14 @@ int main(int ac, char **av) for (i=optind; i < ac; i++) { char qname[10]; - sprintf(qname, "%d", SEQUENCE(snum, atoi(av[i]))); + sprintf(qname, "%ld", SEQUENCE(snum, atoi(av[i]))); qsub(qname, flags); } else for (i=1; i <= QUERIES_PER_SET; i++) { char qname[10]; - sprintf(qname, "%d", SEQUENCE(snum, i)); + sprintf(qname, "%ld", SEQUENCE(snum, i)); qsub(qname, flags); } else diff --git a/rnd.c b/rnd.c index 4655f4c..09e8966 100644 --- a/rnd.c +++ b/rnd.c @@ -72,7 +72,7 @@ #include "config.h" #include #include -#ifdef LINUX +#if (defined(LINUX)||defined(_POSIX_SOURCE)) #include #endif #ifdef IBM @@ -128,7 +128,7 @@ row_stop(int t) \ { if (set_seeds && (Seed[i].usage > Seed[i].boundary)) { - fprintf(stderr, "\nSEED CHANGE: seed[%d].usage = %d\n", + fprintf(stderr, "\nSEED CHANGE: seed[%d].usage = %ld\n", i, Seed[i].usage); Seed[i].boundary = Seed[i].usage; } diff --git a/varsub.c b/varsub.c index a3bd1fa..a336a95 100644 --- a/varsub.c +++ b/varsub.c @@ -39,6 +39,7 @@ * * */ +#include "config.h" #include #ifndef _POSIX_SOURCE #include