Repository: citusdata/citus

Issue #384: Build Problem with Ubuntu using --prefix while configuring PostgreSQL
Created: 2016-03-16T09:54:44Z
Citus build (make) fails if PostgreSQL is configured with --prefix=/some/custom/pg/dir command.
Following list of commands successfully compiles Citus:
cd /home/ubuntu/postgresql-9.5.1
make clean
./configure
make -j 8
sudo make install
export PATH=/usr/local/pgsql/bin:$PATH
cd /home/ubuntu/citus
make clean
./configure
make
sudo make install

Follow these commands (on a different terminal) to reproduce the error:
export PATH=/home/ubuntu/pgdev/bin:$PATH
cd /home/ubuntu/postgresql-9.5.1
make clean
./configure --prefix=/home/ubuntu/pgdev
make -j 8
sudo make install
cd /home/ubuntu/citus
make clean
./configure
make

The error message is this:
...
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -fpic -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-missing-field-initializers -Wno-clobbered -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wmissing-declarations -Wmissing-prototypes -I '/home/ubuntu/citus/src/include' -I. -I./ -I/home/ubuntu/pgdev/include/postgresql/server -I/home/ubuntu/pgdev/include/postgresql/internal -D_GNU_SOURCE  -I/home/ubuntu/pgdev/include  -c -o test/connection_utils.o test/connection_utils.c
test/connection_utils.c:16:24: fatal error: internal/c.h: No such file or directory
 #include "internal/c.h"
                        ^
compilation terminated.
make[1]: *** [test/connection_utils.o] Error 1
make[1]: Leaving directory `/home/ubuntu/citus/src/backend/distributed'
make: *** [extension] Error 2


Tried this on a fresh Ubuntu 14.04 Amazon EC2 m3.large instance with PostgreSQL 9.5.1 and latest Citus:
$ uname -a
Linux ip-10-180-95-46 3.13.0-74-generic #118-Ubuntu SMP Thu Dec 17 22:52:10 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Issue occurs with 6925639 and a53fb90 but does not occur with 297bd57.
@jasonmp85, do you have any idea?

Duplicate issue #534: Unable to find c.h file
Created: 2016-05-18T05:18:04Z
Hi,
$ gcc --version
gcc (GCC) 4.7.2 20121015 (Red Hat 4.7.2-5)
My pg_config:
$ pg_config
BINDIR = /home/linuxadmin/pg_git_install/9.4.7/bin
DOCDIR = /home/linuxadmin/pg_git_install/9.4.7/share/doc/postgresql
HTMLDIR = /home/linuxadmin/pg_git_install/9.4.7/share/doc/postgresql
INCLUDEDIR = /home/linuxadmin/pg_git_install/9.4.7/include
PKGINCLUDEDIR = /home/linuxadmin/pg_git_install/9.4.7/include/postgresql
INCLUDEDIR-SERVER = /home/linuxadmin/pg_git_install/9.4.7/include/postgresql/server
LIBDIR = /home/linuxadmin/pg_git_install/9.4.7/lib
PKGLIBDIR = /home/linuxadmin/pg_git_install/9.4.7/lib/postgresql
LOCALEDIR = /home/linuxadmin/pg_git_install/9.4.7/share/locale
MANDIR = /home/linuxadmin/pg_git_install/9.4.7/share/man
SHAREDIR = /home/linuxadmin/pg_git_install/9.4.7/share/postgresql
SYSCONFDIR = /home/linuxadmin/pg_git_install/9.4.7/etc/postgresql
PGXS = /home/linuxadmin/pg_git_install/9.4.7/lib/postgresql/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--with-libxml' '--enable-cassert' '--enable-debug' '--enable-profiling' '--prefix=/home/linuxadmin/pg_git_install/9.4.7/' '--with-python' 'CFLAGS=-g -O0'
CC = gcc
CPPFLAGS = -D_GNU_SOURCE -I/usr/include/libxml2
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -g -pg -DLINUX_PROFILE -g -O0
CFLAGS_SL = -fpic
LDFLAGS = -L../../../src/common -Wl,--as-needed -Wl,-rpath,'/home/linuxadmin/pg_git_install/9.4.7/lib',--enable-new-dtags
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -lxml2 -lz -lreadline -lrt -lcrypt -ldl -lm
VERSION = PostgreSQL 9.4.7

While installing citus-v5.0.0 and citus-v5.0.1 I am getting following error:
/opt/centos/devtoolset-1.1/root/usr/bin/gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -g -pg -DLINUX_PROFILE -g -O0 -fpic -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-missing-field-initializers -Wno-clobbered -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wmissing-declarations -Wmissing-prototypes -I '/home/linuxadmin/citus/src/include' -I. -I./ -I/home/linuxadmin/pg_git_install/9.4.7/include/postgresql/server -I/home/linuxadmin/pg_git_install/9.4.7/include/postgresql/internal -D_GNU_SOURCE -I/usr/include/libxml2  -I/home/linuxadmin/pg_git_install/9.4.7/include  -c -o test/connection_utils.o test/connection_utils.c
test/connection_utils.c:16:24: fatal error: internal/c.h: No such file or directory
compilation terminated.
make[1]: *** [test/connection_utils.o] Error 1
make[1]: Leaving directory `/home/linuxadmin/citus/src/backend/distributed'
make: *** [extension] Error 2

Please let me know is it error or I am missing something?
Regards,
Sachin

Closing comment (2016-05-18T07:32:34Z): Hi @kotsachin,
This issue is very similar to #384. To fix this, please either

Install PostgreSQL to the default path
Use Citus 5.1-rc.1

Thank you for mentioning.