Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2009
    Posts
    1

    Unanswered: Error while building DBGEN and QGEN for postgres on linux

    Hi,

    I am trying to build DBGEN and QGEN for postgres 8.2 on linux.
    I downloaded setup from TPC-H .
    I created makefile using makefile.suite. Changes in makefile is as follows :

    Code:
    ################
    ## CHANGE NAME OF ANSI COMPILER HERE
    ################
    CC      = gcc
    # Current values for DATABASE are: INFORMIX, DB2, TDAT (Teradata)
    #                                  SQLSERVER, SYBASE
    # Current values for MACHINE are:  ATT, DOS, HP, IBM, ICL, MVS,
    #                                  SGI, SUN, U2200, VMS, LINUX, WIN32
    # Current values for WORKLOAD are:  TPCH
    
    DATABASE= PostgreSQL
    MACHINE = LINUX
    WORKLOAD = TPCH
    Then I tried to compile using makefile it gives error as follows :


    Code:
    [root@XXXXXXXXX tpch]# make
    chmod 755 update_release.sh
    ./update_release.sh 2 8 0
    gcc  -O -DDBNAME=\"dss\" -DLINUX -DPostgreSQL -DTPCH    -c -o build.o build.c
    gcc  -O -DDBNAME=\"dss\" -DLINUX -DPostgreSQL -DTPCH    -c -o driver.o driver.c
    gcc  -O -DDBNAME=\"dss\" -DLINUX -DPostgreSQL -DTPCH    -c -o bm_utils.o bm_utils.c
    gcc  -O -DDBNAME=\"dss\" -DLINUX -DPostgreSQL -DTPCH    -c -o rnd.o rnd.c
    gcc  -O -DDBNAME=\"dss\" -DLINUX -DPostgreSQL -DTPCH    -c -o print.o print.c
    gcc  -O -DDBNAME=\"dss\" -DLINUX -DPostgreSQL -DTPCH    -c -o load_stub.o load_stub.c
    gcc  -O -DDBNAME=\"dss\" -DLINUX -DPostgreSQL -DTPCH    -c -o bcd2.o bcd2.c
    gcc  -O -DDBNAME=\"dss\" -DLINUX -DPostgreSQL -DTPCH    -c -o speed_seed.o speed_seed.c
    gcc  -O -DDBNAME=\"dss\" -DLINUX -DPostgreSQL -DTPCH    -c -o text.o text.c
    gcc  -O -DDBNAME=\"dss\" -DLINUX -DPostgreSQL -DTPCH    -c -o permute.o permute.c
    gcc  -O -DDBNAME=\"dss\" -DLINUX -DPostgreSQL -DTPCH    -c -o rng64.o rng64.c
    gcc  -O -DDBNAME=\"dss\" -DLINUX -DPostgreSQL -DTPCH  -O -o dbgen build.o driver.o bm_utils.o rnd.o print.o load_stub.o bcd2.o speed_seed.o text.o permute.o rng64.o -lm
    gcc  -O -DDBNAME=\"dss\" -DLINUX -DPostgreSQL -DTPCH    -c -o qgen.o qgen.c
    qgen.c: In function `qsub':
    qgen.c:174: error: `SET_ROWCOUNT' undeclared (first use in this function)
    qgen.c:174: error: (Each undeclared identifier is reported only once
    qgen.c:174: error: for each function it appears in.)
    qgen.c:190: error: `START_TRAN' undeclared (first use in this function)
    qgen.c:196: error: `SET_DBASE' undeclared (first use in this function)
    qgen.c:202: error: `END_TRAN' undeclared (first use in this function)
    qgen.c:217: error: `SET_OUTPUT' undeclared (first use in this function)
    qgen.c:234: error: `GEN_QUERY_PLAN' undeclared (first use in this function)
    make: *** [qgen.o] Error 1
    Please suggest me solution on this.


    Thanks,
    Audi...

  2. #2
    Join Date
    Apr 2010
    Posts
    1
    (I'm french, sorry for my event bad english )

    I had the same problem, and I solve it, maybe ^^.

    Loot at the makefile, there are a list of database:
    Code:
    # Current values for DATABASE are: INFORMIX, DB2, TDAT (Teradata)
    #                                  SQLSERVER, SYBASE
    Notice you have not PostgreSQL.

    Look now at the file tpcd.h, there are definition of constants for each database who are commented in the makefile:
    Code:
    (...)
    #ifdef ORACLE
    #define GEN_QUERY_PLAN ""
    #define START_TRAN ""
    #define END_TRAN ""
    #define SET_OUTPUT ""
    #define SET_ROWCOUNT "where rownum <= %d;\n"
    #define SET_DBASE ""
    #endif
    
    #ifdef 	SQLSERVER
    #define GEN_QUERY_PLAN  "set showplan on\nset noexec on\ngo\n"
    #define START_TRAN      "begin transaction\ngo\n"
    #define END_TRAN        "commit transaction\ngo\n"
    #define SET_OUTPUT      ""
    #define SET_ROWCOUNT    "set rowcount %d\ngo\n\n"
    #define SET_DBASE       "use %s\ngo\n"
    #endif
    (...)
    This C code define constants who will be used.

    So, add new lines !

    Code:
    #ifdef PostgreSQL
    #define GEN_QUERY_PLAN ""
    #define START_TRAN ""
    #define END_TRAN ""
    #define SET_OUTPUT ""
    #define SET_ROWCOUNT "where rownum <= %d;\n"
    #define SET_DBASE ""
    #endif
    I take data from Oracle one, but I don't now if it works, I'll test soon.

    Anyway, the compilation works.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •