barvinok_enumerate: use verify infrastructure for verifying generating functions
[barvinok.git] / Makefile.am
blob64a04ddc93e72802d6fe7fc8811209cf64cee259
1 if HAVE_GINAC
2     MAYBE_BERNSTEIN = bernstein
3 endif
4 if BUNDLED_POLYLIB
5     MAYBE_POLYLIB = polylib
6 endif
7 if BUNDLED_PIPLIB
8     MAYBE_PIPLIB = piplib
9 endif
10 SUBDIRS = $(MAYBE_PIPLIB) $(MAYBE_POLYLIB) $(MAYBE_BERNSTEIN) lib . omega doc
12 FORCE:
13 lib/libgnu.la: FORCE
14         $(MAKE) $(AM_MAKEFLAGS) -C lib libgnu.la
15 bernstein/libbernstein.la: FORCE
16         $(MAKE) $(AM_MAKEFLAGS) -C bernstein libbernstein.la
17 polylib/libpolylibgmp.la: FORCE
18         $(MAKE) $(AM_MAKEFLAGS) -C polylib libpolylibgmp.la
19 piplib/libpiplibMP.la: FORCE
20         $(MAKE) $(AM_MAKEFLAGS) -C piplib libpiplibMP.la
22 AM_CPPFLAGS = -I$(srcdir)/bernstein/include -I$(srcdir)/lib \
23               @POLYLIB_CPPFLAGS@ @PIPLIB_CPPFLAGS@ @GINACLIB_CPPFLAGS@
24 AM_LDFLAGS = -Llib @POLYLIB_LDFLAGS@ @PIPLIB_LDFLAGS@
26 lib_LTLIBRARIES = libbarvinok.la
27 bin_PROGRAMS = barvinok_count barvinok_enumerate barvinok_enumerate_e \
28                   barvinok_ehrhart polytope_scan
29 noinst_PROGRAMS = test testlib randomtest \
30                   remove_redundant_equalities \
31                   barvinok_union polytope_volume test_approx \
32                   barvinok_summate verify_lexsmaller piptest \
33                   polyhedron_sample 4coins lexmin @bv_barvinok_maximize@
34 EXTRA_PROGRAMS = barvinok_maximize
35 pkginclude_HEADERS = \
36     barvinok/NTL_QQ.h \
37     barvinok/barvinok.h \
38     barvinok/util.h \
39     barvinok/evalue.h \
40     barvinok/genfun.h \
41     barvinok/options.h \
42     barvinok/polylib.h \
43     barvinok/sample.h \
44     barvinok/basis_reduction.h \
45     barvinok/bernstein.h
46 nodist_pkginclude_HEADERS = \
47     barvinok/NTL.h \
48     barvinok/set.h
49 LINK = $(CXXLINK)
51 if HAVE_GINAC
52     BERNSTEIN_CC = bernstein.cc
53 endif
54 if HAVE_CDDLIB
55     BR_CDD = basis_reduction_cdd.cc initcdd.cc
56     POLYSIGN_CDD = polysign_cddf.cc polysign_cdd.cc
57 endif
58 if HAVE_GLPK
59     BR_GLPK = basis_reduction_glpk.c
60     POLYSIGN_GLPK = polysign_glpk.c
61 endif
62 if HAVE_TOPCOM
63     TOPCOM = topcom.c topcom.h
64 endif
65 libbarvinok_la_SOURCES = \
66     barvinok/evalue.h \
67     barvinok/genfun.h \
68     barvinok/util.h \
69     barvinok/barvinok.h \
70     NTL_QQ.cc \
71     basis_reduction.c \
72     basis_reduction_pip.c \
73     basis_reduction_pip_dual.c \
74     evalue.c \
75     genfun.cc \
76     util.c \
77     version.c \
78     bernoulli.c \
79     bernoulli.h \
80     bfcounter.cc \
81     bfcounter.h \
82     conversion.cc \
83     conversion.h \
84     counter.cc \
85     counter.h \
86     decomposer.cc \
87     decomposer.h \
88     dpoly.cc \
89     dpoly.h \
90     euler.cc \
91     euler.h \
92     genfun_constructor.cc \
93     genfun_constructor.h \
94     lattice_point.cc \
95     lattice_point.h \
96     options.c \
97     param_util.c \
98     param_util.h \
99     piputil.h \
100     piputil.c \
101     $(POLYSIGN_CDD) \
102     $(POLYSIGN_GLPK) \
103     polysign.c \
104     polysign_polylib.c \
105     polysign.h \
106     reduce_domain.c \
107     reduce_domain.h \
108     reducer.cc \
109     reducer.h \
110     remove_equalities.h \
111     remove_equalities.c \
112     sample.c \
113     scale.c \
114     scale.h \
115     scarf.cc \
116     series.cc \
117     tcounter.cc \
118     tcounter.h \
119     $(TOPCOM) \
120     volume.c \
121     volume.h \
122     mat_util.cc \
123     mat_util.h \
124     matrix_read.cc \
125     matrix_read.h \
126     barvinok.cc \
127     barvinok_e.cc \
128     $(BERNSTEIN_CC) \
129     $(BR_CDD) \
130     $(BR_GLPK)
131 EXTRA_libbarvinok_la_SOURCES = \
132     basis_reduction_cdd.cc \
133     basis_reduction_glpk.c \
134     bernstein.cc \
135     polysign_cddf.cc \
136     polysign_cdd.cc \
137     polysign.c \
138     initcdd.cc \
139     initcdd.h \
140     topcom.c \
141     topcom.h
142 if HAVE_GINAC
143     BERNSTEIN_LA = $(top_builddir)/bernstein/libbernstein.la
144 endif
145 if BUNDLED_POLYLIB
146     POLYLIB_LA = $(top_builddir)/polylib/libpolylibgmp.la
147 endif
148 if BUNDLED_PIPLIB
149     PIPLIB_LA = $(top_builddir)/piplib/libpiplibMP.la
150 endif
151 libbarvinok_la_LIBADD = @LTLIBOBJS@ $(POLYLIB_LA) @POLYLIB_LIBS@ \
152                         $(PIPLIB_LA) @PIPLIB_LIBS@ $(BERNSTEIN_LA) \
153                         lib/libgnu.la
154 libbarvinok_la_LDFLAGS = @BV_LDFLAGS@ -version-info @versioninfo@
155 LDADD = libbarvinok.la @POLYLIB_LIBS@ @PIPLIB_LIBS@
157 test_SOURCES = test.c
158 testlib_SOURCES = \
159         evalue_read.c \
160         evalue_read.h \
161         testlib.cc
162 barvinok_count_SOURCES = barvinok_count.c
163 barvinok_ehrhart_SOURCES = barvinok_ehrhart.cc
164 barvinok_union_SOURCES = barvinok_union.cc
165 if HAVE_OMEGA
166 BEEO_SOURCES = omega/Exit.cc omega/convert.cc
167 else
168 BEEO_SOURCES = 
169 endif
170 if USE_FDSTREAM
171 FDSTREAM = fdstream.cc fdstream.h
172 endif
173 barvinok_enumerate_SOURCES = \
174         barvinok_enumerate.cc \
175         evalue_convert.cc \
176         evalue_convert.h \
177         $(FDSTREAM) \
178         skewed_genfun.cc \
179         skewed_genfun.h \
180         verify.h \
181         verify.c \
182         verif_ehrhart.h \
183         verif_ehrhart.c \
184         verify_series.h \
185         verify_series.cc
186 EXTRA_barvinok_enumerate_SOURCES = fdstream.cc fdstream.h
187 barvinok_enumerate_e_SOURCES = \
188         barvinok_enumerate_e.cc \
189         evalue_convert.cc \
190         evalue_convert.h \
191         $(FDSTREAM) \
192         verify.h \
193         verify.c \
194         verif_ehrhart.h \
195         verif_ehrhart.c \
196         $(BEEO_SOURCES)
197 EXTRA_barvinok_enumerate_e_SOURCES = fdstream.cc fdstream.h
198 barvinok_enumerate_e_CPPFLAGS = @OMEGA_CPPFLAGS@ $(AM_CPPFLAGS)
199 barvinok_enumerate_e_LDFLAGS = @OMEGA_LDFLAGS@ @LDFLAGS@
200 barvinok_enumerate_e_LDADD = @OMEGA_LIBS@ libbarvinok.la @POLYLIB_LIBS@ @PIPLIB_LIBS@
201 barvinok_maximize_SOURCES = \
202         evalue_convert.cc \
203         evalue_convert.h \
204         evalue_read.c \
205         evalue_read.h \
206         $(FDSTREAM) \
207         maximize.cc \
208         verify.h \
209         verify.c
210 EXTRA_barvinok_maximize_SOURCES = fdstream.cc fdstream.h
211 barvinok_summate_SOURCES = \
212         evalue_convert.cc \
213         evalue_convert.h \
214         evalue_read.c \
215         evalue_read.h \
216         $(FDSTREAM) \
217         summate.cc \
218         verify.h \
219         verify.c
220 EXTRA_barvinok_summate_SOURCES = fdstream.cc fdstream.h
221 4coins_SOURCES = 4coins.cc
222 lexmin_SOURCES = \
223         lexmin.h \
224         lexmin.cc \
225         combine.c \
226         combine.h \
227         edomain.cc \
228         edomain.h \
229         evalue_util.cc \
230         evalue_util.h \
231         verify.h \
232         verify.c
233 test_approx_SOURCES = \
234         test_approx.c \
235         verify.h \
236         verify.c
238 TESTFILES = $(shell find $(top_srcdir)/tests -type f ! -path '*CVS*')
240 EXTRA_DIST = \
241     ChangeLog \
242     $(TESTFILES) \
243     latte2polylib.pl \
244     NTL_5_3_2.patch \
245     basis_reduction_templ.c \
246     polysign_cdd_template.cc \
247     barvinok/NTL.h.broken \
248     barvinok/NTL.h.normal \
249     barvinok/set.h.broken \
250     barvinok/set.h.normal \
251     doc/Internal.tex \
252     doc/applications.tex \
253     doc/barvinok.tex \
254     doc/omega.tex \
255     doc/polymake.tex \
256     doc/reports.tex \
257     doc/barvinok.bib \
258     doc/barvinok.gdf \
259     doc/chicago.bst \
260     doc/chicago.sty \
261     doc/mydefs.sty \
262     polymake/Makefile.in \
263     polymake/README \
264     polymake/autogen.sh \
265     polymake/configure.in \
266     polymake/convert.cc \
267     polymake/convert.h \
268     polymake/h_star_vector.cc \
269     polymake/lattice_points.cc
271 ACLOCAL_AMFLAGS = -I m4
273 install-data-local:
274         @test -z "$(pkgconfig_libdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfig_libdir)"
275         $(INSTALL_DATA) $(pkgconfig_libfile) "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
277 uninstall-local:
278         rm -f "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
280 dist-hook:
281         (cd $(distdir)/polymake; \
282             ./autogen.sh; rm -rf autogen.sh autom4te.cache)
283         (cd doc; make barvinok.pdf)
284         cp doc/barvinok.pdf $(distdir)/doc/
285         if test -f $(top_srcdir)/.git/HEAD; then \
286             echo @GIT_HEAD_VERSION@ > $(distdir)/GIT_HEAD_ID; \
287         else \
288             echo $(GIT_HEAD_ID) > $(distdir)/GIT_HEAD_ID; \
289         fi
291 dist-git: dist
292         mv $(distdir).tar.gz @GIT_HEAD_VERSION@.tar.gz
294 BEE_TESTDIRS = ehrhart_e ehrhart_e/scarf ehrhart_e/piplib
296 check: check-testlib check-enumerate check-enumerate_e check-test \
297         check-lexmin check-approx check-evalue check-euler
298 check-testlib: testlib$(EXEEXT)
299         ./testlib$(EXEEXT)
300 check-approx: test_approx$(EXEEXT)
301         @for i in $(top_srcdir)/tests/ehrhart/*; do \
302             if test -f $$i; then \
303                 echo $$i | ./test_approx$(EXEEXT) -q -r 10 || exit; \
304             fi \
305         done
306 check-evalue: @bv_barvinok_maximize@ barvinok_summate$(EXEEXT)
307         @for i in $(top_srcdir)/tests/evalue/*; do \
308             if test -f $$i; then \
309                 echo $$i; \
310                 if test -n "@bv_barvinok_maximize@"; then \
311                     ./barvinok_maximize$(EXEEXT) -T < $$i || exit; \
312                 fi; \
313                 ./barvinok_summate$(EXEEXT) -T < $$i || exit; \
314             fi \
315         done
316 check-euler: barvinok_summate$(EXEEXT)
317         @for i in $(top_srcdir)/tests/euler/*; do \
318             if test -f $$i; then \
319                 echo $$i; \
320                 ./barvinok_summate$(EXEEXT) -T --summation=euler < $$i || exit; \
321             fi \
322         done
323 if HAVE_TOPCOM
324     TOPCOM_CD = '--chamber-decomposition=topcom'
325 endif
326 check-enumerate: barvinok_enumerate$(EXEEXT)
327         @for i in $(top_srcdir)/tests/ehrhart/*; do \
328             if test -f $$i; then \
329                 echo $$i; \
330                 for options in '' '--series' '--series --primal' $(TOPCOM_CD); do \
331                     for spec in 'random' 'bf' 'df'; do \
332                         opt="--specialization=$$spec $$options"; \
333                         echo "        $$opt"; \
334                         ./barvinok_enumerate$(EXEEXT) --verify $$opt < $$i || exit; \
335                     done \
336                 done \
337             fi \
338         done
339 check-enumerate_e: barvinok_enumerate_e$(EXEEXT)
340         @for dir in $(BEE_TESTDIRS); do \
341             for i in $(top_srcdir)/tests/$$dir/*; do \
342                 if test -f $$i; then \
343                     for options in '' '--pip' '--pip --omega'; do \
344                         for spec in 'random' 'bf' 'df'; do \
345                             opt="--specialization=$$spec $$options"; \
346                             echo $$i $$opt; \
347                             ./barvinok_enumerate_e$(EXEEXT) --verify $$opt < $$i || exit; \
348                         done \
349                     done \
350                 fi \
351             done \
352         done
353         @for i in $(top_srcdir)/tests/ehrhart_e/scarf/*; do \
354             if test -f $$i; then \
355                 for spec in 'random' 'bf' 'df'; do \
356                     opt="--specialization=$$spec --scarf"; \
357                     echo $$i $$opt; \
358                     ./barvinok_enumerate_e$(EXEEXT) --verify $$opt < $$i || exit; \
359                 done \
360             fi \
361         done
362 check-test: test$(EXEEXT)
363         @for i in $(top_srcdir)/tests/*; do \
364             if test -f $$i; then \
365                 for options in '--index=10' '--primal --index=10'; do \
366                     for spec in 'random' 'bf' 'df' 'todd'; do \
367                         opt="--specialization=$$spec $$options"; \
368                         echo -n $$i $$opt; \
369                         ./test$(EXEEXT) $$opt < $$i || echo -n " NOT"; \
370                         echo " ok"; \
371                     done \
372                 done \
373             fi \
374         done
375 if HAVE_GLPK
376 check-lexmin: lexmin$(EXEEXT)
377         @for i in $(top_srcdir)/tests/lexmin/*; do \
378             if test -f $$i; then \
379                 for spec in 'random' 'bf' 'df'; do \
380                     opt="--specialization=$$spec"; \
381                     echo $$i $$opt; \
382                     ./lexmin$(EXEEXT) --verify $$opt < $$i || exit; \
383                 done \
384             fi \
385         done
386 else
387 check-lexmin:
388 endif
390 version.h: @GIT_HEAD@
391         echo '#define GIT_HEAD_ID "'@GIT_HEAD_VERSION@'"' > $@