./configure fails to find SPARSEHASH
Bug reports:
Please follow the general troubleshooting steps first:
- [2.25] Are you running the latest
graph-tool
version? - [not attempted] Do you observe the problem with the current git version?
- [NO] Are you using Macports or Homebrew? If yes, please submit an issue there instead: https://github.com/Homebrew/brew/issues and https://trac.macports.org/newticket
- [YES] Did you compile
graph-tool
manually? - [N/A] If you answered yes above, did you use the exact same compiler to build
graph-tool
,boost-python
andPython
?
ISSUE: The configure.ac script does not set CPPFLAGS before "AC_CHECK_HEADER([${SPARSEHASH_PREFIX}/dense_hash_set]," The ./configure command fails with a "file not found" at the "dense_hash_set" include.
- [RHEL 7.3 with "scl enable devtoolset-6"] Your operating system.
- [2.7.13 - Anaconda] The Python version you are using.
- ["g++ -std=c++14" 6.2.1; boost 1.64.0] If you compiled graph-tool manually: Your compiler version, as well as the version of Boost being used.
- [will provide if needed] If you are reporting a compilation error, please provide the entire
./configure
output, as well as the entire contents of theconfig.log
file and the entire compilation output.
Suggested modification:
if test "$USING_SPARSEHASH" = "yes"; then
PKG_CHECK_MODULES(SPARSEHASH, [libsparsehash],
AC_DEFINE([HAVE_SPARSEHASH], [1], [Using google's sparsehash]),
[AC_MSG_RESULT([not found by pkgconfig, trying default...])])
AC_SUBST(SPARSEHASH_CFLAGS)
+ [CPPFLAGS_TEMP="${CPPFLAGS}"]
+ [CPPFLAGS="${SPARSEHASH_CFLAGS} ${CPPFLAGS}"]
AC_DEFINE_UNQUOTED([SPARSEHASH_PREFIX], [${SPARSEHASH_PREFIX}],
[Sparsehash include prefix])
AC_DEFINE_UNQUOTED([SPARSEHASH_INCLUDE(f)], [<${SPARSEHASH_PREFIX}/f>],
[Sparsehash include macro])
AC_CHECK_HEADER([${SPARSEHASH_PREFIX}/dense_hash_set], [],
[AC_MSG_ERROR([sparsehash headers not found])])
+ [CPPFLAGS="${CPPFLAGS_TEMP}"]
fi