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