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

Compilation failure on Ubuntu 18.04 #21

Closed
michaelmior opened this issue Sep 11, 2018 · 5 comments
Closed

Compilation failure on Ubuntu 18.04 #21

michaelmior opened this issue Sep 11, 2018 · 5 comments

Comments

@michaelmior
Copy link

michaelmior commented Sep 11, 2018

I get the following issue when running configure on Ubuntu 18.04. Any assistance appreciated :)

$ autoreconf -i
configure.ac:4: installing './install-sh'
configure.ac:4: installing './missing'
Makefile.am: installing './depcomp'
$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
./configure: line 3192: syntax error near unexpected token `noext,mandatory'
./configure: line 3192: `AX_CXX_COMPILE_STDCXX_11(noext,mandatory)'
@michaelmior
Copy link
Author

I was able to fix configure by adding ax_boost_base.m4, ax_boost_regex.m4 ,ax_cxx_compile_stdcxx_11.m4, and ax_cxx_compile_stdcxx.m4 to the m4 directory and adding ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4 to Makefile.am. Then when running make I get the following:

make  all-am
make[1]: Entering directory '/home/mmior/apps/sqlsmith'
g++ -std=c++11  -g -O2 -L/usr/lib/x86_64-linux-gnu   -o sqlsmith relmodel.o schema.o postgres.o  sqlite.o random.o prod.o expr.o grammar.o log.o dump.o impedance.o sqlsmith.o -lpqxx  -lboost_regex  -lsqlite3 
/usr/bin/x86_64-linux-gnu-ld: postgres.o: undefined reference to symbol 'PQexec'
//usr/lib/x86_64-linux-gnu/libpq.so.5: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:429: recipe for target 'sqlsmith' failed
make[1]: *** [sqlsmith] Error 1
make[1]: Leaving directory '/home/mmior/apps/sqlsmith'
Makefile:331: recipe for target 'all' failed
make: *** [all] Error 2

@df7cb
Copy link
Collaborator

df7cb commented Sep 11, 2018

Fwiw, the Debian package Build-Depends on autoconf-archive:

Build-Depends: autoconf, autoconf-archive, debhelper (>= 9), libboost-regex-dev, libpq-dev, libpqxx-dev 

@michaelmior
Copy link
Author

Thanks! Installing autoconf-archive did solve the majority of my problems. Now I have the following:

checking for libpq-fe.h... yes
checking for the PostgreSQL library linking is working... configure: error: in `/home/mmior/apps/sqlsmith':
configure: error: could not find libpq-fe.h header
See `config.log' for more details

Looking in config.log shows

configure:4723: checking for the PostgreSQL library linking is working             
configure:4749: g++ -o conftest -g -O2  -I/usr/include/postgresql  -L/usr/lib/x86_64-linux-gnu conftest.cpp  -lpq >&5 
conftest.cpp: In function 'int main()':                                            
conftest.cpp:30:21: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
       char conninfo="dbname = postgres";                                          
                     ^~~~~~~~~~~~~~~~~~~                                           
conftest.cpp:32:34: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
       conn = PQconnectdb(conninfo);                                               
                                  ^                                                
In file included from conftest.cpp:24:0:                                           
/usr/include/postgresql/libpq-fe.h:261:16: note:   initializing argument 1 of 'PGconn* PQconnectdb(const char*)'
 extern PGconn *PQconnectdb(const char *conninfo);                                 
                ^~~~~~~~~~~

@maahl
Copy link
Contributor

maahl commented Sep 11, 2018

This error is related to this: #18 (comment)

As a temporary workaround, I manually edited the configure script so that this line:
char conninfo="dbname = postgres";
reads like this instead:
char* conninfo="dbname = postgres";

@michaelmior
Copy link
Author

@maahl Yeah, that does the trick :) Thanks for the pointer!

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

3 participants