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