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