perform very basic polynomial approximation test
[barvinok.git] / Makefile.am
blob591d890488102cdc5a1591fb33597d69c924d654
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 @GINACLIB_CPPFLAGS@
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 barvinok_maximize polytope_volume test_approx \
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     scale.c \
70     scale.h \
71     scarf.cc \
72     volume.c \
73     volume.h \
74     mat_util.cc \
75     mat_util.h \
76     barvinok.cc \
77     $(BERNSTEIN_CC) \
78     $(BR_CDD) \
79     $(BR_GLPK)
80 EXTRA_libbarvinok_la_SOURCES = \
81     bernstein.cc \
82     piputil.h \
83     initcdd.cc \
84     initcdd.h
85 if HAVE_GINAC
86     BERNSTEIN_LA = $(top_builddir)/bernstein/libbernstein.la
87 endif
88 libbarvinok_la_LIBADD = @LTLIBOBJS@ $(BERNSTEIN_LA) lib/libgnu.la
89 libbarvinok_la_LDFLAGS = @BV_LDFLAGS@ -version-info @versioninfo@
90 LDADD = libbarvinok.la
92 test_SOURCES = test.c
93 barvinok_count_SOURCES = barvinok_count.c
94 barvinok_ehrhart_SOURCES = barvinok_ehrhart.cc
95 barvinok_union_SOURCES = barvinok_union.cc
96 if HAVE_OMEGA
97 BEEO_SOURCES = omega/Exit.cc omega/convert.cc
98 else
99 BEEO_SOURCES = 
100 endif
101 barvinok_enumerate_SOURCES = \
102         barvinok_enumerate.cc \
103         evalue_convert.cc \
104         evalue_convert.h \
105         fdstream.cc \
106         fdstream.h \
107         verify.h \
108         verify.c \
109         verif_ehrhart.h \
110         verif_ehrhart.c
111 barvinok_enumerate_e_SOURCES = \
112         barvinok_enumerate_e.cc \
113         evalue_convert.cc \
114         evalue_convert.h \
115         fdstream.cc \
116         fdstream.h \
117         verify.h \
118         verify.c \
119         verif_ehrhart.h \
120         verif_ehrhart.c \
121         $(BEEO_SOURCES)
122 barvinok_enumerate_e_CPPFLAGS = @OMEGA_CPPFLAGS@ $(AM_CPPFLAGS)
123 barvinok_enumerate_e_LDFLAGS = @OMEGA_LDFLAGS@ @LDFLAGS@
124 barvinok_enumerate_e_LDADD = @OMEGA_LIBS@ libbarvinok.la
125 barvinok_maximize_SOURCES = \
126         evalue_convert.cc \
127         evalue_convert.h \
128         fdstream.cc \
129         fdstream.h \
130         maximize.cc \
131         verify.h \
132         verify.c
133 4coins_SOURCES = 4coins.cc
134 if HAVE_CDDLIB
135 POLYSIGN = polysign_cddf.cc polysign_cdd.cc
136 endif
137 lexmin_SOURCES = \
138         lexmin.h \
139         lexmin.cc \
140         combine.c \
141         combine.h \
142         edomain.cc \
143         edomain.h \
144         evalue_util.cc \
145         evalue_util.h \
146         fdstream.cc \
147         fdstream.h \
148         $(POLYSIGN) \
149         polysign.c \
150         polysign_polylib.c \
151         polysign.h \
152         verify.h \
153         verify.c
154 EXTRA_lexmin_SOURCE = polysign_cddf.cc polysign_cdd.cc polysign.c
155 test_approx_SOURCES = \
156         test_approx.c \
157         verify.h \
158         verify.c
160 TESTFILES = $(shell find $(top_srcdir)/tests -type f ! -path '*CVS*')
162 EXTRA_DIST = \
163     ChangeLog \
164     $(TESTFILES) \
165     latte2polylib.pl \
166     NTL_5_3_2.patch \
167     doc/Internal.tex \
168     doc/applications.tex \
169     doc/barvinok.tex \
170     doc/omega.tex \
171     doc/polymake.tex \
172     doc/reports.tex \
173     doc/barvinok.bib \
174     doc/barvinok.gdf \
175     doc/chicago.bst \
176     doc/chicago.sty \
177     doc/mydefs.sty \
178     polymake/Makefile.in \
179     polymake/README \
180     polymake/autogen.sh \
181     polymake/configure.in \
182     polymake/lattice_points.cc
184 ACLOCAL_AMFLAGS = -I m4
186 install-data-local:
187         @test -z "$(pkgconfig_libdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfig_libdir)"
188         $(INSTALL_DATA) $(pkgconfig_libfile) "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
190 uninstall-local:
191         rm -f "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
193 dist-hook:
194         (cd $(distdir)/polymake; \
195             ./autogen.sh; rm -rf autogen.sh autom4te.cache)
196         (cd doc; make barvinok.pdf)
197         cp doc/barvinok.pdf $(distdir)/doc/
198         if test -f $(top_srcdir)/.git/HEAD; then \
199             echo @GIT_HEAD_VERSION@ > $(distdir)/GIT_HEAD_ID; \
200         else \
201             echo $(GIT_HEAD_ID) > $(distdir)/GIT_HEAD_ID; \
202         fi
204 if HAVE_PIPLIB
205 BEE_TESTDIRS = ehrhart_e ehrhart_e/scarf ehrhart_e/piplib
206 else
207 BEE_TESTDIRS = ehrhart_e ehrhart_e/scarf
208 endif
210 check: check-enumerate check-enumerate_e check-test check-lexmin check-approx
211 check-approx: test_approx
212         @for i in $(top_srcdir)/tests/ehrhart/*; do \
213             if test -f $$i; then \
214                 echo $$i | ./test_approx -q -r 10 ; \
215             fi \
216         done
217 check-enumerate: barvinok_enumerate
218         @for i in $(top_srcdir)/tests/ehrhart/*; do \
219             if test -f $$i; then \
220                 echo $$i; \
221                 for options in '' '--series' '--series --primal'; do \
222                     for spec in 'random' 'bf' 'df'; do \
223                         opt="--specialization=$$spec $$options"; \
224                         echo "        $$opt"; \
225                         ./barvinok_enumerate --verify $$opt < $$i; \
226                     done \
227                 done \
228             fi \
229         done
230 check-enumerate_e: barvinok_enumerate_e
231         @for dir in $(BEE_TESTDIRS); do \
232             for i in $(top_srcdir)/tests/$$dir/*; do \
233                 if test -f $$i; then \
234                     for options in '' '--pip' '--pip --omega'; do \
235                         for spec in 'random' 'bf' 'df'; do \
236                             opt="--specialization=$$spec $$options"; \
237                             echo $$i $$opt; \
238                             ./barvinok_enumerate_e --verify $$opt < $$i; \
239                         done \
240                     done \
241                 fi \
242             done \
243         done
244         @for i in $(top_srcdir)/tests/ehrhart_e/scarf/*; do \
245             if test -f $$i; then \
246                 for spec in 'random' 'bf' 'df'; do \
247                     opt="--specialization=$$spec --scarf"; \
248                     echo $$i $$opt; \
249                     ./barvinok_enumerate_e --verify $$opt < $$i; \
250                 done \
251             fi \
252         done
253 check-test: test
254         @for i in $(top_srcdir)/tests/*; do \
255             if test -f $$i; then \
256                 for options in '--index=10' '--primal --index=10'; do \
257                     for spec in 'random' 'bf' 'df'; do \
258                         opt="--specialization=$$spec $$options"; \
259                         echo -n $$i $$opt; \
260                         ./test $$opt < $$i || echo -n " NOT"; \
261                         echo " ok"; \
262                     done \
263                 done \
264             fi \
265         done
266 if HAVE_GLPK
267 check-lexmin: lexmin
268         @for i in $(top_srcdir)/tests/lexmin/*; do \
269             if test -f $$i; then \
270                 for spec in 'random' 'bf' 'df'; do \
271                     opt="--specialization=$$spec"; \
272                     echo $$i $$opt; \
273                     ./lexmin --verify $$opt < $$i; \
274                 done \
275             fi \
276         done
277 else
278 check-lexmin:
279 endif
281 version.h: @GIT_HEAD@
282         echo '#define GIT_HEAD_ID "'@GIT_HEAD_VERSION@'"' > $@