compile zsolve
[barvinok.git] / Makefile.am
blob1a9652099e6c4204072198d6c1701c724dcab40d
1 if HAVE_GINAC
2     MAYBE_BERNSTEIN = bernstein
3 endif
4 if BUNDLED_POLYLIB
5     MAYBE_POLYLIB = polylib
6 endif
7 if BUNDLED_PIPLIB
8     MAYBE_PIPLIB = piplib
9 endif
10 SUBDIRS = $(MAYBE_PIPLIB) $(MAYBE_POLYLIB) $(MAYBE_BERNSTEIN) lib zsolve . omega doc
12 FORCE:
13 lib/libgnu.la: FORCE
14         $(MAKE) $(AM_MAKEFLAGS) -C lib libgnu.la
15 bernstein/libbernstein.la: FORCE
16         $(MAKE) $(AM_MAKEFLAGS) -C bernstein libbernstein.la
17 polylib/libpolylibgmp.la: FORCE
18         $(MAKE) $(AM_MAKEFLAGS) -C polylib libpolylibgmp.la
19 piplib/libpiplibMP.la: FORCE
20         $(MAKE) $(AM_MAKEFLAGS) -C piplib libpiplibMP.la
22 AM_CPPFLAGS = -I$(srcdir)/bernstein/include -I$(srcdir)/lib \
23               @POLYLIB_CPPFLAGS@ @PIPLIB_CPPFLAGS@ @GINACLIB_CPPFLAGS@
24 AM_LDFLAGS = -Llib @POLYLIB_LDFLAGS@ @PIPLIB_LDFLAGS@
26 lib_LTLIBRARIES = libbarvinok.la
27 bin_PROGRAMS = barvinok_count barvinok_enumerate barvinok_enumerate_e \
28                   barvinok_ehrhart polytope_scan
29 noinst_PROGRAMS = test testlib randomtest \
30                   remove_redundant_equalities \
31                   barvinok_union polytope_volume test_approx \
32                   barvinok_summate verify_lexsmaller piptest \
33                   polyhedron_sample 4coins lexmin @bv_barvinok_maximize@
34 EXTRA_PROGRAMS = barvinok_maximize
35 pkginclude_HEADERS = \
36     barvinok/NTL_QQ.h \
37     barvinok/barvinok.h \
38     barvinok/util.h \
39     barvinok/evalue.h \
40     barvinok/genfun.h \
41     barvinok/options.h \
42     barvinok/polylib.h \
43     barvinok/sample.h \
44     barvinok/basis_reduction.h \
45     barvinok/bernstein.h
46 nodist_pkginclude_HEADERS = \
47     barvinok/NTL.h \
48     barvinok/set.h
49 LINK = $(CXXLINK)
51 if HAVE_GINAC
52     BERNSTEIN_CC = bernstein.cc
53 endif
54 if HAVE_CDDLIB
55     BR_CDD = basis_reduction_cdd.cc initcdd.cc
56     POLYSIGN_CDD = polysign_cddf.cc polysign_cdd.cc
57 endif
58 if HAVE_GLPK
59     BR_GLPK = basis_reduction_glpk.c
60     POLYSIGN_GLPK = polysign_glpk.c
61 endif
62 if HAVE_TOPCOM
63     TOPCOM = topcom.c topcom.h
64 endif
65 libbarvinok_la_SOURCES = \
66     barvinok/evalue.h \
67     barvinok/genfun.h \
68     barvinok/util.h \
69     barvinok/barvinok.h \
70     NTL_QQ.cc \
71     basis_reduction.c \
72     basis_reduction_pip.c \
73     basis_reduction_pip_dual.c \
74     evalue.c \
75     genfun.cc \
76     util.c \
77     version.c \
78     bernoulli.c \
79     bernoulli.h \
80     bfcounter.cc \
81     bfcounter.h \
82     conversion.cc \
83     conversion.h \
84     counter.cc \
85     counter.h \
86     decomposer.cc \
87     decomposer.h \
88     dpoly.cc \
89     dpoly.h \
90     euler.cc \
91     euler.h \
92     genfun_constructor.cc \
93     genfun_constructor.h \
94     lattice_point.cc \
95     lattice_point.h \
96     options.c \
97     param_util.c \
98     param_util.h \
99     piputil.h \
100     piputil.c \
101     $(POLYSIGN_CDD) \
102     $(POLYSIGN_GLPK) \
103     polysign.c \
104     polysign_polylib.c \
105     polysign.h \
106     reduce_domain.c \
107     reduce_domain.h \
108     reducer.cc \
109     reducer.h \
110     remove_equalities.h \
111     remove_equalities.c \
112     sample.c \
113     scale.c \
114     scale.h \
115     scarf.cc \
116     series.cc \
117     $(TOPCOM) \
118     volume.c \
119     volume.h \
120     mat_util.cc \
121     mat_util.h \
122     matrix_read.cc \
123     matrix_read.h \
124     barvinok.cc \
125     barvinok_e.cc \
126     $(BERNSTEIN_CC) \
127     $(BR_CDD) \
128     $(BR_GLPK)
129 EXTRA_libbarvinok_la_SOURCES = \
130     basis_reduction_cdd.cc \
131     basis_reduction_glpk.c \
132     bernstein.cc \
133     polysign_cddf.cc \
134     polysign_cdd.cc \
135     polysign.c \
136     initcdd.cc \
137     initcdd.h \
138     topcom.c \
139     topcom.h
140 if HAVE_GINAC
141     BERNSTEIN_LA = $(top_builddir)/bernstein/libbernstein.la
142 endif
143 if BUNDLED_POLYLIB
144     POLYLIB_LA = $(top_builddir)/polylib/libpolylibgmp.la
145 endif
146 if BUNDLED_PIPLIB
147     PIPLIB_LA = $(top_builddir)/piplib/libpiplibMP.la
148 endif
149 libbarvinok_la_LIBADD = @LTLIBOBJS@ $(POLYLIB_LA) @POLYLIB_LIBS@ \
150                         $(PIPLIB_LA) @PIPLIB_LIBS@ $(BERNSTEIN_LA) \
151                         lib/libgnu.la
152 libbarvinok_la_LDFLAGS = @BV_LDFLAGS@ -version-info @versioninfo@
153 LDADD = libbarvinok.la @POLYLIB_LIBS@ @PIPLIB_LIBS@
155 test_SOURCES = test.c
156 testlib_SOURCES = \
157         evalue_read.c \
158         evalue_read.h \
159         testlib.cc
160 barvinok_count_SOURCES = barvinok_count.c
161 barvinok_ehrhart_SOURCES = barvinok_ehrhart.cc
162 barvinok_union_SOURCES = barvinok_union.cc
163 if HAVE_OMEGA
164 BEEO_SOURCES = omega/Exit.cc omega/convert.cc
165 else
166 BEEO_SOURCES = 
167 endif
168 if USE_FDSTREAM
169 FDSTREAM = fdstream.cc fdstream.h
170 endif
171 barvinok_enumerate_SOURCES = \
172         barvinok_enumerate.cc \
173         evalue_convert.cc \
174         evalue_convert.h \
175         $(FDSTREAM) \
176         skewed_genfun.cc \
177         skewed_genfun.h \
178         verify.h \
179         verify.c \
180         verif_ehrhart.h \
181         verif_ehrhart.c \
182         verify_series.h \
183         verify_series.cc
184 EXTRA_barvinok_enumerate_SOURCES = fdstream.cc fdstream.h
185 barvinok_enumerate_e_SOURCES = \
186         barvinok_enumerate_e.cc \
187         evalue_convert.cc \
188         evalue_convert.h \
189         $(FDSTREAM) \
190         skewed_genfun.cc \
191         skewed_genfun.h \
192         verify.h \
193         verify.c \
194         verif_ehrhart.h \
195         verif_ehrhart.c \
196         verify_series.h \
197         verify_series.cc \
198         $(BEEO_SOURCES)
199 EXTRA_barvinok_enumerate_e_SOURCES = fdstream.cc fdstream.h
200 barvinok_enumerate_e_CPPFLAGS = @OMEGA_CPPFLAGS@ $(AM_CPPFLAGS)
201 barvinok_enumerate_e_LDFLAGS = @OMEGA_LDFLAGS@ @LDFLAGS@
202 barvinok_enumerate_e_LDADD = @OMEGA_LIBS@ libbarvinok.la @POLYLIB_LIBS@ @PIPLIB_LIBS@
203 barvinok_maximize_SOURCES = \
204         evalue_convert.cc \
205         evalue_convert.h \
206         evalue_read.c \
207         evalue_read.h \
208         $(FDSTREAM) \
209         maximize.cc \
210         verify.h \
211         verify.c
212 EXTRA_barvinok_maximize_SOURCES = fdstream.cc fdstream.h
213 barvinok_summate_SOURCES = \
214         evalue_convert.cc \
215         evalue_convert.h \
216         evalue_read.c \
217         evalue_read.h \
218         $(FDSTREAM) \
219         summate.cc \
220         verify.h \
221         verify.c
222 EXTRA_barvinok_summate_SOURCES = fdstream.cc fdstream.h
223 4coins_SOURCES = 4coins.cc
224 lexmin_SOURCES = \
225         lexmin.h \
226         lexmin.cc \
227         combine.c \
228         combine.h \
229         edomain.cc \
230         edomain.h \
231         evalue_util.cc \
232         evalue_util.h \
233         verify.h \
234         verify.c
235 test_approx_SOURCES = \
236         test_approx.c \
237         verify.h \
238         verify.c
240 TESTFILES = $(shell find $(top_srcdir)/tests -type f ! -path '*CVS*')
242 EXTRA_DIST = \
243     ChangeLog \
244     $(TESTFILES) \
245     latte2polylib.pl \
246     NTL_5_3_2.patch \
247     basis_reduction_templ.c \
248     polysign_cdd_template.cc \
249     barvinok/NTL.h.broken \
250     barvinok/NTL.h.normal \
251     barvinok/set.h.broken \
252     barvinok/set.h.normal \
253     doc/Internal.tex \
254     doc/applications.tex \
255     doc/barvinok.tex \
256     doc/omega.tex \
257     doc/polymake.tex \
258     doc/reports.tex \
259     doc/barvinok.bib \
260     doc/barvinok.gdf \
261     doc/chicago.bst \
262     doc/chicago.sty \
263     doc/mydefs.sty \
264     polymake/Makefile.in \
265     polymake/README \
266     polymake/autogen.sh \
267     polymake/configure.in \
268     polymake/convert.cc \
269     polymake/convert.h \
270     polymake/h_star_vector.cc \
271     polymake/lattice_points.cc
273 ACLOCAL_AMFLAGS = -I m4
275 install-data-local:
276         @test -z "$(pkgconfig_libdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfig_libdir)"
277         $(INSTALL_DATA) $(pkgconfig_libfile) "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
279 uninstall-local:
280         rm -f "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
282 dist-hook:
283         (cd $(distdir)/polymake; \
284             ./autogen.sh; rm -rf autogen.sh autom4te.cache)
285         (cd doc; make barvinok.pdf)
286         cp doc/barvinok.pdf $(distdir)/doc/
287         if test -f $(top_srcdir)/.git/HEAD; then \
288             echo @GIT_HEAD_VERSION@ > $(distdir)/GIT_HEAD_ID; \
289         else \
290             echo $(GIT_HEAD_ID) > $(distdir)/GIT_HEAD_ID; \
291         fi
293 dist-git: dist
294         mv $(distdir).tar.gz @GIT_HEAD_VERSION@.tar.gz
296 BEE_TESTDIRS = ehrhart_e ehrhart_e/scarf ehrhart_e/piplib
298 check: check-testlib check-enumerate check-enumerate_e check-test \
299         check-lexmin check-approx check-evalue check-euler
300 check-testlib: testlib$(EXEEXT)
301         ./testlib$(EXEEXT)
302 check-approx: test_approx$(EXEEXT)
303         @for i in $(top_srcdir)/tests/ehrhart/*; do \
304             if test -f $$i; then \
305                 echo $$i | ./test_approx$(EXEEXT) -q -r 10 || exit; \
306             fi \
307         done
308 check-evalue: @bv_barvinok_maximize@ barvinok_summate$(EXEEXT)
309         @for i in $(top_srcdir)/tests/evalue/*; do \
310             if test -f $$i; then \
311                 echo $$i; \
312                 if test -n "@bv_barvinok_maximize@"; then \
313                     ./barvinok_maximize$(EXEEXT) -T < $$i || exit; \
314                 fi; \
315                 ./barvinok_summate$(EXEEXT) -T < $$i || exit; \
316             fi \
317         done
318 check-euler: barvinok_summate$(EXEEXT)
319         @for i in $(top_srcdir)/tests/euler/*; do \
320             if test -f $$i; then \
321                 echo $$i; \
322                 ./barvinok_summate$(EXEEXT) -T --summation=euler < $$i || exit; \
323             fi \
324         done
325 if HAVE_TOPCOM
326     TOPCOM_CD = '--chamber-decomposition=topcom'
327 endif
328 check-enumerate: barvinok_enumerate$(EXEEXT)
329         @for i in $(top_srcdir)/tests/ehrhart/*; do \
330             if test -f $$i; then \
331                 echo $$i; \
332                 for options in '' '--series' '--series --primal' $(TOPCOM_CD); do \
333                     for spec in 'random' 'bf' 'df'; do \
334                         opt="--specialization=$$spec $$options"; \
335                         echo "        $$opt"; \
336                         ./barvinok_enumerate$(EXEEXT) --verify $$opt < $$i || exit; \
337                     done \
338                 done \
339             fi \
340         done
341 check-enumerate_e: barvinok_enumerate_e$(EXEEXT)
342         @for dir in $(BEE_TESTDIRS); do \
343             for i in $(top_srcdir)/tests/$$dir/*; do \
344                 if test -f $$i; then \
345                     for options in '' '--pip' '--pip --omega'; do \
346                         for spec in 'random' 'bf' 'df'; do \
347                             opt="--specialization=$$spec $$options"; \
348                             echo $$i $$opt; \
349                             ./barvinok_enumerate_e$(EXEEXT) --verify $$opt < $$i || exit; \
350                         done \
351                     done \
352                 fi \
353             done \
354         done
355         @for i in $(top_srcdir)/tests/ehrhart_e/scarf/*; do \
356             if test -f $$i; then \
357                 for spec in 'random' 'bf' 'df'; do \
358                     opt="--specialization=$$spec --scarf"; \
359                     echo $$i $$opt; \
360                     ./barvinok_enumerate_e$(EXEEXT) --verify $$opt < $$i || exit; \
361                 done \
362             fi \
363         done
364 check-test: test$(EXEEXT)
365         @for i in $(top_srcdir)/tests/*; do \
366             if test -f $$i; then \
367                 for options in '--index=10' '--primal --index=10'; do \
368                     for spec in 'random' 'bf' 'df' 'todd'; do \
369                         opt="--specialization=$$spec $$options"; \
370                         echo -n $$i $$opt; \
371                         ./test$(EXEEXT) $$opt < $$i || echo -n " NOT"; \
372                         echo " ok"; \
373                     done \
374                 done \
375             fi \
376         done
377 if HAVE_GLPK
378 check-lexmin: lexmin$(EXEEXT)
379         @for i in $(top_srcdir)/tests/lexmin/*; do \
380             if test -f $$i; then \
381                 for spec in 'random' 'bf' 'df'; do \
382                     opt="--specialization=$$spec"; \
383                     echo $$i $$opt; \
384                     ./lexmin$(EXEEXT) --verify $$opt < $$i || exit; \
385                 done \
386             fi \
387         done
388 else
389 check-lexmin:
390 endif
392 version.h: @GIT_HEAD@
393         echo '#define GIT_HEAD_ID "'@GIT_HEAD_VERSION@'"' > $@