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