Compiling TPC-H tools for Mac

Download TPC-H Tools
http://www.tpc.org/tpch/
1 modify the Makefile
Unzip the TPCH file and enter the dbgen directory.
cp makefile.suite makefile
Open the Makefile, find and modify the following lines (103~111)

################
## CHANGE NAME OF ANSI COMPILER HERE
################
CC      = gcc 
# Current values for DATABASE are: INFORMIX, DB2, TDAT (Teradata)
#                                  SQLSERVER, SYBASE, ORACLE, VECTORWISE
# Current values for MACHINE are:  ATT, DOS, HP, IBM, ICL, MVS, 
#                                  SGI, SUN, U2200, VMS, LINUX, WIN32 
# Current values for WORKLOAD are:  TPCH
DATABASE= SQLSERVER
MACHINE = LINUX
WORKLOAD = TPCH

2 compile
make
Because my computer is a Mac, I made an error compiling DBgen:

bm_utils.c:71:10: fatal error: 'malloc.h' file not found
#include <malloc.h>
         ^~~~~~~~~~
1 error generated.
make: *** [bm_utils.o] Error 1  # varsub.o

In the file where the error will be reported:

#include <malloc.h>

Modified to

#include <sys/malloc.h>

Done.
3 Generating data
./dbgen -s 1 -f
Convert.tbl data into CSV:
for I in 'ls *. TBL'; do sed 's/|$//' $i > ${i/tbl/csv}; echo $i; done;
4 Generate query data

Open failed for./1. SQL at qgen. C :170
Environment variable needs to be set: export DSS_QUERY=PATH_TO_QUERIES_FOLDER
generally, type export DSS_QUERY=queries


Mac does not have vmstat. Change vmstat in TpCH.sh to VM_stat

Read More: