summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2011-09-12 23:11:17 +0100
committerChris Dyer <cdyer@cs.cmu.edu>2011-09-12 23:11:17 +0100
commitd63a32c5d57b2ab5c016c5988db4bf5b374dcba4 (patch)
treed65fb02d785c1121acbe9c017119c9db3ce7e74a
parentf826e90538dc15fbde4152b0e2f7d30fd6e56784 (diff)
add configuration option for perfect hashing library
-rw-r--r--configure.ac53
1 files changed, 39 insertions, 14 deletions
diff --git a/configure.ac b/configure.ac
index 4e708073..6fa7b914 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11,6 +11,45 @@ AC_PROG_CXX
AC_LANG_CPLUSPLUS
BOOST_REQUIRE
BOOST_PROGRAM_OPTIONS
+AC_ARG_ENABLE(mpi,
+ [ --enable-mpi Build MPI binaries, assumes mpi.h is present ],
+ [ mpi=yes
+ ])
+AM_CONDITIONAL([MPI], [test "x$mpi" = xyes])
+
+if test "x$mpi" = xyes
+then
+ BOOST_SERIALIZATION
+ AC_DEFINE([HAVE_MPI], [1], [flag for MPI])
+ # TODO BOOST_MPI needs to be implemented
+ LIBS="$LIBS -lboost_mpi $BOOST_SERIALIZATION_LIBS"
+fi
+
+AM_CONDITIONAL([CMPH], false)
+AC_ARG_WITH(cmph,
+ [AC_HELP_STRING([--with-cmph=PATH], [(optional) path to cmph perfect hashing library])],
+ [with_cmph=$withval],
+ [with_cmph=no]
+ )
+
+if test "x$with_cmph" != 'xno'
+then
+ SAVE_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS -I${with_cmph}/include"
+
+ AC_CHECK_HEADER(cmph.h,
+ [AC_DEFINE([HAVE_CMPH], [], [flag for cmph perfect hashing library])],
+ [AC_MSG_ERROR([Cannot find cmph library!])])
+
+ LDFLAGS="$LDFLAGS -L${with_cmph}/lib"
+ AC_CHECK_LIB(cmph, cmph_search)
+
+ #LIB_CMPH="-lcmph"
+ #LIBS="$LIBS $LIB_CMPH"
+ #FMTLIBS="$FMTLIBS libcmph.a"
+ AM_CONDITIONAL([CMPH], true)
+fi
+
#BOOST_THREADS
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
LDFLAGS="$LDFLAGS $BOOST_PROGRAM_OPTIONS_LDFLAGS"
@@ -27,20 +66,6 @@ AC_CHECK_HEADER(google/dense_hash_map,
AC_PROG_INSTALL
GTEST_LIB_CHECK
-AC_ARG_ENABLE(mpi,
- [ --enable-mpi Build MPI binaries, assumes mpi.h is present ],
- [ mpi=yes
- ])
-AM_CONDITIONAL([MPI], [test "x$mpi" = xyes])
-
-if test "x$mpi" = xyes
-then
- BOOST_SERIALIZATION
- AC_DEFINE([HAVE_MPI], [1], [flag for MPI])
- # TODO BOOST_MPI needs to be implemented
- LIBS="$LIBS -lboost_mpi $BOOST_SERIALIZATION_LIBS -lmpi++ -lmpi"
-fi
-
AM_CONDITIONAL([RAND_LM], false)
AC_ARG_WITH(randlm,
[AC_HELP_STRING([--with-randlm=PATH], [(optional) path to RandLM toolkit])],