volume.c: delay computation of point where volume is non-zero, if needed
[barvinok.git] / Makefile.am
blob4864fdc5da07d27f1afe87f7e94593907426ce23
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 \
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         verify.h \
116         verify.c \
117         verif_ehrhart.h \
118         verif_ehrhart.c \
119         $(BEEO_SOURCES)
120 barvinok_enumerate_e_CPPFLAGS = @OMEGA_CPPFLAGS@ $(AM_CPPFLAGS)
121 barvinok_enumerate_e_LDFLAGS = @OMEGA_LDFLAGS@ @LDFLAGS@
122 barvinok_enumerate_e_LDADD = @OMEGA_LIBS@ libbarvinok.la
123 barvinok_maximize_SOURCES = \
124         evalue_convert.cc \
125         evalue_convert.h \
126         maximize.cc \
127         verify.h \
128         verify.c
129 4coins_SOURCES = 4coins.cc
130 if HAVE_CDDLIB
131 POLYSIGN = polysign_cddf.cc polysign_cdd.cc
132 endif
133 lexmin_SOURCES = \
134         lexmin.h \
135         lexmin.cc \
136         combine.c \
137         combine.h \
138         edomain.cc \
139         edomain.h \
140         evalue_util.cc \
141         evalue_util.h \
142         fdstream.cc \
143         fdstream.h \
144         $(POLYSIGN) \
145         polysign.c \
146         polysign_polylib.c \
147         polysign.h \
148         verify.h \
149         verify.c
150 EXTRA_lexmin_SOURCE = polysign_cddf.cc polysign_cdd.cc polysign.c
152 TESTFILES = $(shell find $(top_srcdir)/tests -type f ! -path '*CVS*')
154 EXTRA_DIST = \
155     ChangeLog \
156     $(TESTFILES) \
157     latte2polylib.pl \
158     NTL_5_3_2.patch \
159     doc/Internal.tex \
160     doc/applications.tex \
161     doc/barvinok.tex \
162     doc/omega.tex \
163     doc/polymake.tex \
164     doc/reports.tex \
165     doc/barvinok.bib \
166     doc/barvinok.gdf \
167     doc/chicago.bst \
168     doc/chicago.sty \
169     doc/mydefs.sty \
170     polymake/Makefile.in \
171     polymake/README \
172     polymake/autogen.sh \
173     polymake/configure.in \
174     polymake/lattice_points.cc
176 ACLOCAL_AMFLAGS = -I m4
178 install-data-local:
179         @test -z "$(pkgconfig_libdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfig_libdir)"
180         $(INSTALL_DATA) $(pkgconfig_libfile) "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
182 uninstall-local:
183         rm -f "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
185 dist-hook:
186         (cd $(distdir)/polymake; \
187             ./autogen.sh; rm -rf autogen.sh autom4te.cache)
188         (cd doc; make barvinok.pdf)
189         cp doc/barvinok.pdf $(distdir)/doc/
190         if test -f $(top_srcdir)/.git/HEAD; then \
191             echo @GIT_HEAD_VERSION@ > $(distdir)/GIT_HEAD_ID; \
192         else \
193             echo $(GIT_HEAD_ID) > $(distdir)/GIT_HEAD_ID; \
194         fi
196 if HAVE_PIPLIB
197 BEE_TESTDIRS = ehrhart_e ehrhart_e/scarf ehrhart_e/piplib
198 else
199 BEE_TESTDIRS = ehrhart_e ehrhart_e/scarf
200 endif
202 check: check-enumerate check-enumerate_e check-test check-lexmin
203 check-enumerate: barvinok_enumerate
204         @for i in $(top_srcdir)/tests/ehrhart/*; do \
205             if test -f $$i; then \
206                 echo $$i; \
207                 for options in '' '--series' '--series --primal'; do \
208                     for spec in 'random' 'bf' 'df'; do \
209                         opt="--specialization=$$spec $$options"; \
210                         echo "        $$opt"; \
211                         ./barvinok_enumerate --verify $$opt < $$i; \
212                     done \
213                 done \
214             fi \
215         done
216 check-enumerate_e: barvinok_enumerate_e
217         @for dir in $(BEE_TESTDIRS); do \
218             for i in $(top_srcdir)/tests/$$dir/*; do \
219                 if test -f $$i; then \
220                     for options in '' '--pip' '--pip --omega'; do \
221                         for spec in 'random' 'bf' 'df'; do \
222                             opt="--specialization=$$spec $$options"; \
223                             echo $$i $$opt; \
224                             ./barvinok_enumerate_e --verify $$opt < $$i; \
225                         done \
226                     done \
227                 fi \
228             done \
229         done
230         @for i in $(top_srcdir)/tests/ehrhart_e/scarf/*; do \
231             if test -f $$i; then \
232                 for spec in 'random' 'bf' 'df'; do \
233                     opt="--specialization=$$spec --scarf"; \
234                     echo $$i $$opt; \
235                     ./barvinok_enumerate_e --verify $$opt < $$i; \
236                 done \
237             fi \
238         done
239 check-test: test
240         @for i in $(top_srcdir)/tests/*; do \
241             if test -f $$i; then \
242                 for options in '--index=10' '--primal --index=10'; do \
243                     for spec in 'random' 'bf' 'df'; do \
244                         opt="--specialization=$$spec $$options"; \
245                         echo -n $$i $$opt; \
246                         ./test $$opt < $$i || echo -n " NOT"; \
247                         echo " ok"; \
248                     done \
249                 done \
250             fi \
251         done
252 if HAVE_GLPK
253 check-lexmin: lexmin
254         @for i in $(top_srcdir)/tests/lexmin/*; do \
255             if test -f $$i; then \
256                 for spec in 'random' 'bf' 'df'; do \
257                     opt="--specialization=$$spec"; \
258                     echo $$i $$opt; \
259                     ./lexmin --verify $$opt < $$i; \
260                 done \
261             fi \
262         done
263 else
264 check-lexmin:
265 endif
267 version.h: @GIT_HEAD@
268         echo '#define GIT_HEAD_ID "'@GIT_HEAD_VERSION@'"' > $@