test all specialization algorithms during make check
[barvinok.git] / Makefile.am
blobc2acad404e0cae6155babc1a9c1ffb3b458e9585
1 if HAVE_GINAC
2     MAYBE_BERNSTEIN = bernstein
3 endif
4 SUBDIRS = $(MAYBE_BERNSTEIN) lib . omega doc
6 AM_CPPFLAGS = -I$(srcdir)/bernstein/include -I$(srcdir)/lib
7 AM_LDFLAGS = -Llib
9 lib_LTLIBRARIES = libbarvinok.la
10 bin_PROGRAMS = barvinok_count barvinok_enumerate barvinok_enumerate_e \
11                   barvinok_ehrhart
12 noinst_PROGRAMS = test randomtest \
13                   remove_redundant_equalities \
14                   barvinok_union \
15                   @bv_extra_programs@
16 EXTRA_PROGRAMS = piptest verify_lexsmaller polyhedron_sample 4coins lexmin \
17                  polytope_scan
18 pkginclude_HEADERS = \
19     barvinok/NTL_QQ.h \
20     barvinok/barvinok.h \
21     barvinok/util.h \
22     barvinok/evalue.h \
23     barvinok/genfun.h \
24     barvinok/options.h \
25     barvinok/polylib.h \
26     barvinok/sample.h \
27     barvinok/basis_reduction.h \
28     barvinok/bernstein.h
29 LINK = $(CXXLINK)
31 if HAVE_GINAC
32     BERNSTEIN_CC = bernstein.cc
33 endif
34 if HAVE_CDDLIB
35     BR_CDD = basis_reduction_cdd.cc initcdd.cc
36 endif
37 if HAVE_GLPK
38     BR_GLPK = basis_reduction_glpk.c
39 endif
40 libbarvinok_la_SOURCES = \
41     barvinok/evalue.h \
42     barvinok/genfun.h \
43     barvinok/util.h \
44     barvinok/barvinok.h \
45     NTL_QQ.cc \
46     basis_reduction.c \
47     evalue.c \
48     genfun.cc \
49     util.c \
50     version.c \
51     bfcounter.cc \
52     bfcounter.h \
53     conversion.cc \
54     conversion.h \
55     decomposer.cc \
56     decomposer.h \
57     dpoly.cc \
58     dpoly.h \
59     genfun_constructor.cc \
60     genfun_constructor.h \
61     lattice_point.cc \
62     lattice_point.h \
63     options.c \
64     reduce_domain.c \
65     reduce_domain.h \
66     reducer.cc \
67     reducer.h \
68     remove_equalities.h \
69     scarf.cc \
70     mat_util.cc \
71     mat_util.h \
72     barvinok.cc \
73     $(BERNSTEIN_CC) \
74     $(BR_CDD) \
75     $(BR_GLPK)
76 EXTRA_libbarvinok_la_SOURCES = \
77     bernstein.cc \
78     piputil.h \
79     initcdd.cc \
80     initcdd.h
81 if HAVE_GINAC
82     BERNSTEIN_LA = $(top_builddir)/bernstein/libbernstein.la
83 endif
84 libbarvinok_la_LIBADD = @LTLIBOBJS@ $(BERNSTEIN_LA) lib/libgnu.la
85 libbarvinok_la_LDFLAGS = @BV_LDFLAGS@ -version-info @versioninfo@
86 LDADD = libbarvinok.la
88 test_SOURCES = test.c
89 barvinok_count_SOURCES = barvinok_count.c
90 barvinok_ehrhart_SOURCES = barvinok_ehrhart.cc
91 barvinok_union_SOURCES = barvinok_union.cc
92 if HAVE_OMEGA
93 BEEO_SOURCES = omega/Exit.cc omega/convert.cc
94 else
95 BEEO_SOURCES = 
96 endif
97 barvinok_enumerate_SOURCES = \
98         barvinok_enumerate.cc \
99         fdstream.cc \
100         fdstream.h \
101         verify.h \
102         verify.c \
103         verif_ehrhart.h \
104         verif_ehrhart.c
105 barvinok_enumerate_e_SOURCES = \
106         verify.h \
107         verify.c \
108         barvinok_enumerate_e.cc \
109         $(BEEO_SOURCES)
110 barvinok_enumerate_e_CPPFLAGS = @OMEGA_CPPFLAGS@ $(AM_CPPFLAGS)
111 barvinok_enumerate_e_LDFLAGS = @OMEGA_LDFLAGS@ @LDFLAGS@
112 barvinok_enumerate_e_LDADD = @OMEGA_LIBS@ libbarvinok.la
113 4coins_SOURCES = 4coins.cc
114 if HAVE_CDDLIB
115 POLYSIGN = polysign_cddf.cc polysign_cdd.cc
116 endif
117 lexmin_SOURCES = \
118         lexmin.h \
119         lexmin.cc \
120         combine.c \
121         combine.h \
122         edomain.cc \
123         edomain.h \
124         evalue_util.cc \
125         evalue_util.h \
126         fdstream.cc \
127         fdstream.h \
128         $(POLYSIGN) \
129         polysign.c \
130         polysign_polylib.c \
131         polysign.h \
132         verify.h \
133         verify.c
134 EXTRA_lexmin_SOURCE = polysign_cddf.cc polysign_cdd.cc polysign.c
136 TESTFILES = $(shell find $(top_srcdir)/tests -type f ! -path '*CVS*')
138 EXTRA_DIST = \
139     ChangeLog \
140     $(TESTFILES) \
141     latte2polylib.pl \
142     NTL_5_3_2.patch \
143     doc/Internal.tex \
144     doc/applications.tex \
145     doc/barvinok.tex \
146     doc/omega.tex \
147     doc/polymake.tex \
148     doc/reports.tex \
149     doc/barvinok.bib \
150     doc/barvinok.gdf \
151     doc/chicago.bst \
152     doc/chicago.sty \
153     doc/mydefs.sty \
154     polymake/Makefile.in \
155     polymake/README \
156     polymake/autogen.sh \
157     polymake/configure.in \
158     polymake/lattice_points.cc
160 ACLOCAL_AMFLAGS = -I m4
162 install-data-local:
163         @test -z "$(pkgconfig_libdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfig_libdir)"
164         $(INSTALL_DATA) $(pkgconfig_libfile) "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
166 uninstall-local:
167         rm -f "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
169 dist-hook:
170         (cd $(distdir)/polymake; \
171             ./autogen.sh; rm -rf autogen.sh autom4te.cache)
172         (cd doc; make barvinok.pdf)
173         cp doc/barvinok.pdf $(distdir)/doc/
174         if test -f $(top_srcdir)/.git/HEAD; then \
175             echo @GIT_HEAD_VERSION@ > $(distdir)/GIT_HEAD_ID; \
176         else \
177             echo $(GIT_HEAD_ID) > $(distdir)/GIT_HEAD_ID; \
178         fi
180 if HAVE_PIPLIB
181 BEE_TESTDIRS = ehrhart_e ehrhart_e/scarf ehrhart_e/piplib
182 else
183 BEE_TESTDIRS = ehrhart_e ehrhart_e/scarf
184 endif
186 check-series:
187         @for i in $(top_srcdir)/tests/ehrhart/*; do \
188             if test -f $$i; then \
189                 for options in '' '--primal'; do \
190                     for spec in 'random' 'bf' 'df'; do \
191                         opt="--specialization=$$spec $$options"; \
192                         echo $$i $$opt; \
193                         ./barvinok_enumerate --verify --series $$opt < $$i; \
194                     done \
195                 done \
196             fi \
197         done
198 check:
199         @for i in $(top_srcdir)/tests/ehrhart/*; do \
200             if test -f $$i; then \
201                 for spec in 'random' 'bf' 'df'; do \
202                     opt="--specialization=$$spec"; \
203                     echo $$i $$opt; \
204                     ./barvinok_enumerate --verify $$opt < $$i; \
205                 done \
206             fi \
207         done
208         @for dir in $(BEE_TESTDIRS); do \
209             for i in $(top_srcdir)/tests/$$dir/*; do \
210                 if test -f $$i; then \
211                     for options in '' '--pip' '--pip --omega'; do \
212                         for spec in 'random' 'bf' 'df'; do \
213                             opt="--specialization=$$spec $$options"; \
214                             echo $$i $$opt; \
215                             ./barvinok_enumerate_e --verify $$opt < $$i; \
216                         done \
217                     done \
218                 fi \
219             done \
220         done
221         @for i in $(top_srcdir)/tests/ehrhart_e/scarf/*; do \
222             if test -f $$i; then \
223                 for spec in 'random' 'bf' 'df'; do \
224                     opt="--specialization=$$spec --scarf"; \
225                     echo $$i $$opt; \
226                     ./barvinok_enumerate_e --verify $$opt < $$i; \
227                 done \
228             fi \
229         done
230         @for i in $(top_srcdir)/tests/*; do \
231             if test -f $$i; then \
232                 for options in '--index=10' '--primal --index=10'; do \
233                     for spec in 'random' 'bf' 'df'; do \
234                         opt="--specialization=$$spec $$options"; \
235                         echo -n $$i $$opt; \
236                         ./test $$opt < $$i || echo -n " NOT"; \
237                         echo " ok"; \
238                     done \
239                 done \
240             fi \
241         done
242 if HAVE_GLPK
243         @for i in $(top_srcdir)/tests/lexmin/*; do \
244             if test -f $$i; then \
245                 for spec in 'random' 'bf' 'df'; do \
246                     opt="--specialization=$$spec"; \
247                     echo $$i $$opt; \
248                     ./lexmin --verify $$opt < $$i; \
249                 done \
250             fi \
251         done
252 endif
254 version.h: @GIT_HEAD@
255         echo '#define GIT_HEAD_ID "'@GIT_HEAD_VERSION@'"' > $@