citusdata / cstore_fdw

Columnar storage extension for Postgres built as a foreign data wrapper. Check out https://github.com/citusdata/citus for a modernized columnar storage implementation built as a table access method.
Apache License 2.0
1.76k stars 171 forks source link

Won't build on Illumos #218

Open Smithx10 opened 4 years ago

Smithx10 commented 4 years ago

@ptribble ever see this one before?

[root@tommy-dd378711 ~/cstore_fdw]# make
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -m64 -fPIC --std=c99 -I. -I./ -I/opt/postgresql/11.1/include/server -I/opt/postgresql/11.1/include/internal    -c -o cstore_fdw.o cstore_fdw.c
In file included from /opt/postgresql/11.1/include/server/postgres.h:47:0,
                 from cstore_fdw.c:18:
/opt/postgresql/11.1/include/server/utils/elog.h:318:20: error: unknown type name 'sigjmp_buf'
 extern PGDLLIMPORT sigjmp_buf *PG_exception_stack;
                    ^
<builtin>: recipe for target 'cstore_fdw.o' failed
make: *** [cstore_fdw.o] Error 1
Smithx10 commented 4 years ago

Adding

define _XOPEN_SOURCE to cstore_fdw.c got me to:

[root@tommy-dd378711 ~/cstore_fdw]# make
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -pipe -O2 -D_FORTIFY_SOURCE=2 -I/opt/local/include -I/opt/local/include/ncurses -DLDAP_DEPRECATED -I/usr/include -fPIC --std=c99 --save-temp -I. -I./ -I/opt/local/include/postgresql/server -I/opt/local/include/postgresql/internal  -I/opt/local/include -I/opt/local/include/ncurses -DLDAP_DEPRECATED -I/usr/include -I/opt/local/include/libxml2 -I/opt/local/include   -c -o cstore_fdw.o cstore_fdw.c
gcc: warning: -pipe ignored because -save-temps specified
In file included from /opt/local/include/postgresql/server/nodes/execnodes.h:20:0,
                 from /opt/local/include/postgresql/server/commands/copy.h:17,
                 from cstore_fdw.c:33:
/opt/local/include/postgresql/server/executor/instrument.h:31:13: error: field 'blk_read_time' has incomplete type
  instr_time blk_read_time; /* time spent reading */
             ^
/opt/local/include/postgresql/server/executor/instrument.h:32:13: error: field 'blk_write_time' has incomplete type
  instr_time blk_write_time; /* time spent writing */
             ^
/opt/local/include/postgresql/server/executor/instrument.h:51:13: error: field 'starttime' has incomplete type
  instr_time starttime;  /* Start time of current iteration of node */
             ^
/opt/local/include/postgresql/server/executor/instrument.h:52:13: error: field 'counter' has incomplete type
  instr_time counter;  /* Accumulated runtime for this node */
             ^
<builtin>: recipe for target 'cstore_fdw.o' failed
make: *** [cstore_fdw.o] Error 1
Smithx10 commented 4 years ago

Turned out you only need to add -DEXTENSIONS to the Makefile. Could this be merged?

mtuncer commented 4 years ago

If you are building PostgreSQL from sources you can add it to CFLAGS when doing ./configure

Smithx10 commented 4 years ago

Seem's relevant https://www.illumos.org/issues/6283