standard_constraints: take constraints instead of polyhedron as input
[barvinok.git] / Makefile.am
blobd997fc74431fbe3304e2b1d477fe3adfaef146c3
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 if USE_ZSOLVE
11     MAYBE_ZSOLVE = zsolve
12 endif
13 if USE_PARKER
14     MAYBE_PARKER = parker
15 endif
16 SUBDIRS = $(MAYBE_PIPLIB) $(MAYBE_POLYLIB) $(MAYBE_BERNSTEIN) \
17                 lib $(MAYBE_ZSOLVE) $(MAYBE_PARKER) . omega doc
19 FORCE:
20 lib/libgnu.la: FORCE
21         $(MAKE) $(AM_MAKEFLAGS) -C lib libgnu.la
22 bernstein/libbernstein.la: FORCE
23         $(MAKE) $(AM_MAKEFLAGS) -C bernstein libbernstein.la
24 polylib/libpolylibgmp.la: FORCE
25         $(MAKE) $(AM_MAKEFLAGS) -C polylib libpolylibgmp.la
26 piplib/libpiplibMP.la: FORCE
27         $(MAKE) $(AM_MAKEFLAGS) -C piplib libpiplibMP.la
28 zsolve/libzsolve.la: FORCE
29         $(MAKE) $(AM_MAKEFLAGS) -C zsolve libzsolve.la
31 AM_CPPFLAGS = -I$(srcdir)/bernstein/include -I$(srcdir)/lib \
32               @POLYLIB_CPPFLAGS@ @PIPLIB_CPPFLAGS@ @ginac_CFLAGS@
33 AM_LDFLAGS = -Llib @POLYLIB_LDFLAGS@ @PIPLIB_LDFLAGS@
35 lib_LTLIBRARIES = libbarvinok-core.la libbarvinok.la
36 bin_PROGRAMS = barvinok_count barvinok_enumerate barvinok_enumerate_e \
37                   barvinok_ehrhart polytope_scan
38 noinst_PROGRAMS = test testlib randomtest \
39                   remove_redundant_equalities \
40                   barvinok_union polytope_volume test_approx \
41                   barvinok_summate verify_lexsmaller piptest \
42                   polyhedron_sample 4coins lexmin @bv_barvinok_bound@ \
43                   @bv_cone_hilbert_basis@ cone_integer_hull \
44                   polytope_lattice_width polytope_minimize \
45                   polyhedron_integer_hull
46 EXTRA_PROGRAMS = barvinok_bound test_bound cone_hilbert_basis
47 pkginclude_HEADERS = \
48     barvinok/NTL_QQ.h \
49     barvinok/barvinok.h \
50     barvinok/util.h \
51     barvinok/evalue.h \
52     barvinok/genfun.h \
53     barvinok/options.h \
54     barvinok/polylib.h \
55     barvinok/sample.h \
56     barvinok/basis_reduction.h \
57     barvinok/bernstein.h
58 nodist_pkginclude_HEADERS = \
59     barvinok/NTL.h \
60     barvinok/set.h
61 LINK = $(CXXLINK)
63 if HAVE_CDDLIB
64     BR_CDD = basis_reduction_cdd.cc initcdd.cc
65     POLYSIGN_CDD = polysign_cddf.cc polysign_cdd.cc
66 endif
67 if HAVE_GLPK
68     BR_GLPK = basis_reduction_glpk.c
69     POLYSIGN_GLPK = polysign_glpk.c
70 endif
71 if HAVE_TOPCOM
72     TOPCOM = topcom.c topcom.h
73 endif
74 if USE_ZSOLVE
75     HILBERT_C = hilbert.c
76 endif
77 libbarvinok_core_la_SOURCES = \
78     barvinok/evalue.h \
79     barvinok/genfun.h \
80     barvinok/util.h \
81     barvinok/barvinok.h \
82     NTL_QQ.cc \
83     basis_reduction.c \
84     basis_reduction_pip.c \
85     basis_reduction_pip_dual.c \
86     evalue.c \
87     genfun.cc \
88     util.c \
89     version.c \
90     bernoulli.c \
91     bernoulli.h \
92     bfcounter.cc \
93     bfcounter.h \
94     conversion.cc \
95     conversion.h \
96     counter.cc \
97     counter.h \
98     decomposer.cc \
99     decomposer.h \
100     dpoly.cc \
101     dpoly.h \
102     euler.cc \
103     euler.h \
104     genfun_constructor.cc \
105     genfun_constructor.h \
106     $(HILBERT_C) \
107     hilbert.h \
108     hull.c \
109     hull.h \
110     ilp.c \
111     ilp.h \
112     lattice_point.cc \
113     lattice_point.h \
114     lattice_width.c \
115     lattice_width.h \
116     normalization.c \
117     normalization.h \
118     options.c \
119     param_util.c \
120     param_util.h \
121     piputil.h \
122     piputil.c \
123     $(POLYSIGN_CDD) \
124     $(POLYSIGN_GLPK) \
125     polysign.c \
126     polysign_pip.c \
127     polysign_polylib.c \
128     polysign.h \
129     reduce_domain.c \
130     reduce_domain.h \
131     reducer.cc \
132     reducer.h \
133     remove_equalities.h \
134     remove_equalities.c \
135     sample.c \
136     scale.c \
137     scale.h \
138     scarf.cc \
139     series.cc \
140     $(TOPCOM) \
141     volume.c \
142     volume.h \
143     mat_util.cc \
144     mat_util.h \
145     matrix_read.cc \
146     matrix_read.h \
147     barvinok.cc \
148     barvinok_e.cc \
149     $(BR_CDD) \
150     $(BR_GLPK)
151 EXTRA_libbarvinok_la_SOURCES = \
152     basis_reduction_cdd.cc \
153     basis_reduction_glpk.c \
154     range.cc \
155     range.h \
156     bernstein.cc \
157     hilbert.c \
158     polysign_cddf.cc \
159     polysign_cdd.cc \
160     polysign.c \
161     initcdd.cc \
162     initcdd.h \
163     topcom.c \
164     topcom.h
165 if BUNDLED_POLYLIB
166     POLYLIB_LA = $(top_builddir)/polylib/libpolylibgmp.la
167 endif
168 if BUNDLED_PIPLIB
169     PIPLIB_LA = $(top_builddir)/piplib/libpiplibMP.la
170 endif
171 if USE_ZSOLVE
172     ZSOLVE_LA = zsolve/libzsolve.la
173 endif
174 libbarvinok_core_la_LIBADD = @LTLIBOBJS@ $(POLYLIB_LA) @POLYLIB_LIBS@ \
175                              $(PIPLIB_LA) @PIPLIB_LIBS@ \
176                              $(ZSOLVE_LA) lib/libgnu.la
177 libbarvinok_core_la_LDFLAGS = @BV_LDFLAGS@ -version-info @versioninfo@
178 if HAVE_GINAC
179     BERNSTEIN_CC = bernstein.cc range.cc
180 endif
181 libbarvinok_la_SOURCES = \
182     $(BERNSTEIN_CC)
183 if HAVE_GINAC
184     BERNSTEIN_LA = $(top_builddir)/bernstein/libbernstein.la
185 endif
186 libbarvinok_la_LIBADD = libbarvinok-core.la $(BERNSTEIN_LA)
187 libbarvinok_la_LDFLAGS = @BV_LDFLAGS@ -version-info @versioninfo@
188 LDADD = libbarvinok-core.la @POLYLIB_LIBS@ @PIPLIB_LIBS@
190 test_SOURCES = \
191         evalue_read.c \
192         evalue_read.h \
193         test.c
194 testlib_SOURCES = \
195         evalue_read.c \
196         evalue_read.h \
197         testlib.cc
198 barvinok_count_SOURCES = barvinok_count.c
199 barvinok_ehrhart_SOURCES = barvinok_ehrhart.cc
200 barvinok_union_SOURCES = barvinok_union.cc
201 if HAVE_OMEGA
202 BEEO_SOURCES = omega/Exit.cc omega/convert.cc
203 else
204 BEEO_SOURCES = 
205 endif
206 if USE_FDSTREAM
207 FDSTREAM = fdstream.cc fdstream.h
208 endif
209 barvinok_enumerate_SOURCES = \
210         barvinok_enumerate.cc \
211         evalue_convert.cc \
212         evalue_convert.h \
213         $(FDSTREAM) \
214         skewed_genfun.cc \
215         skewed_genfun.h \
216         verify.h \
217         verify.c \
218         verif_ehrhart.h \
219         verif_ehrhart.c \
220         verify_series.h \
221         verify_series.cc
222 EXTRA_barvinok_enumerate_SOURCES = fdstream.cc fdstream.h
223 barvinok_enumerate_e_SOURCES = \
224         barvinok_enumerate_e.cc \
225         evalue_convert.cc \
226         evalue_convert.h \
227         $(FDSTREAM) \
228         skewed_genfun.cc \
229         skewed_genfun.h \
230         verify.h \
231         verify.c \
232         verif_ehrhart.h \
233         verif_ehrhart.c \
234         verify_series.h \
235         verify_series.cc \
236         $(BEEO_SOURCES)
237 EXTRA_barvinok_enumerate_e_SOURCES = fdstream.cc fdstream.h
238 barvinok_enumerate_e_CPPFLAGS = @OMEGA_CPPFLAGS@ $(AM_CPPFLAGS)
239 barvinok_enumerate_e_LDFLAGS = @OMEGA_LDFLAGS@ @LDFLAGS@
240 barvinok_enumerate_e_LDADD = \
241         @OMEGA_LIBS@ libbarvinok-core.la \
242         @POLYLIB_LIBS@ @PIPLIB_LIBS@
243 barvinok_bound_SOURCES = \
244         evalue_convert.cc \
245         evalue_convert.h \
246         evalue_read.c \
247         evalue_read.h \
248         $(FDSTREAM) \
249         bound.cc \
250         verify.h \
251         verify.c
252 EXTRA_barvinok_bound_SOURCES = fdstream.cc fdstream.h
253 barvinok_bound_LDADD = \
254         libbarvinok-core.la libbarvinok.la @POLYLIB_LIBS@ @PIPLIB_LIBS@
255 barvinok_summate_SOURCES = \
256         evalue_convert.cc \
257         evalue_convert.h \
258         evalue_read.c \
259         evalue_read.h \
260         $(FDSTREAM) \
261         summate.cc \
262         verify.h \
263         verify.c
264 EXTRA_barvinok_summate_SOURCES = fdstream.cc fdstream.h
265 4coins_SOURCES = 4coins.cc
266 lexmin_SOURCES = \
267         lexmin.h \
268         lexmin.cc \
269         combine.c \
270         combine.h \
271         edomain.cc \
272         edomain.h \
273         evalue_util.cc \
274         evalue_util.h \
275         verify.h \
276         verify.c
277 test_approx_SOURCES = \
278         test_approx.c \
279         verify.h \
280         verify.c
281 test_bound_SOURCES = \
282         test_bound.cc \
283         evalue_convert.cc \
284         evalue_convert.h \
285         evalue_read.c \
286         evalue_read.h \
287         $(FDSTREAM) \
288         verify.h \
289         verify.c
290 EXTRA_test_bound_SOURCES = fdstream.cc fdstream.h
291 test_bound_LDADD = \
292         libbarvinok-core.la libbarvinok.la @POLYLIB_LIBS@ @PIPLIB_LIBS@
294 TESTFILES = $(shell find $(top_srcdir)/tests -type f ! -path '*CVS*')
296 EXTRA_DIST = \
297     ChangeLog \
298     $(TESTFILES) \
299     latte2polylib.pl \
300     NTL_5_3_2.patch \
301     basis_reduction_templ.c \
302     polysign_cdd_template.cc \
303     barvinok/NTL.h.broken \
304     barvinok/NTL.h.normal \
305     barvinok/set.h.broken \
306     barvinok/set.h.normal \
307     doc/Internal.tex \
308     doc/applications.tex \
309     doc/barvinok.tex \
310     doc/omega.tex \
311     doc/polymake.tex \
312     doc/reports.tex \
313     doc/barvinok.bib \
314     doc/barvinok.gdf \
315     doc/chicago.bst \
316     doc/chicago.sty \
317     doc/mydefs.sty \
318     polymake/Makefile.in \
319     polymake/README \
320     polymake/autogen.sh \
321     polymake/configure.in \
322     polymake/convert.cc \
323     polymake/convert.h \
324     polymake/h_star_vector.cc \
325     polymake/lattice_points.cc
327 ACLOCAL_AMFLAGS = -I m4
329 install-data-local:
330         @test -z "$(pkgconfig_libdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfig_libdir)"
331         $(INSTALL_DATA) $(pkgconfig_libfile) "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
333 uninstall-local:
334         rm -f "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
336 dist-hook:
337         (cd $(distdir)/polymake; \
338             ./autogen.sh; rm -rf autogen.sh autom4te.cache)
339         (cd doc; make barvinok.pdf)
340         cp doc/barvinok.pdf $(distdir)/doc/
341         if test -f $(top_srcdir)/.git/HEAD; then \
342             echo @GIT_HEAD_VERSION@ > $(distdir)/GIT_HEAD_ID; \
343         else \
344             echo $(GIT_HEAD_ID) > $(distdir)/GIT_HEAD_ID; \
345         fi
347 dist-git: dist
348         mv $(distdir).tar.gz @GIT_HEAD_VERSION@.tar.gz
350 BEE_TESTDIRS = ehrhart_e ehrhart_e/scarf ehrhart_e/piplib
352 check: check-testlib check-enumerate check-enumerate_e check-test \
353         check-lexmin check-approx check-evalue check-euler check-lw
354 check-testlib: testlib$(EXEEXT)
355         ./testlib$(EXEEXT)
356 check-approx: test_approx$(EXEEXT)
357         @for i in $(top_srcdir)/tests/ehrhart/*; do \
358             if test -f $$i; then \
359                 echo $$i | ./test_approx$(EXEEXT) -q -r 10 || exit; \
360             fi \
361         done
362 check-evalue: @bv_barvinok_bound@ barvinok_summate$(EXEEXT)
363         @for i in $(top_srcdir)/tests/evalue/*; do \
364             if test -f $$i; then \
365                 echo $$i; \
366                 if test -n "@bv_barvinok_bound@"; then \
367                     ./barvinok_bound$(EXEEXT) -T < $$i || exit; \
368                     echo $$i | ./test_bound$(EXEEXT) -q || exit; \
369                 fi; \
370                 ./barvinok_summate$(EXEEXT) -T < $$i || exit; \
371             fi \
372         done
373 check-euler: barvinok_summate$(EXEEXT)
374         @for i in $(top_srcdir)/tests/euler/*; do \
375             if test -f $$i; then \
376                 echo $$i; \
377                 ./barvinok_summate$(EXEEXT) -T --summation=euler < $$i || exit; \
378             fi \
379         done
380 if HAVE_TOPCOM
381     TOPCOM_CD = '--chamber-decomposition=topcom'
382 endif
383 check-enumerate: barvinok_enumerate$(EXEEXT)
384         @for i in $(top_srcdir)/tests/ehrhart/*; do \
385             if test -f $$i; then \
386                 echo $$i; \
387                 for options in '' '--series' '--series --primal' $(TOPCOM_CD); do \
388                     for spec in 'random' 'bf' 'df'; do \
389                         opt="--specialization=$$spec $$options"; \
390                         echo "        $$opt"; \
391                         ./barvinok_enumerate$(EXEEXT) --verify $$opt < $$i || exit; \
392                     done \
393                 done; \
394                 opt="--summation=bernoulli"; \
395                 echo "        $$opt"; \
396                 ./barvinok_enumerate$(EXEEXT) --verify $$opt < $$i || exit; \
397             fi \
398         done
399 check-enumerate_e: barvinok_enumerate_e$(EXEEXT)
400         @for dir in $(BEE_TESTDIRS); do \
401             for i in $(top_srcdir)/tests/$$dir/*; do \
402                 if test -f $$i; then \
403                     for options in '' '--pip' '--pip --omega'; do \
404                         for spec in 'random' 'bf' 'df'; do \
405                             opt="--specialization=$$spec $$options"; \
406                             echo $$i $$opt; \
407                             ./barvinok_enumerate_e$(EXEEXT) --verify $$opt < $$i || exit; \
408                         done \
409                     done \
410                 fi \
411             done \
412         done
413         @for i in $(top_srcdir)/tests/ehrhart_e/scarf/*; do \
414             if test -f $$i; then \
415                 for spec in 'random' 'bf' 'df'; do \
416                     opt="--specialization=$$spec --scarf"; \
417                     echo $$i $$opt; \
418                     ./barvinok_enumerate_e$(EXEEXT) --verify $$opt < $$i || exit; \
419                 done; \
420                 echo $$i --series; \
421                 ./barvinok_enumerate_e$(EXEEXT) --verify --series < $$i || exit; \
422             fi \
423         done
424 check-test: test$(EXEEXT)
425         @for i in $(top_srcdir)/tests/*; do \
426             if test -f $$i; then \
427                 for options in '--index=10' '--primal --index=10'; do \
428                     for spec in 'random' 'bf' 'df' 'todd'; do \
429                         opt="--specialization=$$spec $$options"; \
430                         echo -n $$i $$opt; \
431                         ./test$(EXEEXT) $$opt < $$i || echo -n " NOT"; \
432                         echo " ok"; \
433                     done \
434                 done \
435             fi \
436         done
437 check-lw: test$(EXEEXT)
438         @for i in $(top_srcdir)/tests/lattice_width/*; do \
439             if test -f $$i; then \
440                 echo -n $$i; \
441                 ./test$(EXEEXT) < $$i || echo -n " NOT"; \
442                 echo " ok"; \
443             fi \
444         done
445 if HAVE_GLPK
446 check-lexmin: lexmin$(EXEEXT)
447         @for i in $(top_srcdir)/tests/lexmin/*; do \
448             if test -f $$i; then \
449                 for spec in 'random' 'bf' 'df'; do \
450                     opt="--specialization=$$spec"; \
451                     echo $$i $$opt; \
452                     ./lexmin$(EXEEXT) --verify $$opt < $$i || exit; \
453                 done \
454             fi \
455         done
456 else
457 check-lexmin:
458 endif
460 version.h: @GIT_HEAD@
461         echo '#define GIT_HEAD_ID "'@GIT_HEAD_VERSION@'"' > $@