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