2 AM_INIT_AUTOMAKE(barvinok, 0.08)
8 dnl Check for GMP library
9 AC_MSG_CHECKING(whether to use GMP)
11 [ --with-libgmp DIR Location of the GMP Distribution],
12 gmp_package=$withval, gmp_package=yes)
13 if test "x$gmp_package" = "xno"; then
15 AC_MSG_ERROR(Need gmp)
18 if test "x$gmp_package" != "xyes"; then
20 if test ! -d "$GMP_DIR"; then
21 AC_ERROR(Directory given for GMP Distribution is not a directory)
23 CPPFLAGS="-I$GMP_DIR/include $CPPFLAGS"
24 LDFLAGS="-L$GMP_DIR/lib $LDFLAGS"
27 AC_CHECK_HEADER(gmp.h,
28 [AC_CHECK_LIB(gmp,main,
30 [poly_cv_gmpfatal="yes"])],
31 [poly_cv_gmpfatal="yes"])
32 if test "$poly_cv_gmpfatal" = "yes"; then
33 AC_MSG_ERROR([GMP not found])
38 [ --with-polylib=DIR DIR Location of PolyLib],
39 [ echo "Package polylib : $withval" && polylib_package=$withval],
40 [ polylib_package=yes ])
42 if test "$polylib_package" = "no"; then
43 AC_MSG_ERROR(Need polylib)
46 if test "$polylib_package" != "yes"; then
47 CPPFLAGS="-I$polylib_package/include $CPPFLAGS"
48 LDFLAGS="-L$polylib_package/lib $LDFLAGS"
49 LD_LIBRARY_PATH="$polylib_package/lib:$LD_LIBRARY_PATH"
50 export LD_LIBRARY_PATH
53 AC_CHECK_LIB(polylibgmp, PolyhedronTSort,[],[
54 AC_MSG_ERROR(Need polylib)
56 AC_REPLACE_FUNCS(Enumeration_Free reduce_evalue)
58 #include <polylib/polylibgmp.h>
64 Matrix *M = Matrix_Alloc(6,5);
65 for (i = 0; i < 6; ++i) {
66 value_set_si(M->p[i][0], 1);
67 for (j = 1; j < 4; ++j)
68 value_set_si(M->p[i][j], (j-1 == i/2) * (1-2*(i%2)));
69 value_set_si(M->p[i][4], i%2);
71 P = Constraints2Polyhedron(M, 6);
72 return !(P->NbRays == 8);
75 AC_MSG_WARN([This version of polylib does not automatically])
76 AC_MSG_WARN([enlarge the chernikova table space]))
79 #include <polylib/polylibgmp.h>
83 enode *en = new_enode(polynomial, 1, 1);
84 return !(en->arr[0].x.p == NULL);
87 AC_MSG_WARN([This version of polylib leaks]))
89 AC_MSG_CHECKING([number of arguments of Polyhedron_Enumerate])
90 AC_TRY_COMPILE([#include <polylib/polylibgmp.h>],
91 [Polyhedron_Enumerate(NULL,NULL,0,NULL)],
93 AC_DEFINE(HAVE_ENUMERATE4,[],
94 [Polyhedron_Enumerate takes four arguments])],
97 AC_MSG_CHECKING([number of arguments of count_points])
98 AC_TRY_COMPILE([#include <polylib/polylibgmp.h>],
99 [count_points(0,NULL,NULL,NULL)],
101 AC_DEFINE(HAVE_COUNT_POINTS4,[],
102 [count_points takes four arguments])],
105 AC_MSG_CHECKING(if --enable-modulo option specified)
106 AC_ARG_ENABLE(modulo,
107 [ --enable-modulo Use modulo representation],
108 [bv_cv_modulo=$enableval], [bv_cv_modulo="no"])
109 AC_MSG_RESULT($bv_cv_modulo)
110 if test "x$bv_cv_modulo" != "xno"; then
111 AC_MSG_WARN(This is not fully supported yet)
112 AC_DEFINE(USE_MODULO,[], [Use modulo representation])
116 [ --with-ntl=DIR DIR Location of NTL],
117 [ echo "Package tnl : $withval" && ntl_package=$withval],
120 if test "$ntl_package" = "no"; then
121 AC_MSG_ERROR(Need ntl)
124 if test "$ntl_package" != "yes"; then
125 CPPFLAGS="-I$ntl_package/include $CPPFLAGS"
126 LDFLAGS="-L$ntl_package/lib $LDFLAGS"
129 AC_CHECK_LIB(ntl, main,[],[
130 AC_MSG_ERROR(Need ntl)
133 AC_CONFIG_HEADERS(config.h)