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