Commit ca503515 authored by Xin Sun's avatar Xin Sun Committed by Tiago Peixoto

Uses pkg-config when configuring google sparse hash.

In case google sparsehash uses a non-standard prefix, e.g., in Homebrew.
parent cfc04311
......@@ -319,11 +319,17 @@ fi
dnl sparsehash
if test "$USING_SPARSEHASH" = "yes"; then
[CPPFLAGS="${CPPFLAGS} -I/usr/include/sparsehash -I/usr/include/google"]
AC_CHECK_HEADER([dense_hash_set],
[],
PKG_CHECK_MODULES(SPARSEHASH, [libsparsehash], AC_DEFINE([HAVE_SPARSEHASH], [1],
[Using google's sparsehash]), [])
AC_SUBST(SPARSEHASH_CFLAGS)
[OLD_CXXFLAGS="${CXXFLAGS}"]
[OLD_CPPFLAGS="${CPPFLAGS}"]
[CXXFLAGS="${CXXFLAGS} ${SPARSEHASH_CFLAGS}"]
[CPPFLAGS="${CPPFLAGS} ${SPARSEHASH_CFLAGS}"]
AC_CHECK_HEADER([sparsehash/dense_hash_set], [],
[AC_MSG_ERROR([sparsehash headers not found])])
AC_DEFINE_UNQUOTED([HAVE_SPARSEHASH],"1", [Using google's sparsehash])
[CXXFLAGS="${OLD_CXXFLAGS}"]
[CPPFLAGS="${OLD_CPPFLAGS}"]
fi
dnl Checks for typedefs, structures, and compiler characteristics.
......
......@@ -24,7 +24,7 @@
#include <boost/mpl/if.hpp>
#ifdef HAVE_SPARSEHASH
#include <dense_hash_set>
#include <sparsehash/dense_hash_set>
#endif
#ifndef __clang__
......
......@@ -28,8 +28,8 @@
#include <tuple>
#ifdef HAVE_SPARSEHASH
#include <dense_hash_set>
#include <dense_hash_map>
#include <sparsehash/dense_hash_set>
#include <sparsehash/dense_hash_map>
#endif
#include "../generation/sampler.hh"
......
......@@ -21,7 +21,7 @@
#include <unordered_map>
#ifdef HAVE_SPARSEHASH
#include <dense_hash_map>
#include <sparsehash/dense_hash_map>
#endif
#include <iostream>
......
......@@ -19,7 +19,7 @@
#include <unordered_map>
#ifdef HAVE_SPARSEHASH
#include <dense_hash_map>
#include <sparsehash/dense_hash_map>
#endif
#include "graph_util.hh"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment