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