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