breve
breve copied to clipboard
configure issue on Linux
On Ubuntu 17.04, with zlib1g and zlib1g-dev installed, configure still fails to detect zlib.
checking for gzopen in -lz... no
configure: error: in `/home/justin/Downloads/breve-master':
configure: error: Missing zlib library -- see http://www.zlib.org
See `config.log' for more details
After looking at the config.log, it appears that it was failing due to a "missing" libpython2.6.
configure:8189: checking for gzopen in -lz
configure:8214: g++ -o conftest -g -O2 -I/usr/include/python2.7 conftest.cpp -lz -lglut -lGLU -lGL -lX11 -lXi -lXmu -lpython2.6 >&5
/usr/bin/ld: cannot find -lpython2.6
collect2: error: ld returned 1 exit status
configure:8214: $? = 1
The problem is that my system has libpython2.7, and configure checks for this and knows this, but appears to set the LIBS incorrectly in configure.ac to libpython2.6 rather than libpython2.7 around lines 148 and 149.
#
# Python wants to be dynamically linked as well
#
if test "x$python" = "xyes"; then
PYTHONINCLUDE=""
# Python can come in so many exciting flavors, with different library names!
AC_CHECK_LIB([python], [Py_Initialize], [LIBS="$LIBS -lpython" PYTHONINCLUDE="$PYTHONINCLUDE -I${PYTHONROOT}/include/python"])
AC_CHECK_LIB([python2.3], [Py_Initialize], [LIBS="$LIBS -lpython2.3" PYTHONINCLUDE="$PYTHONINCLUDE -I${PYTHONROOT}/include/python2.3"])
AC_CHECK_LIB([python23], [Py_Initialize], [LIBS="$LIBS -lpython2.3" PYTHONINCLUDE="$PYTHONINCLUDE -I${PYTHONROOT}/include/python2.3"])
AC_CHECK_LIB([python2.4], [Py_Initialize], [LIBS="$LIBS -lpython2.4" PYTHONINCLUDE="$PYTHONINCLUDE -I${PYTHONROOT}/include/python2.4"])
AC_CHECK_LIB([python24], [Py_Initialize], [LIBS="$LIBS -lpython2.4" PYTHONINCLUDE="$PYTHONINCLUDE -I${PYTHONROOT}/include/python2.4"])
AC_CHECK_LIB([python2.5], [Py_Initialize], [LIBS="$LIBS -lpython2.5" PYTHONINCLUDE="$PYTHONINCLUDE -I${PYTHONROOT}/include/python2.5"])
AC_CHECK_LIB([python25], [Py_Initialize], [LIBS="$LIBS -lpython2.5" PYTHONINCLUDE="$PYTHONINCLUDE -I${PYTHONROOT}/include/python2.5"])
AC_CHECK_LIB([python2.6], [Py_Initialize], [LIBS="$LIBS -lpython2.6" PYTHONINCLUDE="$PYTHONINCLUDE -I${PYTHONROOT}/include/python2.6"])
AC_CHECK_LIB([python26], [Py_Initialize], [LIBS="$LIBS -lpython2.6" PYTHONINCLUDE="$PYTHONINCLUDE -I${PYTHONROOT}/include/python2.6"])
AC_CHECK_LIB([python2.7], [Py_Initialize], [LIBS="$LIBS -lpython2.6" PYTHONINCLUDE="$PYTHONINCLUDE -I${PYTHONROOT}/include/python2.7"])
AC_CHECK_LIB([python27], [Py_Initialize], [LIBS="$LIBS -lpython2.6" PYTHONINCLUDE="$PYTHONINCLUDE -I${PYTHONROOT}/include/python2.7"])
if test "x$PYTHONINCLUDE" != "x"; then
AC_DEFINE( [HAVE_LIBPYTHON], [], [Have the required Python libraries] )
CPPFLAGS="${CPPFLAGS} ${PYTHONINCLUDE}"
fi
fi
When you change those last two lines to use libpython2.7 in configure.ac and rerun autoconf, the configure test is successful and is able to move past that point.
AC_CHECK_LIB([python2.7], [Py_Initialize], [LIBS="$LIBS -lpython2.7" PYTHONINCLUDE="$PYTHONINCLUDE -I${PYTHONROOT}/include/python2.7"])
AC_CHECK_LIB([python27], [Py_Initialize], [LIBS="$LIBS -lpython2.7" PYTHONINCLUDE="$PYTHONINCLUDE -I${PYTHONROOT}/include/python2.7"])
Finally, after fixing that and installing the needed prerequisites, configure completes fully and compilation is moving forward. Now I'm working on a different failure in netsim.cc / netsim.h
Please put in a pull request for this and I’d be glad to merge it in!