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