2 AM_INIT_AUTOMAKE(barvinok, 0.15)
8 AC_CHECK_HEADERS(getopt.h)
10 dnl Check for GMP library
11 AC_MSG_CHECKING(whether to use GMP)
13 [ --with-libgmp DIR Location of the GMP Distribution],
14 gmp_package=$withval, gmp_package=yes)
15 if test "x$gmp_package" = "xno"; then
17 AC_MSG_ERROR(Need gmp)
20 if test "x$gmp_package" != "xyes"; then
22 if test ! -d "$GMP_DIR"; then
23 AC_ERROR(Directory given for GMP Distribution is not a directory)
25 CPPFLAGS="-I$GMP_DIR/include $CPPFLAGS"
26 LDFLAGS="-L$GMP_DIR/lib $LDFLAGS"
29 AC_CHECK_HEADER(gmp.h,
30 [AC_CHECK_LIB(gmp,main,
32 [poly_cv_gmpfatal="yes"])],
33 [poly_cv_gmpfatal="yes"])
34 if test "$poly_cv_gmpfatal" = "yes"; then
35 AC_MSG_ERROR([GMP not found])
38 AC_CHECK_DECL(mpz_divisible_p,[],[AC_LIBOBJ(mpz_divisible_p)],[#include <gmp.h>])
41 [ --with-polylib=DIR DIR Location of PolyLib],
42 [ echo "Package polylib : $withval" && polylib_package=$withval],
43 [ polylib_package=yes ])
45 if test "$polylib_package" = "no"; then
46 AC_MSG_ERROR(Need polylib)
49 if test "$polylib_package" != "yes"; then
50 CPPFLAGS="-I$polylib_package/include $CPPFLAGS"
51 LDFLAGS="-L$polylib_package/lib $LDFLAGS"
52 LD_LIBRARY_PATH="$polylib_package/lib:$LD_LIBRARY_PATH"
53 export LD_LIBRARY_PATH
56 AC_CHECK_LIB(polylibgmp, PolyhedronTSort,[],[
57 AC_MSG_ERROR(Need polylib)
59 AC_REPLACE_FUNCS(Enumeration_Free reduce_evalue)
61 #include <polylib/polylibgmp.h>
67 Matrix *M = Matrix_Alloc(6,5);
68 for (i = 0; i < 6; ++i) {
69 value_set_si(M->p[i][0], 1);
70 for (j = 1; j < 4; ++j)
71 value_set_si(M->p[i][j], (j-1 == i/2) * (1-2*(i%2)));
72 value_set_si(M->p[i][4], i%2);
74 P = Constraints2Polyhedron(M, 6);
75 return !(P->NbRays == 8);
78 [AC_DEFINE(HAVE_GROWING_CHERNIKOVA,[],
79 [PolyLib automatically grows the Chernikova table space])],
80 AC_MSG_WARN([This version of PolyLib does not automatically])
81 AC_MSG_WARN([enlarge the Chernikova table space]))
84 #include <polylib/polylibgmp.h>
88 enode *en = new_enode(polynomial, 1, 1);
89 return !(en->arr[0].x.p == NULL);
92 AC_MSG_WARN([This version of polylib leaks]))
96 #include <polylib/polylibgmp.h>
102 Param_Polyhedron *PP;
106 freopen("$srcdir/tests/ehrhart/t12.in", "r", stdin);
108 P = Constraints2Polyhedron(M, 1024);
110 C = Constraints2Polyhedron(M, 1024);
111 PP = Polyhedron2Param_SimplifiedDomain(&P, C, 1024, NULL, NULL);
112 for (i = 0, V = PP->V; V; ++i, V = V->next)
117 AC_MSG_WARN([This version of polylib produces incorrect vertices.]))
119 AC_MSG_CHECKING([number of arguments of Polyhedron_Enumerate])
120 AC_TRY_COMPILE([#include <polylib/polylibgmp.h>],
121 [Polyhedron_Enumerate(NULL,NULL,0,NULL)],
123 AC_DEFINE(HAVE_ENUMERATE4,[],
124 [Polyhedron_Enumerate takes four arguments])],
127 AC_MSG_CHECKING([number of arguments of count_points])
128 AC_TRY_COMPILE([#include <polylib/polylibgmp.h>],
129 [count_points(0,NULL,NULL,NULL)],
131 AC_DEFINE(HAVE_COUNT_POINTS4,[],
132 [count_points takes four arguments])],
136 [ --with-piplib=DIR DIR Location of PolyLib],
137 [ echo "Package piplib : $withval" && piplib_package=$withval],
138 [ piplib_package=yes ])
140 AC_SUBST(bv_extra_programs)
141 if test "$piplib_package" != "no"; then
142 if test "$piplib_package" != "yes"; then
143 CPPFLAGS="-I$piplib_package/include $CPPFLAGS"
144 LDFLAGS="-L$piplib_package/lib $LDFLAGS"
147 AC_CHECK_LIB(piplibMP, pip_solve,[
148 AC_DEFINE(HAVE_PIPLIB,[],[use piplib])
149 LIBS="-lpiplibMP $LIBS"
151 bv_extra_programs="piptest $bv_extra_programs"
153 AC_MSG_WARN([Piplib not found])
158 AC_MSG_CHECKING(if --enable-fractional option specified)
159 AC_ARG_ENABLE(fractional,
160 [ --enable-fractional Use fractional representation],
161 [bv_cv_fractional=$enableval], [bv_cv_fractional="no"])
162 AC_MSG_RESULT($bv_cv_fractional)
163 AC_MSG_CHECKING(if --enable-modulo option specified)
164 AC_ARG_ENABLE(modulo,
165 [ --enable-modulo Use fractional representation],
166 [bv_cv_modulo=$enableval], [bv_cv_modulo="no"])
167 AC_MSG_RESULT($bv_cv_modulo)
168 if test "x$bv_cv_modulo" != "xno" -o "x$bv_cv_fractional" != "xno"; then
169 AC_DEFINE(USE_MODULO,[], [Use fractional representation])
172 AC_MSG_CHECKING(whether to use incremental algorithm)
173 AC_ARG_ENABLE(incremental,
174 [ --disable-incremental Disable incremental algorithm],
175 [bv_cv_incremental=$enableval], [bv_cv_incremental="yes"])
176 AC_MSG_RESULT($bv_cv_incremental)
177 if test "x$bv_cv_incremental" = "xyes"; then
178 AC_DEFINE(USE_INCREMENTAL,[], [Use incremental algorithm])
182 [ --with-ntl=DIR DIR Location of NTL],
183 [ echo "Package ntl : $withval" && ntl_package=$withval],
186 if test "$ntl_package" = "no"; then
187 AC_MSG_ERROR(Need ntl)
190 if test "$ntl_package" != "yes"; then
191 CPPFLAGS="-I$ntl_package/include $CPPFLAGS"
192 LDFLAGS="-L$ntl_package/lib $LDFLAGS"
195 AC_CHECK_LIB(ntl, main,[],[
196 AC_MSG_ERROR(Need ntl)
199 AC_CONFIG_HEADERS(config.h)