doc: add latest (accepted) publications
[barvinok.git] / Makefile.am
blobc77021a6883857c22d999647514eef0737c4797d
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 if USE_ZSOLVE
11     MAYBE_ZSOLVE = zsolve
12 endif
13 if USE_PARKER
14     MAYBE_PARKER = parker
15 endif
16 SUBDIRS = $(MAYBE_PIPLIB) $(MAYBE_POLYLIB) $(MAYBE_BERNSTEIN) \
17                 lib $(MAYBE_ZSOLVE) $(MAYBE_PARKER) . omega doc
19 FORCE:
20 lib/libgnu.la: FORCE
21         $(MAKE) $(AM_MAKEFLAGS) -C lib libgnu.la
22 bernstein/libbernstein.la: FORCE
23         $(MAKE) $(AM_MAKEFLAGS) -C bernstein libbernstein.la
24 polylib/libpolylibgmp.la: FORCE
25         $(MAKE) $(AM_MAKEFLAGS) -C polylib libpolylibgmp.la
26 piplib/libpiplibMP.la: FORCE
27         $(MAKE) $(AM_MAKEFLAGS) -C piplib libpiplibMP.la
28 zsolve/libzsolve.la: FORCE
29         $(MAKE) $(AM_MAKEFLAGS) -C zsolve libzsolve.la
30 parker/libparker.la: FORCE
31         $(MAKE) $(AM_MAKEFLAGS) -C parker libparker.la
33 AM_CPPFLAGS = -I$(srcdir)/bernstein/include -I$(srcdir)/lib \
34               @POLYLIB_CPPFLAGS@ @PIPLIB_CPPFLAGS@ @ginac_CFLAGS@
35 AM_LDFLAGS = -Llib @POLYLIB_LDFLAGS@ @PIPLIB_LDFLAGS@
37 lib_LTLIBRARIES = libbarvinok-core.la libbarvinok.la
38 bin_PROGRAMS = barvinok_count barvinok_enumerate barvinok_enumerate_e \
39                   barvinok_ehrhart polytope_scan
40 noinst_PROGRAMS = test testlib randomtest \
41                   remove_redundant_equalities \
42                   barvinok_union polytope_volume test_approx \
43                   barvinok_summate verify_lexsmaller piptest \
44                   polyhedron_sample 4coins lexmin @bv_barvinok_bound@ \
45                   @bv_cone_hilbert_basis@ cone_integer_hull \
46                   polytope_lattice_width polytope_minimize \
47                   polyhedron_integer_hull
48 EXTRA_PROGRAMS = barvinok_bound test_bound cone_hilbert_basis
49 pkginclude_HEADERS = \
50     barvinok/NTL_QQ.h \
51     barvinok/barvinok.h \
52     barvinok/util.h \
53     barvinok/evalue.h \
54     barvinok/genfun.h \
55     barvinok/options.h \
56     barvinok/polylib.h \
57     barvinok/sample.h \
58     barvinok/basis_reduction.h \
59     barvinok/bernstein.h
60 nodist_pkginclude_HEADERS = \
61     barvinok/NTL.h \
62     barvinok/set.h
63 LINK = $(CXXLINK)
65 if HAVE_CDDLIB
66     BR_CDD = basis_reduction_cdd.cc initcdd.cc
67     POLYSIGN_CDD = polysign_cddf.cc polysign_cdd.cc
68 endif
69 if HAVE_GLPK
70     BR_GLPK = basis_reduction_glpk.c
71     POLYSIGN_GLPK = polysign_glpk.c
72 endif
73 if HAVE_TOPCOM
74     TOPCOM = topcom.c topcom.h
75 endif
76 if USE_ZSOLVE
77     HILBERT_C = hilbert.c
78 endif
79 libbarvinok_core_la_SOURCES = \
80     barvinok/evalue.h \
81     barvinok/genfun.h \
82     barvinok/util.h \
83     barvinok/barvinok.h \
84     NTL_QQ.cc \
85     basis_reduction.c \
86     basis_reduction_pip.c \
87     basis_reduction_pip_dual.c \
88     evalue.c \
89     genfun.cc \
90     util.c \
91     version.c \
92     bernoulli.c \
93     bernoulli.h \
94     bfcounter.cc \
95     bfcounter.h \
96     binomial.c \
97     binomial.h \
98     conversion.cc \
99     conversion.h \
100     counter.cc \
101     counter.h \
102     decomposer.cc \
103     decomposer.h \
104     dpoly.cc \
105     dpoly.h \
106     euler.cc \
107     euler.h \
108     genfun_constructor.cc \
109     genfun_constructor.h \
110     $(HILBERT_C) \
111     hilbert.h \
112     hull.c \
113     hull.h \
114     ilp.c \
115     ilp.h \
116     lattice_point.cc \
117     lattice_point.h \
118     lattice_width.c \
119     lattice_width.h \
120     laurent.cc \
121     laurent.h \
122     normalization.c \
123     normalization.h \
124     options.c \
125     param_util.c \
126     param_util.h \
127     piputil.h \
128     piputil.c \
129     $(POLYSIGN_CDD) \
130     $(POLYSIGN_GLPK) \
131     polysign.c \
132     polysign_pip.c \
133     polysign_polylib.c \
134     polysign.h \
135     power.h \
136     reduce_domain.c \
137     reduce_domain.h \
138     reducer.cc \
139     reducer.h \
140     remove_equalities.h \
141     remove_equalities.c \
142     sample.c \
143     scale.c \
144     scale.h \
145     scarf.cc \
146     section_array.h \
147     series.cc \
148     $(TOPCOM) \
149     summate.c \
150     summate.h \
151     volume.c \
152     volume.h \
153     mat_util.cc \
154     mat_util.h \
155     matrix_read.cc \
156     matrix_read.h \
157     barvinok.cc \
158     barvinok_e.cc \
159     $(BR_CDD) \
160     $(BR_GLPK)
161 EXTRA_libbarvinok_la_SOURCES = \
162     basis_reduction_cdd.cc \
163     basis_reduction_glpk.c \
164     ex_convert.cc \
165     ex_convert.h \
166     range.cc \
167     range.h \
168     bernstein.cc \
169     hilbert.c \
170     polysign_cddf.cc \
171     polysign_cdd.cc \
172     polysign.c \
173     initcdd.cc \
174     initcdd.h \
175     topcom.c \
176     topcom.h
177 if BUNDLED_POLYLIB
178     POLYLIB_LA = $(top_builddir)/polylib/libpolylibgmp.la
179 endif
180 if BUNDLED_PIPLIB
181     PIPLIB_LA = $(top_builddir)/piplib/libpiplibMP.la
182 endif
183 if USE_ZSOLVE
184     ZSOLVE_LA = zsolve/libzsolve.la
185 endif
186 libbarvinok_core_la_LIBADD = @LTLIBOBJS@ $(POLYLIB_LA) @POLYLIB_LIBS@ \
187                              $(PIPLIB_LA) @PIPLIB_LIBS@ \
188                              $(ZSOLVE_LA) lib/libgnu.la
189 libbarvinok_core_la_LDFLAGS = @BV_LDFLAGS@ -version-info @versioninfo@
190 if HAVE_GINAC
191     BERNSTEIN_CC = bernstein.cc ex_convert.cc range.cc
192 endif
193 libbarvinok_la_SOURCES = \
194     $(BERNSTEIN_CC)
195 if HAVE_GINAC
196     BERNSTEIN_LA = $(top_builddir)/bernstein/libbernstein.la
197 endif
198 libbarvinok_la_LIBADD = libbarvinok-core.la $(BERNSTEIN_LA)
199 libbarvinok_la_LDFLAGS = @BV_LDFLAGS@ -version-info @versioninfo@
200 LDADD = libbarvinok-core.la @POLYLIB_LIBS@ @PIPLIB_LIBS@
202 test_SOURCES = \
203         evalue_read.c \
204         evalue_read.h \
205         test.c
206 testlib_SOURCES = \
207         evalue_read.c \
208         evalue_read.h \
209         testlib.cc
210 barvinok_count_SOURCES = barvinok_count.c
211 barvinok_ehrhart_SOURCES = barvinok_ehrhart.cc
212 barvinok_union_SOURCES = barvinok_union.cc
213 if HAVE_OMEGA
214 BEEO_SOURCES = omega/Exit.cc omega/convert.cc omega/count.cc
215 else
216 BEEO_SOURCES = 
217 endif
218 if USE_FDSTREAM
219 FDSTREAM = fdstream.cc fdstream.h
220 endif
221 barvinok_enumerate_SOURCES = \
222         barvinok_enumerate.cc \
223         evalue_convert.cc \
224         evalue_convert.h \
225         $(FDSTREAM) \
226         skewed_genfun.cc \
227         skewed_genfun.h \
228         verify.h \
229         verify.c \
230         verif_ehrhart.h \
231         verif_ehrhart.c \
232         verify_series.h \
233         verify_series.cc
234 EXTRA_barvinok_enumerate_SOURCES = fdstream.cc fdstream.h
235 barvinok_enumerate_e_SOURCES = \
236         barvinok_enumerate_e.cc \
237         evalue_convert.cc \
238         evalue_convert.h \
239         $(FDSTREAM) \
240         skewed_genfun.cc \
241         skewed_genfun.h \
242         verify.h \
243         verify.c \
244         verif_ehrhart.h \
245         verif_ehrhart.c \
246         verify_series.h \
247         verify_series.cc \
248         $(BEEO_SOURCES)
249 EXTRA_barvinok_enumerate_e_SOURCES = fdstream.cc fdstream.h
250 if USE_PARKER
251     MONA_LIBS = -ldfa -lbdd -lmem
252     PARKER_LA = parker/libparker.la
253     PARKERLDFLAGS = -L$(MONAPATH)/DFA -L$(MONAPATH)/BDD -L$(MONAPATH)/Mem
254     PARKERCPPFLAGS = -I$(MONAPATH)/Mem -I$(MONAPATH)/DFA -I$(MONAPATH)/BDD
255 endif
256 barvinok_enumerate_e_CPPFLAGS = \
257         $(PARKERCPPFLAGS) @OMEGA_CPPFLAGS@ $(AM_CPPFLAGS)
258 barvinok_enumerate_e_LDFLAGS = $(PARKERLDFLAGS) @OMEGA_LDFLAGS@ @LDFLAGS@
259 barvinok_enumerate_e_LDADD = \
260         $(PARKER_LA) $(MONA_LIBS) @OMEGA_LIBS@ libbarvinok-core.la \
261         @POLYLIB_LIBS@ @PIPLIB_LIBS@
262 barvinok_bound_SOURCES = \
263         evalue_convert.cc \
264         evalue_convert.h \
265         evalue_read.c \
266         evalue_read.h \
267         $(FDSTREAM) \
268         bound.cc \
269         verify.h \
270         verify.c
271 EXTRA_barvinok_bound_SOURCES = fdstream.cc fdstream.h
272 barvinok_bound_LDADD = \
273         libbarvinok-core.la libbarvinok.la @POLYLIB_LIBS@ @PIPLIB_LIBS@
274 barvinok_summate_SOURCES = \
275         barvinok_summate.cc \
276         evalue_convert.cc \
277         evalue_convert.h \
278         evalue_read.c \
279         evalue_read.h \
280         $(FDSTREAM) \
281         verify.h \
282         verify.c
283 EXTRA_barvinok_summate_SOURCES = fdstream.cc fdstream.h
284 4coins_SOURCES = 4coins.cc
285 lexmin_SOURCES = \
286         lexmin.h \
287         lexmin.cc \
288         combine.c \
289         combine.h \
290         edomain.cc \
291         edomain.h \
292         evalue_util.cc \
293         evalue_util.h \
294         verify.h \
295         verify.c
296 test_approx_SOURCES = \
297         test_approx.c \
298         verify.h \
299         verify.c
300 test_bound_SOURCES = \
301         test_bound.cc \
302         evalue_convert.cc \
303         evalue_convert.h \
304         evalue_read.c \
305         evalue_read.h \
306         $(FDSTREAM) \
307         verify.h \
308         verify.c
309 EXTRA_test_bound_SOURCES = fdstream.cc fdstream.h
310 test_bound_LDADD = \
311         libbarvinok-core.la libbarvinok.la @POLYLIB_LIBS@ @PIPLIB_LIBS@
313 TESTFILES = $(shell find $(top_srcdir)/tests -type f ! -path '*CVS*')
315 EXTRA_DIST = \
316     ChangeLog \
317     $(TESTFILES) \
318     latte2polylib.pl \
319     NTL_5_3_2.patch \
320     basis_reduction_templ.c \
321     cdd94e-test \
322     polysign_cdd_template.cc \
323     barvinok/NTL.h.broken \
324     barvinok/NTL.h.normal \
325     barvinok/set.h.broken \
326     barvinok/set.h.normal \
327     doc/Internal.tex \
328     doc/applications.tex \
329     doc/barvinok.tex \
330     doc/omega.tex \
331     doc/polymake.tex \
332     doc/reports.tex \
333     doc/barvinok.bib \
334     doc/barvinok.gdf \
335     doc/chicago.bst \
336     doc/chicago.sty \
337     doc/mydefs.sty \
338     polymake/Makefile.in \
339     polymake/README \
340     polymake/autogen.sh \
341     polymake/configure.in \
342     polymake/convert.cc \
343     polymake/convert.h \
344     polymake/h_star_vector.cc \
345     polymake/lattice_points.cc
347 ACLOCAL_AMFLAGS = -I m4
349 install-data-local:
350         @test -z "$(pkgconfig_libdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfig_libdir)"
351         $(INSTALL_DATA) $(pkgconfig_libfile) "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
353 uninstall-local:
354         rm -f "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
356 dist-hook:
357         (cd $(distdir)/polymake; \
358             ./autogen.sh; rm -rf autogen.sh autom4te.cache)
359         (cd doc; make barvinok.pdf)
360         cp doc/barvinok.pdf $(distdir)/doc/
361         if test -f $(top_srcdir)/.git/HEAD; then \
362             echo @GIT_HEAD_VERSION@ > $(distdir)/GIT_HEAD_ID; \
363         else \
364             echo $(GIT_HEAD_ID) > $(distdir)/GIT_HEAD_ID; \
365         fi
367 dist-git: dist
368         mv $(distdir).tar.gz @GIT_HEAD_VERSION@.tar.gz
370 BEE_TESTDIRS = ehrhart_e ehrhart_e/scarf ehrhart_e/piplib
372 check: check-testlib check-enumerate check-enumerate_e check-test \
373         check-lexmin check-approx check-evalue check-euler check-lw
374 check-testlib: testlib$(EXEEXT)
375         ./testlib$(EXEEXT)
376 check-approx: test_approx$(EXEEXT)
377         @for i in $(top_srcdir)/tests/ehrhart/*; do \
378             if test -f $$i; then \
379                 echo $$i | ./test_approx$(EXEEXT) -q -r 10 || exit; \
380             fi \
381         done
382 check-evalue: @bv_barvinok_bound@ barvinok_summate$(EXEEXT)
383         @for i in $(top_srcdir)/tests/evalue/*; do \
384             if test -f $$i; then \
385                 echo $$i; \
386                 if test -n "@bv_barvinok_bound@"; then \
387                     ./barvinok_bound$(EXEEXT) -T -r30 < $$i || exit; \
388                     echo $$i | ./test_bound$(EXEEXT) -q -r30 || exit; \
389                 fi; \
390                 ./barvinok_summate$(EXEEXT) -T -r30 < $$i || exit; \
391             fi \
392         done
393 check-euler: barvinok_summate$(EXEEXT)
394         @for i in $(top_srcdir)/tests/euler/*; do \
395             if test -f $$i; then \
396                 for method in 'euler' 'laurent'; do \
397                     opt="--summation=$$method"; \
398                     echo $$i $$opt; \
399                     ./barvinok_summate$(EXEEXT) -T $$opt < $$i || exit; \
400                 done \
401             fi \
402         done
403 if HAVE_TOPCOM
404     TOPCOM_CD = '--chamber-decomposition=topcom'
405 endif
406 check-enumerate: barvinok_enumerate$(EXEEXT)
407         @for i in $(top_srcdir)/tests/ehrhart/*; do \
408             if test -f $$i; then \
409                 echo $$i; \
410                 for options in '' '--series' '--series --primal' $(TOPCOM_CD); do \
411                     for spec in 'random' 'bf' 'df'; do \
412                         opt="--specialization=$$spec $$options"; \
413                         echo "        $$opt"; \
414                         ./barvinok_enumerate$(EXEEXT) --verify $$opt < $$i || exit; \
415                     done \
416                 done; \
417                 opt="--summation=bernoulli"; \
418                 echo "        $$opt"; \
419                 ./barvinok_enumerate$(EXEEXT) --verify $$opt < $$i || exit; \
420             fi \
421         done
422 check-enumerate_e: barvinok_enumerate_e$(EXEEXT)
423         @for dir in $(BEE_TESTDIRS); do \
424             for i in $(top_srcdir)/tests/$$dir/*; do \
425                 if test -f $$i; then \
426                     for options in '' '--pip' '--pip --omega'; do \
427                         for spec in 'random' 'bf' 'df'; do \
428                             opt="--specialization=$$spec $$options"; \
429                             echo $$i $$opt; \
430                             ./barvinok_enumerate_e$(EXEEXT) --verify $$opt < $$i || exit; \
431                         done \
432                     done \
433                 fi \
434             done \
435         done
436         @for i in $(top_srcdir)/tests/ehrhart_e/scarf/*; do \
437             if test -f $$i; then \
438                 for spec in 'random' 'bf' 'df'; do \
439                     opt="--specialization=$$spec --scarf"; \
440                     echo $$i $$opt; \
441                     ./barvinok_enumerate_e$(EXEEXT) --verify $$opt < $$i || exit; \
442                 done; \
443                 echo $$i --series; \
444                 ./barvinok_enumerate_e$(EXEEXT) --verify --series < $$i || exit; \
445             fi \
446         done
447 check-test: test$(EXEEXT)
448         @for i in $(top_srcdir)/tests/*; do \
449             if test -f $$i; then \
450                 for options in '--index=10' '--primal --index=10'; do \
451                     for spec in 'random' 'bf' 'df' 'todd'; do \
452                         opt="--specialization=$$spec $$options"; \
453                         echo -n $$i $$opt; \
454                         ./test$(EXEEXT) $$opt < $$i || echo -n " NOT"; \
455                         echo " ok"; \
456                     done \
457                 done \
458             fi \
459         done
460 check-lw: test$(EXEEXT)
461         @for i in $(top_srcdir)/tests/lattice_width/*; do \
462             if test -f $$i; then \
463                 echo -n $$i; \
464                 ./test$(EXEEXT) < $$i || echo -n " NOT"; \
465                 echo " ok"; \
466             fi \
467         done
468 if HAVE_GLPK
469 check-lexmin: lexmin$(EXEEXT)
470         @for i in $(top_srcdir)/tests/lexmin/*; do \
471             if test -f $$i; then \
472                 for spec in 'random' 'bf' 'df'; do \
473                     opt="--specialization=$$spec"; \
474                     echo $$i $$opt; \
475                     ./lexmin$(EXEEXT) --verify $$opt < $$i || exit; \
476                 done \
477             fi \
478         done
479 else
480 check-lexmin:
481 endif
483 version.h: @GIT_HEAD@
484         echo '#define GIT_HEAD_ID "'@GIT_HEAD_VERSION@'"' > $@