HypoPG / hypopg

Hypothetical Indexes for PostgreSQL
https://hypopg.readthedocs.io
Other
1.39k stars 59 forks source link

[Question] Compilation error #56

Closed sanderdms closed 3 years ago

sanderdms commented 3 years ago

I'm not able to successfully compile the extension. Any Idea what might be going wrong ? Tips to make it work ? Below I pasted _pgconfig and finally the returned warnings and errors from running make

# pg_config
BINDIR = /usr/lib/postgresql/13/bin
DOCDIR = /usr/share/doc/postgresql-doc-13
HTMLDIR = /usr/share/doc/postgresql-doc-13
INCLUDEDIR = /usr/include/postgresql
PKGINCLUDEDIR = /usr/include/postgresql
INCLUDEDIR-SERVER = /usr/include/postgresql/13/server
LIBDIR = /usr/lib/x86_64-linux-gnu
PKGLIBDIR = /usr/lib/postgresql/13/lib
LOCALEDIR = /usr/share/locale
MANDIR = /usr/share/postgresql/13/man
SHAREDIR = /usr/share/postgresql/13
SYSCONFDIR = /etc/postgresql-common
PGXS = /usr/lib/postgresql/13/lib/pgxs/src/makefiles/pgxs.mk
CONFIGURE =  '--build=x86_64-linux-gnu' '--prefix=/usr' '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-silent-rules' '--libdir=${prefix}/lib/x86_64-linux-gnu' '--runstatedir=/run' '--disable-maintainer-mode' '--disable-dependency-tracking' '--with-icu' '--with-tcl' '--with-perl' '--with-python' '--with-pam' '--with-openssl' '--with-libxml' '--with-libxslt' 'PYTHON=/usr/bin/python3' '--mandir=/usr/share/postgresql/13/man' '--docdir=/usr/share/doc/postgresql-doc-13' '--sysconfdir=/etc/postgresql-common' '--datarootdir=/usr/share/' '--datadir=/usr/share/postgresql/13' '--bindir=/usr/lib/postgresql/13/bin' '--libdir=/usr/lib/x86_64-linux-gnu/' '--libexecdir=/usr/lib/postgresql/' '--includedir=/usr/include/postgresql/' '--with-extra-version= (Debian 13.1-1.pgdg100+1)' '--enable-nls' '--enable-integer-datetimes' '--enable-thread-safety' '--enable-tap-tests' '--enable-debug' '--enable-dtrace' '--disable-rpath' '--with-uuid=e2fs' '--with-gnu-ld' '--with-pgport=5432' '--with-system-tzdata=/usr/share/zoneinfo' '--with-llvm' 'LLVM_CONFIG=/usr/bin/llvm-config-7' 'CLANG=/usr/bin/clang-7' '--with-systemd' '--with-selinux' 'MKDIR_P=/bin/mkdir -p' 'TAR=/bin/tar' 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer' 'LDFLAGS=-Wl,-z,relro -Wl,-z,now' '--with-gssapi' '--with-ldap' 'build_alias=x86_64-linux-gnu' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security'
CC = gcc
CPPFLAGS = -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer
CFLAGS_SL = -fPIC
LDFLAGS = -Wl,-z,relro -Wl,-z,now -L/usr/lib/llvm-7/lib -Wl,--as-needed
LDFLAGS_EX = 
LDFLAGS_SL = 
LIBS = -lpgcommon -lpgport -lpthread -lselinux -lxslt -lxml2 -lpam -lssl -lcrypto -lgssapi_krb5 -lz -lreadline -lrt -ldl -lm 
VERSION = PostgreSQL 13.1 (Debian 13.1-1.pgdg100+1)
# make
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC -I. -I./ -I/usr/include/postgresql/13/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o hypopg.o hypopg.c
hypopg.c: In function ‘_PG_init’:
hypopg.c:131:22: warning: assignment to ‘ProcessUtility_hook_type’ {aka ‘void (*)(struct PlannedStmt *, const char *, enum <anonymous>,  struct ParamListInfoData *, struct QueryEnvironment *, struct _DestReceiver *, struct QueryCompletion *)’} from incompatible pointer type ‘void (*)(PlannedStmt *, const char *, ProcessUtilityContext,  struct ParamListInfoData *, QueryEnvironment *, DestReceiver *, char *)’ {aka ‘void (*)(struct PlannedStmt *, const char *, enum <anonymous>,  struct ParamListInfoData *, struct QueryEnvironment *, struct _DestReceiver *, char *)’} [-Wincompatible-pointer-types]
  ProcessUtility_hook = hypo_utility_hook;
                      ^
hypopg.c: In function ‘hypo_utility_hook’:
hypopg.c:295:15: warning: passing argument 7 of ‘prev_utility_hook’ from incompatible pointer type [-Wincompatible-pointer-types]
         dest, completionTag);
               ^~~~~~~~~~~~~
hypopg.c:295:15: note: expected ‘QueryCompletion *’ {aka ‘struct QueryCompletion *’} but argument is of type ‘char *’
hypopg.c:314:15: warning: passing argument 7 of ‘standard_ProcessUtility’ from incompatible pointer type [-Wincompatible-pointer-types]
         dest, completionTag);
               ^~~~~~~~~~~~~
In file included from include/hypopg_index.h:22,
                 from hypopg.c:39:
/usr/include/postgresql/13/server/tcop/utility.h:85:47: note: expected ‘QueryCompletion *’ {aka ‘struct QueryCompletion *’} but argument is of type ‘char *’
          DestReceiver *dest, QueryCompletion *qc);
                              ~~~~~~~~~~~~~~~~~^~
hypopg.c: In function ‘hypo_get_relation_stats_hook’:
hypopg.c:680:6: warning: implicit declaration of function ‘pg_class_aclcheck’; did you mean ‘pclose_check’? [-Wimplicit-function-declaration]
     (pg_class_aclcheck(rte->relid, GetUserId(),
      ^~~~~~~~~~~~~~~~~
      pclose_check
hypopg.c:681:27: error: ‘ACLCHECK_OK’ undeclared (first use in this function)
            ACL_SELECT) == ACLCHECK_OK) ||
                           ^~~~~~~~~~~
hypopg.c:681:27: note: each undeclared identifier is reported only once for each function it appears in
hypopg.c:682:6: warning: implicit declaration of function ‘pg_attribute_aclchec’; did you mean ‘pg_attribute_packed’? [-Wimplicit-function-declaration]
     (pg_attribute_aclcheck(rte->relid, attnum, GetUserId(),
      ^~~~~~~~~~~~~~~~~~~~~
      pg_attribute_packed
make: *** [<builtin>: hypopg.o] Error 1
rjuju commented 3 years ago

Hello,

I think that you're trying to compile the master branch. This branch includes work for hypothetical partitioning, which unfortunately had to be abandoned due to important changes in PostgreSQL 12 that are incompatible with hypothetical partitioning.

The up-to-date and maintained branch is REL1_STABLE, which should be the default branch on github interface, and with a quick test should also be the default branch on a fresh git clone.

sanderdms commented 3 years ago

Wonderful. I was wget'ing the main.zip archive without thinking. After changing main.zip to 1.1.4.zip it worked as expected. Thanks for the help.

rjuju commented 3 years ago

Great!