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