Building on MacOS Sierra (10.12.6) Fails
qakapil opened this issue · 10 comments
Hi,
While trying to build sqlsmith on MacOS Sierra, the make command fails with this error -
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for i386-apple-darwin11.3.0
Any suggestions please ?
Thanks,
Kapil.
Sorry, I pasted wrong error message above.
I tried building from both master and v1.0 branches.
I followed the README and all the previous steps passed
brew install libpqxx automake libtool autoconf autoconf-archive pkg-config # Passed
cd sqlsmith
autoreconf -i #Passed
./configure #Passed
make . #Failed
#make
/Library/Developer/CommandLineTools/usr/bin/make all-am
g++ -std=c++11 -g -O2 -Wl,--as-needed -L/lib64 -o sqlsmith relmodel.o schema.o random.o expr.o grammar.o log.o dump.o sqlsmith.o -L/usr/local/Cellar/libpqxx/6.1.1/lib -L/usr/local/lib -lpqxx
ld: warning: directory not found for option '-L/lib64'
ld: unknown option: --as-needed
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [sqlsmith] Error 1
make: *** [all] Error 2
Now even configure is failing. Both with and without CXX=/path/to/GNU-g++
checking for the PostgreSQL libraries LIBS... -lpq
checking for the PostgreSQL version... 10.3
checking libpq-fe.h usability... yes
checking libpq-fe.h presence... yes
checking for libpq-fe.h... yes
checking for the PostgreSQL library linking is working... no
configure: error: Library requirements (PostgreSQL) not met.
I probably shouldn't have played with MacOs's default clang provided by apple.
configure:5135: checking for libpq-fe.h
configure:5135: result: yes
configure:5146: checking for the PostgreSQL library linking is working
configure:5172: g++ -std=c++11 -o conftest -g -O2 -I/usr/local/Cellar/postgresql/10.3/include -L/usr/local/lib conftest.cpp -lpq >&5
conftest.cpp:30:12: error: cannot initialize a variable of type 'char' with an lvalue of type 'const char [18]'
char conninfo="dbname = postgres";
^ ~~~~~~~~~~~~~~~~~~~
1 error generated.
configure:5172: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "SQLsmith"
| #define PACKAGE_TARNAME "sqlsmith"
| #define PACKAGE_VERSION "1.1"
There's still no upstream-fix in autoconf-archive, but there is a new release tarball for sqlsmith available now.
Building from the tarball avoids the autoconf issues you are running into.
Make sure to invoke the configure from the tarball right-away without running autoconf or autoreconf,
as this would reintroduce the broken autoconf-archive code.
This as been fixed in autoconf-archive ↝ closing this issue