Polyhedron_Sample: use lp solver for finding range of a variable
[barvinok.git] / Makefile.am
blob5d61c86fd9b96d091a83807e9e532e687d05a0ee
1 if HAVE_GINAC
2     MAYBE_BERNSTEIN = bernstein
3 endif
4 SUBDIRS = $(MAYBE_BERNSTEIN) lib . omega doc
6 lib/libgnu.la:
7         $(MAKE) $(AM_MAKEFLAGS) -C lib libgnu.la
8 bernstein/libbernstein.la:
9         $(MAKE) $(AM_MAKEFLAGS) -C bernstein libbernstein.la
11 AM_CPPFLAGS = -I$(srcdir)/bernstein/include -I$(srcdir)/lib @GINACLIB_CPPFLAGS@
12 AM_LDFLAGS = -Llib
14 lib_LTLIBRARIES = libbarvinok.la
15 bin_PROGRAMS = barvinok_count barvinok_enumerate barvinok_enumerate_e \
16                   barvinok_ehrhart
17 noinst_PROGRAMS = test testlib randomtest \
18                   remove_redundant_equalities \
19                   barvinok_union polytope_volume test_approx \
20                   barvinok_summate \
21                   @bv_extra_programs@
22 EXTRA_PROGRAMS = piptest verify_lexsmaller polyhedron_sample 4coins lexmin \
23                  polytope_scan barvinok_maximize
24 pkginclude_HEADERS = \
25     barvinok/NTL_QQ.h \
26     barvinok/barvinok.h \
27     barvinok/util.h \
28     barvinok/evalue.h \
29     barvinok/genfun.h \
30     barvinok/options.h \
31     barvinok/polylib.h \
32     barvinok/sample.h \
33     barvinok/basis_reduction.h \
34     barvinok/bernstein.h
35 nodist_pkginclude_HEADERS = \
36     barvinok/NTL.h \
37     barvinok/set.h
38 LINK = $(CXXLINK)
40 if HAVE_GINAC
41     BERNSTEIN_CC = bernstein.cc
42 endif
43 if HAVE_CDDLIB
44     BR_CDD = basis_reduction_cdd.cc initcdd.cc
45 endif
46 if HAVE_GLPK
47     BR_GLPK = basis_reduction_glpk.c
48 endif
49 if HAVE_CDDLIB
50     POLYSIGN = polysign_cddf.cc polysign_cdd.cc
51 endif
52 libbarvinok_la_SOURCES = \
53     barvinok/evalue.h \
54     barvinok/genfun.h \
55     barvinok/util.h \
56     barvinok/barvinok.h \
57     NTL_QQ.cc \
58     basis_reduction.c \
59     evalue.c \
60     genfun.cc \
61     util.c \
62     version.c \
63     bernoulli.c \
64     bernoulli.h \
65     bfcounter.cc \
66     bfcounter.h \
67     conversion.cc \
68     conversion.h \
69     counter.cc \
70     counter.h \
71     decomposer.cc \
72     decomposer.h \
73     dpoly.cc \
74     dpoly.h \
75     genfun_constructor.cc \
76     genfun_constructor.h \
77     lattice_point.cc \
78     lattice_point.h \
79     options.c \
80     param_util.c \
81     param_util.h \
82     $(POLYSIGN) \
83     polysign.c \
84     polysign_polylib.c \
85     polysign.h \
86     reduce_domain.c \
87     reduce_domain.h \
88     reducer.cc \
89     reducer.h \
90     remove_equalities.h \
91     scale.c \
92     scale.h \
93     scarf.cc \
94     tcounter.cc \
95     tcounter.h \
96     volume.c \
97     volume.h \
98     mat_util.cc \
99     mat_util.h \
100     barvinok.cc \
101     $(BERNSTEIN_CC) \
102     $(BR_CDD) \
103     $(BR_GLPK)
104 EXTRA_libbarvinok_la_SOURCES = \
105     basis_reduction_cdd.cc \
106     basis_reduction_glpk.c \
107     bernstein.cc \
108     piputil.h \
109     polysign_cddf.cc \
110     polysign_cdd.cc \
111     polysign.c \
112     initcdd.cc \
113     initcdd.h
114 if HAVE_GINAC
115     BERNSTEIN_LA = $(top_builddir)/bernstein/libbernstein.la
116 endif
117 libbarvinok_la_LIBADD = @LTLIBOBJS@ $(BERNSTEIN_LA) lib/libgnu.la
118 libbarvinok_la_LDFLAGS = @BV_LDFLAGS@ -version-info @versioninfo@
119 LDADD = libbarvinok.la
121 test_SOURCES = test.c
122 testlib_SOURCES = \
123         evalue_read.c \
124         evalue_read.h \
125         testlib.cc
126 barvinok_count_SOURCES = barvinok_count.c
127 barvinok_ehrhart_SOURCES = barvinok_ehrhart.cc
128 barvinok_union_SOURCES = barvinok_union.cc
129 if HAVE_OMEGA
130 BEEO_SOURCES = omega/Exit.cc omega/convert.cc
131 else
132 BEEO_SOURCES = 
133 endif
134 if USE_FDSTREAM
135 FDSTREAM = fdstream.cc fdstream.h
136 endif
137 barvinok_enumerate_SOURCES = \
138         barvinok_enumerate.cc \
139         evalue_convert.cc \
140         evalue_convert.h \
141         $(FDSTREAM) \
142         verify.h \
143         verify.c \
144         verif_ehrhart.h \
145         verif_ehrhart.c
146 EXTRA_barvinok_enumerate_SOURCES = fdstream.cc fdstream.h
147 barvinok_enumerate_e_SOURCES = \
148         barvinok_enumerate_e.cc \
149         evalue_convert.cc \
150         evalue_convert.h \
151         $(FDSTREAM) \
152         verify.h \
153         verify.c \
154         verif_ehrhart.h \
155         verif_ehrhart.c \
156         $(BEEO_SOURCES)
157 EXTRA_barvinok_enumerate_e_SOURCES = fdstream.cc fdstream.h
158 barvinok_enumerate_e_CPPFLAGS = @OMEGA_CPPFLAGS@ $(AM_CPPFLAGS)
159 barvinok_enumerate_e_LDFLAGS = @OMEGA_LDFLAGS@ @LDFLAGS@
160 barvinok_enumerate_e_LDADD = @OMEGA_LIBS@ libbarvinok.la
161 barvinok_maximize_SOURCES = \
162         evalue_convert.cc \
163         evalue_convert.h \
164         evalue_read.c \
165         evalue_read.h \
166         $(FDSTREAM) \
167         maximize.cc \
168         verify.h \
169         verify.c
170 EXTRA_barvinok_maximize_SOURCES = fdstream.cc fdstream.h
171 barvinok_summate_SOURCES = \
172         evalue_convert.cc \
173         evalue_convert.h \
174         evalue_read.c \
175         evalue_read.h \
176         $(FDSTREAM) \
177         summate.cc \
178         verify.h \
179         verify.c
180 EXTRA_barvinok_summate_SOURCES = fdstream.cc fdstream.h
181 4coins_SOURCES = 4coins.cc
182 lexmin_SOURCES = \
183         lexmin.h \
184         lexmin.cc \
185         combine.c \
186         combine.h \
187         edomain.cc \
188         edomain.h \
189         evalue_util.cc \
190         evalue_util.h \
191         verify.h \
192         verify.c
193 test_approx_SOURCES = \
194         test_approx.c \
195         verify.h \
196         verify.c
198 TESTFILES = $(shell find $(top_srcdir)/tests -type f ! -path '*CVS*')
200 EXTRA_DIST = \
201     ChangeLog \
202     $(TESTFILES) \
203     latte2polylib.pl \
204     NTL_5_3_2.patch \
205     basis_reduction_templ.c \
206     polysign_cdd_template.cc \
207     barvinok/NTL.h.broken \
208     barvinok/NTL.h.normal \
209     barvinok/set.h.broken \
210     barvinok/set.h.normal \
211     doc/Internal.tex \
212     doc/applications.tex \
213     doc/barvinok.tex \
214     doc/omega.tex \
215     doc/polymake.tex \
216     doc/reports.tex \
217     doc/barvinok.bib \
218     doc/barvinok.gdf \
219     doc/chicago.bst \
220     doc/chicago.sty \
221     doc/mydefs.sty \
222     polymake/Makefile.in \
223     polymake/README \
224     polymake/autogen.sh \
225     polymake/configure.in \
226     polymake/lattice_points.cc
228 ACLOCAL_AMFLAGS = -I m4
230 install-data-local:
231         @test -z "$(pkgconfig_libdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfig_libdir)"
232         $(INSTALL_DATA) $(pkgconfig_libfile) "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
234 uninstall-local:
235         rm -f "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
237 dist-hook:
238         (cd $(distdir)/polymake; \
239             ./autogen.sh; rm -rf autogen.sh autom4te.cache)
240         (cd doc; make barvinok.pdf)
241         cp doc/barvinok.pdf $(distdir)/doc/
242         if test -f $(top_srcdir)/.git/HEAD; then \
243             echo @GIT_HEAD_VERSION@ > $(distdir)/GIT_HEAD_ID; \
244         else \
245             echo $(GIT_HEAD_ID) > $(distdir)/GIT_HEAD_ID; \
246         fi
248 if HAVE_PIPLIB
249 BEE_TESTDIRS = ehrhart_e ehrhart_e/scarf ehrhart_e/piplib
250 else
251 BEE_TESTDIRS = ehrhart_e ehrhart_e/scarf
252 endif
254 check: check-testlib check-enumerate check-enumerate_e check-test \
255         check-lexmin check-approx check-evalue
256 check-testlib: testlib
257         ./testlib
258 check-approx: test_approx
259         @for i in $(top_srcdir)/tests/ehrhart/*; do \
260             if test -f $$i; then \
261                 echo $$i | ./test_approx -q -r 10 || exit; \
262             fi \
263         done
264 check-evalue: barvinok_maximize barvinok_summate
265         @for i in $(top_srcdir)/tests/evalue/*; do \
266             if test -f $$i; then \
267                 ./barvinok_maximize -T < $$i || exit; \
268                 ./barvinok_summate -T < $$i || exit; \
269             fi \
270         done
271 check-enumerate: barvinok_enumerate
272         @for i in $(top_srcdir)/tests/ehrhart/*; do \
273             if test -f $$i; then \
274                 echo $$i; \
275                 for options in '' '--series' '--series --primal'; do \
276                     for spec in 'random' 'bf' 'df'; do \
277                         opt="--specialization=$$spec $$options"; \
278                         echo "        $$opt"; \
279                         ./barvinok_enumerate --verify $$opt < $$i || exit; \
280                     done \
281                 done \
282             fi \
283         done
284 check-enumerate_e: barvinok_enumerate_e
285         @for dir in $(BEE_TESTDIRS); do \
286             for i in $(top_srcdir)/tests/$$dir/*; do \
287                 if test -f $$i; then \
288                     for options in '' '--pip' '--pip --omega'; do \
289                         for spec in 'random' 'bf' 'df'; do \
290                             opt="--specialization=$$spec $$options"; \
291                             echo $$i $$opt; \
292                             ./barvinok_enumerate_e --verify $$opt < $$i || exit; \
293                         done \
294                     done \
295                 fi \
296             done \
297         done
298         @for i in $(top_srcdir)/tests/ehrhart_e/scarf/*; do \
299             if test -f $$i; then \
300                 for spec in 'random' 'bf' 'df'; do \
301                     opt="--specialization=$$spec --scarf"; \
302                     echo $$i $$opt; \
303                     ./barvinok_enumerate_e --verify $$opt < $$i || exit; \
304                 done \
305             fi \
306         done
307 check-test: test
308         @for i in $(top_srcdir)/tests/*; do \
309             if test -f $$i; then \
310                 for options in '--index=10' '--primal --index=10'; do \
311                     for spec in 'random' 'bf' 'df' 'todd'; do \
312                         opt="--specialization=$$spec $$options"; \
313                         echo -n $$i $$opt; \
314                         ./test $$opt < $$i || echo -n " NOT"; \
315                         echo " ok"; \
316                     done \
317                 done \
318             fi \
319         done
320 if HAVE_GLPK
321 check-lexmin: lexmin
322         @for i in $(top_srcdir)/tests/lexmin/*; do \
323             if test -f $$i; then \
324                 for spec in 'random' 'bf' 'df'; do \
325                     opt="--specialization=$$spec"; \
326                     echo $$i $$opt; \
327                     ./lexmin --verify $$opt < $$i || exit; \
328                 done \
329             fi \
330         done
331 else
332 check-lexmin:
333 endif
335 version.h: @GIT_HEAD@
336         echo '#define GIT_HEAD_ID "'@GIT_HEAD_VERSION@'"' > $@