Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostgreSQL use: compilation failure #15

Closed
pallavisontakke opened this issue Jan 30, 2018 · 4 comments
Closed

PostgreSQL use: compilation failure #15

pallavisontakke opened this issue Jan 30, 2018 · 4 comments

Comments

@pallavisontakke
Copy link

hi @anse1

When trying to use sqlsmith for PostgreSQL 11, I was facing this compilation issue:

g++ -DHAVE_CONFIG_H -I.  -I/usr/include    -Wall -Wextra   -g -O2 -std=c++11 -MT postgres.o -MD -MP -MF .deps/postgres.Tpo -c -o postgres.o postgres.cc
In file included from postgres.cc:1:0:
postgres.hh:14:22: fatal error: libpq-fe.h: No such file or directory
 #include <libpq-fe.h>
                      ^
compilation terminated.
make[1]: *** [postgres.o] Error 1
make[1]: Leaving directory `/var/lib/postgresql/sources/sqlsmith'
make: *** [all] Error 2

This was due to error in https://github.com/anse1/sqlsmith/blob/master/Makefile.am at line 26.
Here POSTGRESQL_CFLAGS is erroneously mentioned as POSTGRESQL_CPPFLAGS .
Replacing it fixes this issue

@anse1
Copy link
Owner

anse1 commented Jan 30, 2018 via email

@pallavisontakke
Copy link
Author

What I meant was, in sqlsmith code , I see POSTGRESQL_CFLAGS being set to 'includedir' values, so it can get header files.

postgres@provider:~/sources/sqlsmith$ grep -rn 'POSTGRESQL_CFLAGS' *|more
aclocal.m4:559:#     AC_SUBST(POSTGRESQL_CFLAGS)
aclocal.m4:597:    POSTGRESQL_CFLAGS=""
aclocal.m4:620:            POSTGRESQL_CFLAGS="-I`$PG_CONFIG --includedir`"
aclocal.m4:682:    AC_SUBST([POSTGRESQL_CFLAGS])
autom4te.cache/traces.0:394:    POSTGRESQL_CFLAGS=""
autom4te.cache/traces.0:417:            POSTGRESQL_CFLAGS="-I`$PG_CONFIG --includedir`"
autom4te.cache/traces.0:479:    AC_SUBST([POSTGRESQL_CFLAGS])
autom4te.cache/traces.0:1497:m4trace:configure.ac:8: -1- m4_pattern_allow([^POSTGRESQL_CFLAGS$])
autom4te.cache/traces.1:333:m4trace:configure.ac:8: -1- AC_SUBST([POSTGRESQL_CFLAGS])
autom4te.cache/traces.1:334:m4trace:configure.ac:8: -1- AC_SUBST_TRACE([POSTGRESQL_CFLAGS])
autom4te.cache/traces.1:335:m4trace:configure.ac:8: -1- m4_pattern_allow([^POSTGRESQL_CFLAGS$])
autom4te.cache/output.1:614:POSTGRESQL_CFLAGS
autom4te.cache/output.1:3402:    POSTGRESQL_CFLAGS=""
autom4te.cache/output.1:3462:            POSTGRESQL_CFLAGS="-I`$PG_CONFIG --includedir`"
autom4te.cache/output.0:614:POSTGRESQL_CFLAGS
autom4te.cache/output.0:3402:    POSTGRESQL_CFLAGS=""
autom4te.cache/output.0:3462:            POSTGRESQL_CFLAGS="-I`$PG_CONFIG --includedir`"
configure:614:POSTGRESQL_CFLAGS
configure:3402:    POSTGRESQL_CFLAGS=""
configure:3462:            POSTGRESQL_CFLAGS="-I`$PG_CONFIG --includedir`"

However, POSTGRESQL_CPPFLAGS is only being used, but not being set anywhere:

postgres@provider:~/sources/sqlsmith$ grep -rn 'POSTGRESQL_CPPFLAGS' *|more
Makefile.am:26:AM_CPPFLAGS = $(BOOST_CPPFLAGS) $(PQXX_CFLAGS) $(POSTGRESQL_CPPFLAGS) $(MONETDB_MAPI_CFLAGS) -Wall -Wextra

Also, PG_CONFIG is set properly in my environment during build:

postgres@provider:~/sources/sqlsmith$ echo $PG_CONFIG
/var/lib/postgresql/11/bin/pg_config

And configure is picking it up properly as well:

postgres@provider:~/sources/sqlsmith$ grep -rin 'pg_config' config.log 
178:configure:3412: checking for pg_config
179:configure:3442: result: /var/lib/postgresql/11/bin/pg_config
343:ac_cv_path_PG_CONFIG=/var/lib/postgresql/11/bin/pg_config
427:PG_CONFIG='/var/lib/postgresql/11/bin/pg_config'

@anse1
Copy link
Owner

anse1 commented Feb 2, 2018 via email

@pallavisontakke
Copy link
Author

ok, fine , in that case it's ok to close this Issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants