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