barvinok.cc: make use of sampling for counting infinite domains configurable
[barvinok.git] / Makefile.am
blob74c943ef93f772ff886e5e63c4f69adabb0f8069
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 noinst_PROGRAMS = test barvinok_count randomtest barvinok_enumerate \
11                   barvinok_ehrhart \
12                   verif_ehrhart barvinok_enumerate_e \
13                   barvinok_series 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_series_SOURCES = barvinok_series.cc
92 barvinok_union_SOURCES = barvinok_union.cc
93 if HAVE_OMEGA
94 BEEO_SOURCES = omega/Exit.cc omega/convert.cc
95 else
96 BEEO_SOURCES = 
97 endif
98 barvinok_enumerate_e_SOURCES = \
99         verify.h \
100         verify.c \
101         barvinok_enumerate_e.cc \
102         $(BEEO_SOURCES)
103 barvinok_enumerate_e_CPPFLAGS = @OMEGA_CPPFLAGS@ $(AM_CPPFLAGS)
104 barvinok_enumerate_e_LDFLAGS = @OMEGA_LDFLAGS@ @LDFLAGS@
105 barvinok_enumerate_e_LDADD = @OMEGA_LIBS@ libbarvinok.la
106 verif_ehrhart_SOURCES = verif_ehrhart.c verify_main.cc verif_ehrhart.h
107 4coins_SOURCES = 4coins.cc
108 if HAVE_CDDLIB
109 POLYSIGN = polysign_cddf.cc polysign_cdd.cc
110 endif
111 lexmin_SOURCES = \
112         lexmin.cc \
113         combine.c \
114         combine.h \
115         edomain.cc \
116         edomain.h \
117         evalue_util.cc \
118         evalue_util.h \
119         fdstream.cc \
120         fdstream.h \
121         $(POLYSIGN) \
122         polysign.c \
123         polysign_polylib.c \
124         polysign.h \
125         verify.h \
126         verify.c
127 EXTRA_lexmin_SOURCE = polysign_cddf.cc polysign_cdd.cc polysign.c
129 TESTFILES = $(shell find $(top_srcdir)/tests -type f ! -path '*CVS*')
131 EXTRA_DIST = \
132     ChangeLog \
133     $(TESTFILES) \
134     latte2polylib.pl \
135     NTL_5_3_2.patch \
136     doc/Internal.tex \
137     doc/applications.tex \
138     doc/barvinok.tex \
139     doc/omega.tex \
140     doc/polymake.tex \
141     doc/reports.tex \
142     doc/barvinok.bib \
143     doc/barvinok.gdf \
144     doc/chicago.bst \
145     doc/chicago.sty \
146     doc/mydefs.sty \
147     polymake/Makefile.in \
148     polymake/README \
149     polymake/autogen.sh \
150     polymake/configure.in \
151     polymake/lattice_points.cc
153 ACLOCAL_AMFLAGS = -I m4
155 install-data-local:
156         @test -z "$(pkgconfig_libdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfig_libdir)"
157         $(INSTALL_DATA) $(pkgconfig_libfile) "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
159 uninstall-local:
160         rm -f "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
162 dist-hook:
163         (cd $(distdir)/polymake; \
164             ./autogen.sh; rm -rf autogen.sh autom4te.cache)
165         (cd doc; make barvinok.pdf)
166         cp doc/barvinok.pdf $(distdir)/doc/
167         if test -f $(top_srcdir)/.git/HEAD; then \
168             echo @GIT_HEAD_VERSION@ > $(distdir)/GIT_HEAD_ID; \
169         else \
170             echo $(GIT_HEAD_ID) > $(distdir)/GIT_HEAD_ID; \
171         fi
173 if HAVE_PIPLIB
174 BEE_TESTDIRS = ehrhart_e ehrhart_e/scarf ehrhart_e/piplib
175 else
176 BEE_TESTDIRS = ehrhart_e ehrhart_e/scarf
177 endif
179 check-series:
180         @for i in $(top_srcdir)/tests/ehrhart/*; do \
181             if test -f $$i; then \
182                 echo $$i; \
183                 ./verif_ehrhart --series < $$i; \
184             fi \
185         done
186 check:
187         @for i in $(top_srcdir)/tests/ehrhart/*; do \
188             if test -f $$i; then \
189                 echo $$i; \
190                 ./verif_ehrhart < $$i; \
191             fi \
192         done
193         @for dir in $(BEE_TESTDIRS); do \
194             for options in '' '--pip' '--pip --omega'; do \
195                 for i in $(top_srcdir)/tests/$$dir/*; do \
196                     if test -f $$i; then \
197                         echo $$i $$options; \
198                         ./barvinok_enumerate_e --verify $$options < $$i; \
199                     fi \
200                 done \
201             done \
202         done
203         @for i in $(top_srcdir)/tests/ehrhart_e/scarf/*; do \
204             if test -f $$i; then \
205                 echo $$i --scarf; \
206                 ./barvinok_enumerate_e --verify --scarf < $$i; \
207             fi \
208         done
209         @for i in $(top_srcdir)/tests/*; do \
210             for options in '' '--primal'; do \
211                 if test -f $$i; then \
212                     echo -n $$i $$options; \
213                     ./test $$options < $$i || echo -n " NOT"; \
214                     echo " ok"; \
215                 fi \
216             done \
217         done
218 if HAVE_GLPK
219         @for i in $(top_srcdir)/tests/lexmin/*; do \
220             if test -f $$i; then \
221                 echo $$i; \
222                 ./lexmin --verify < $$i; \
223             fi \
224         done
225 endif
227 version.h: @GIT_HEAD@
228         echo '#define GIT_HEAD_ID "'@GIT_HEAD_VERSION@'"' > $@