knizhnik / imcs

In-Memory Columnar Store extension for PostgreSQL
Apache License 2.0
203 stars 33 forks source link

Unable to install for PG12 (Ubuntu 18.04) - lots of errors with make install #53

Closed pavitrakumar78 closed 4 years ago

pavitrakumar78 commented 4 years ago

Hi,

I'm trying to install this on PG12 (installed via apt-get dist) but I'm getting a lot of errors when I execute the install script. Here are the PG-related installs I've done prior to executing the install script:

sudo apt-get install postgresql-12
sudo apt-get install libpq-dev
sudo apt-get install postgresql-server-dev-12
sudo apt-get install postgresql-contrib
sudo apt-get install libicu-dev
sudo apt-get install postgis
sudo apt-get install postgis postgresql-12-postgis-3

I've attached the error log I get from executing ./install.sh (downloaded the current repo - not using the release as it's outdated based on the commits) with this post. I can't post it here or on pastebin because it's too long (>5k lines).

err_log.txt

The first ~50 lines:

gcc -O3 -Wall -Wno-format-security -fPIC -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include/mit-krb5  -c -o func.o func.c
func.c:6206:5: error: unknown type name ‘FunctionCallInfoData’
     FunctionCallInfoData fcinfo;
     ^~~~~~~~~~~~~~~~~~~~
func.c: In function ‘imcs_int8_call_int8_next’:
func.c:6215:5: error: unknown type name ‘FunctionCallInfoData’; did you mean ‘FunctionCallInfoBaseData’?
     FunctionCallInfoData* fcinfo = &ctx->fcinfo;                        \
     ^
func.c:6248:5: note: in expansion of macro ‘IMCS_CALL_DEF’
     IMCS_CALL_DEF(RET_TYPE, PG_RET_TYPE, int8, Char)                    \
     ^~~~~~~~~~~~~
func.c:6255:1: note: in expansion of macro ‘IMCS_CALLS_DEF’
 IMCS_CALLS_DEF(int8, Char)
 ^~~~~~~~~~~~~~
func.c:6221:15: error: request for member ‘arg’ in something not a structure or union
         fcinfo->arg[0] = PG_ARG_TYPE##GetDatum(iterator->opd[0]->tile.arr_##ARG_TYPE[i]); \
               ^
func.c:6248:5: note: in expansion of macro ‘IMCS_CALL_DEF’
     IMCS_CALL_DEF(RET_TYPE, PG_RET_TYPE, int8, Char)                    \
     ^~~~~~~~~~~~~
func.c:6255:1: note: in expansion of macro ‘IMCS_CALLS_DEF’
 IMCS_CALLS_DEF(int8, Char)
 ^~~~~~~~~~~~~~
In file included from imcs.h:4:0,
                 from func.h:4,
                 from func.c:1:
/usr/include/postgresql/12/server/fmgr.h:172:48: error: request for member ‘flinfo’ in something not a structure or union
 #define FunctionCallInvoke(fcinfo) ((* (fcinfo)->flinfo->fn_addr) (fcinfo))
                                                ^
/usr/include/postgresql/12/server/postgres.h:409:34: note: in definition of macro ‘DatumGetChar’
 #define DatumGetChar(X) ((char) (X))
                                  ^
func.c:6222:66: note: in expansion of macro ‘FunctionCallInvoke’
         iterator->tile.arr_##RET_TYPE[i] = DatumGet##PG_RET_TYPE(FunctionCallInvoke(fcinfo)); \
                                                                  ^~~~~~~~~~~~~~~~~~
func.c:6248:5: note: in expansion of macro ‘IMCS_CALL_DEF’
     IMCS_CALL_DEF(RET_TYPE, PG_RET_TYPE, int8, Char)                    \
     ^~~~~~~~~~~~~
func.c:6255:1: note: in expansion of macro ‘IMCS_CALLS_DEF’
 IMCS_CALLS_DEF(int8, Char)
 ^~~~~~~~~~~~~~
func.c:6223:19: error: request for member ‘isnull’ in something not a structure or union
         if (fcinfo->isnull) {                                           \
                   ^
func.c:6248:5: note: in expansion of macro ‘IMCS_CALL_DEF’
     IMCS_CALL_DEF(RET_TYPE, PG_RET_TYPE, int8, Char)                    \
     ^~~~~~~~~~~~~
func.c:6255:1: note: in expansion of macro ‘IMCS_CALLS_DEF’
 IMCS_CALLS_DEF(int8, Char)
 ^~~~~~~~~~~~~~
func.c: In function ‘imcs_int8_call_int8’:
func.c:6234:73: error: ‘FunctionCallInfoData’ undeclared (first use in this function); did you mean ‘FunctionCallInfoBaseData’?
     imcs_iterator_h result = imcs_new_iterator(sizeof(RET_TYPE), sizeof(FunctionCallInfoData)); \
                                                                         ^
func.c:6248:5: note: in expansion of macro ‘IMCS_CALL_DEF’

Am I missing a dependency or is this because the core imcs need to be updated again to PG12 changes?

Edit: I did some digging around and found this which is similar to what I'm seeing: https://trac.osgeo.org/postgis/ticket/4312

Based on this, there isn't too much code to be changed right? and the issue is with PG12 having updated definitions.

knizhnik commented 4 years ago

Sorry, I committed port of IMCS to PG12 version.

pavitrakumar78 commented 4 years ago

Thank you! Installation works now!