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