bernstein: add piecewise_lst::is_equal
[barvinok.git] / Makefile.am
blob27a0a7c4b021c90c058533db2e8940f93f24c80e
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
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 = \
165         evalue_read.c \
166         evalue_read.h \
167         test.c
168 testlib_SOURCES = \
169         evalue_read.c \
170         evalue_read.h \
171         testlib.cc
172 barvinok_count_SOURCES = barvinok_count.c
173 barvinok_ehrhart_SOURCES = barvinok_ehrhart.cc
174 barvinok_union_SOURCES = barvinok_union.cc
175 if HAVE_OMEGA
176 BEEO_SOURCES = omega/Exit.cc omega/convert.cc
177 else
178 BEEO_SOURCES = 
179 endif
180 if USE_FDSTREAM
181 FDSTREAM = fdstream.cc fdstream.h
182 endif
183 barvinok_enumerate_SOURCES = \
184         barvinok_enumerate.cc \
185         evalue_convert.cc \
186         evalue_convert.h \
187         $(FDSTREAM) \
188         skewed_genfun.cc \
189         skewed_genfun.h \
190         verify.h \
191         verify.c \
192         verif_ehrhart.h \
193         verif_ehrhart.c \
194         verify_series.h \
195         verify_series.cc
196 EXTRA_barvinok_enumerate_SOURCES = fdstream.cc fdstream.h
197 barvinok_enumerate_e_SOURCES = \
198         barvinok_enumerate_e.cc \
199         evalue_convert.cc \
200         evalue_convert.h \
201         $(FDSTREAM) \
202         skewed_genfun.cc \
203         skewed_genfun.h \
204         verify.h \
205         verify.c \
206         verif_ehrhart.h \
207         verif_ehrhart.c \
208         verify_series.h \
209         verify_series.cc \
210         $(BEEO_SOURCES)
211 EXTRA_barvinok_enumerate_e_SOURCES = fdstream.cc fdstream.h
212 barvinok_enumerate_e_CPPFLAGS = @OMEGA_CPPFLAGS@ $(AM_CPPFLAGS)
213 barvinok_enumerate_e_LDFLAGS = @OMEGA_LDFLAGS@ @LDFLAGS@
214 barvinok_enumerate_e_LDADD = @OMEGA_LIBS@ libbarvinok.la @POLYLIB_LIBS@ @PIPLIB_LIBS@
215 barvinok_maximize_SOURCES = \
216         evalue_convert.cc \
217         evalue_convert.h \
218         evalue_read.c \
219         evalue_read.h \
220         $(FDSTREAM) \
221         maximize.cc \
222         verify.h \
223         verify.c
224 EXTRA_barvinok_maximize_SOURCES = fdstream.cc fdstream.h
225 barvinok_summate_SOURCES = \
226         evalue_convert.cc \
227         evalue_convert.h \
228         evalue_read.c \
229         evalue_read.h \
230         $(FDSTREAM) \
231         summate.cc \
232         verify.h \
233         verify.c
234 EXTRA_barvinok_summate_SOURCES = fdstream.cc fdstream.h
235 4coins_SOURCES = 4coins.cc
236 lexmin_SOURCES = \
237         lexmin.h \
238         lexmin.cc \
239         combine.c \
240         combine.h \
241         edomain.cc \
242         edomain.h \
243         evalue_util.cc \
244         evalue_util.h \
245         verify.h \
246         verify.c
247 test_approx_SOURCES = \
248         test_approx.c \
249         verify.h \
250         verify.c
252 TESTFILES = $(shell find $(top_srcdir)/tests -type f ! -path '*CVS*')
254 EXTRA_DIST = \
255     ChangeLog \
256     $(TESTFILES) \
257     latte2polylib.pl \
258     NTL_5_3_2.patch \
259     basis_reduction_templ.c \
260     polysign_cdd_template.cc \
261     barvinok/NTL.h.broken \
262     barvinok/NTL.h.normal \
263     barvinok/set.h.broken \
264     barvinok/set.h.normal \
265     doc/Internal.tex \
266     doc/applications.tex \
267     doc/barvinok.tex \
268     doc/omega.tex \
269     doc/polymake.tex \
270     doc/reports.tex \
271     doc/barvinok.bib \
272     doc/barvinok.gdf \
273     doc/chicago.bst \
274     doc/chicago.sty \
275     doc/mydefs.sty \
276     polymake/Makefile.in \
277     polymake/README \
278     polymake/autogen.sh \
279     polymake/configure.in \
280     polymake/convert.cc \
281     polymake/convert.h \
282     polymake/h_star_vector.cc \
283     polymake/lattice_points.cc
285 ACLOCAL_AMFLAGS = -I m4
287 install-data-local:
288         @test -z "$(pkgconfig_libdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfig_libdir)"
289         $(INSTALL_DATA) $(pkgconfig_libfile) "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
291 uninstall-local:
292         rm -f "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
294 dist-hook:
295         (cd $(distdir)/polymake; \
296             ./autogen.sh; rm -rf autogen.sh autom4te.cache)
297         (cd doc; make barvinok.pdf)
298         cp doc/barvinok.pdf $(distdir)/doc/
299         if test -f $(top_srcdir)/.git/HEAD; then \
300             echo @GIT_HEAD_VERSION@ > $(distdir)/GIT_HEAD_ID; \
301         else \
302             echo $(GIT_HEAD_ID) > $(distdir)/GIT_HEAD_ID; \
303         fi
305 dist-git: dist
306         mv $(distdir).tar.gz @GIT_HEAD_VERSION@.tar.gz
308 BEE_TESTDIRS = ehrhart_e ehrhart_e/scarf ehrhart_e/piplib
310 check: check-testlib check-enumerate check-enumerate_e check-test \
311         check-lexmin check-approx check-evalue check-euler check-lw
312 check-testlib: testlib$(EXEEXT)
313         ./testlib$(EXEEXT)
314 check-approx: test_approx$(EXEEXT)
315         @for i in $(top_srcdir)/tests/ehrhart/*; do \
316             if test -f $$i; then \
317                 echo $$i | ./test_approx$(EXEEXT) -q -r 10 || exit; \
318             fi \
319         done
320 check-evalue: @bv_barvinok_maximize@ barvinok_summate$(EXEEXT)
321         @for i in $(top_srcdir)/tests/evalue/*; do \
322             if test -f $$i; then \
323                 echo $$i; \
324                 if test -n "@bv_barvinok_maximize@"; then \
325                     ./barvinok_maximize$(EXEEXT) -T < $$i || exit; \
326                 fi; \
327                 ./barvinok_summate$(EXEEXT) -T < $$i || exit; \
328             fi \
329         done
330 check-euler: barvinok_summate$(EXEEXT)
331         @for i in $(top_srcdir)/tests/euler/*; do \
332             if test -f $$i; then \
333                 echo $$i; \
334                 ./barvinok_summate$(EXEEXT) -T --summation=euler < $$i || exit; \
335             fi \
336         done
337 if HAVE_TOPCOM
338     TOPCOM_CD = '--chamber-decomposition=topcom'
339 endif
340 check-enumerate: barvinok_enumerate$(EXEEXT)
341         @for i in $(top_srcdir)/tests/ehrhart/*; do \
342             if test -f $$i; then \
343                 echo $$i; \
344                 for options in '' '--series' '--series --primal' $(TOPCOM_CD); do \
345                     for spec in 'random' 'bf' 'df'; do \
346                         opt="--specialization=$$spec $$options"; \
347                         echo "        $$opt"; \
348                         ./barvinok_enumerate$(EXEEXT) --verify $$opt < $$i || exit; \
349                     done \
350                 done \
351             fi \
352         done
353 check-enumerate_e: barvinok_enumerate_e$(EXEEXT)
354         @for dir in $(BEE_TESTDIRS); do \
355             for i in $(top_srcdir)/tests/$$dir/*; do \
356                 if test -f $$i; then \
357                     for options in '' '--pip' '--pip --omega'; do \
358                         for spec in 'random' 'bf' 'df'; do \
359                             opt="--specialization=$$spec $$options"; \
360                             echo $$i $$opt; \
361                             ./barvinok_enumerate_e$(EXEEXT) --verify $$opt < $$i || exit; \
362                         done \
363                     done \
364                 fi \
365             done \
366         done
367         @for i in $(top_srcdir)/tests/ehrhart_e/scarf/*; do \
368             if test -f $$i; then \
369                 for spec in 'random' 'bf' 'df'; do \
370                     opt="--specialization=$$spec --scarf"; \
371                     echo $$i $$opt; \
372                     ./barvinok_enumerate_e$(EXEEXT) --verify $$opt < $$i || exit; \
373                 done \
374             fi \
375         done
376 check-test: test$(EXEEXT)
377         @for i in $(top_srcdir)/tests/*; do \
378             if test -f $$i; then \
379                 for options in '--index=10' '--primal --index=10'; do \
380                     for spec in 'random' 'bf' 'df' 'todd'; do \
381                         opt="--specialization=$$spec $$options"; \
382                         echo -n $$i $$opt; \
383                         ./test$(EXEEXT) $$opt < $$i || echo -n " NOT"; \
384                         echo " ok"; \
385                     done \
386                 done \
387             fi \
388         done
389 check-lw: test$(EXEEXT)
390         @for i in $(top_srcdir)/tests/lattice_width/*; do \
391             if test -f $$i; then \
392                 echo -n $$i; \
393                 ./test$(EXEEXT) < $$i || echo -n " NOT"; \
394                 echo " ok"; \
395             fi \
396         done
397 if HAVE_GLPK
398 check-lexmin: lexmin$(EXEEXT)
399         @for i in $(top_srcdir)/tests/lexmin/*; do \
400             if test -f $$i; then \
401                 for spec in 'random' 'bf' 'df'; do \
402                     opt="--specialization=$$spec"; \
403                     echo $$i $$opt; \
404                     ./lexmin$(EXEEXT) --verify $$opt < $$i || exit; \
405                 done \
406             fi \
407         done
408 else
409 check-lexmin:
410 endif
412 version.h: @GIT_HEAD@
413         echo '#define GIT_HEAD_ID "'@GIT_HEAD_VERSION@'"' > $@