remove_all_equalities: handle integrally, but not rationally, empty contexts
[barvinok.git] / Makefile.am
blob6248e1a5de3ba4ab418448e347d88273b79393a5
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     laurent_old.cc \
132     laurent_old.h \
133     normalization.c \
134     normalization.h \
135     options.c \
136     param_polynomial.cc \
137     param_polynomial.h \
138     param_util.c \
139     param_util.h \
140     piputil.h \
141     piputil.c \
142     $(POLYSIGN_CDD) \
143     $(POLYSIGN_GLPK) \
144     polysign.c \
145     polysign_pip.c \
146     polysign_polylib.c \
147     polysign.h \
148     power.h \
149     reduce_domain.c \
150     reduce_domain.h \
151     reducer.cc \
152     reducer.h \
153     remove_equalities.h \
154     remove_equalities.c \
155     sample.c \
156     scale.c \
157     scale.h \
158     scarf.cc \
159     section_array.h \
160     series.cc \
161     $(TOPCOM) \
162     summate.c \
163     summate.h \
164     vertex_cone.cc \
165     vertex_cone.h \
166     volume.c \
167     volume.h \
168     mat_util.cc \
169     mat_util.h \
170     matrix_read.cc \
171     matrix_read.h \
172     barvinok.cc \
173     barvinok_e.cc \
174     $(BR_CDD) \
175     $(BR_GLPK)
176 EXTRA_libbarvinok_core_la_SOURCES = \
177     basis_reduction_cdd.cc \
178     basis_reduction_glpk.c \
179     hilbert.c \
180     polysign_cddf.cc \
181     polysign_cdd.cc \
182     polysign.c \
183     initcdd.cc \
184     initcdd.h \
185     topcom.c \
186     topcom.h
187 if BUNDLED_POLYLIB
188     POLYLIB_LA = $(top_builddir)/polylib/libpolylibgmp.la
189 endif
190 if BUNDLED_PIPLIB
191     PIPLIB_LA = $(top_builddir)/piplib/libpiplibMP.la
192 endif
193 if USE_ZSOLVE
194     ZSOLVE_LA = zsolve/libzsolve.la
195 endif
196 libbarvinok_core_la_LIBADD = @LTLIBOBJS@ $(POLYLIB_LA) @POLYLIB_LIBS@ \
197                              $(PIPLIB_LA) @PIPLIB_LIBS@ \
198                              $(ZSOLVE_LA) lib/libgnu.la
199 libbarvinok_core_la_LDFLAGS = @BV_LDFLAGS@ -version-info @versioninfo@ \
200                                 $(AM_LDFLAGS)
201 if HAVE_GINAC
202     BERNSTEIN_CC = bernstein.cc ex_convert.cc range.cc
203 else
204     BERNSTEIN_CC = dummy.c
205 endif
206 libbarvinok_la_SOURCES = \
207     $(BERNSTEIN_CC)
208 EXTRA_libbarvinok_la_SOURCES = \
209     ex_convert.cc \
210     ex_convert.h \
211     range.cc \
212     range.h \
213     bernstein.cc \
214     dummy.c
215 if HAVE_GINAC
216     BERNSTEIN_LA = $(top_builddir)/bernstein/libbernstein.la
217 endif
218 libbarvinok_la_LIBADD = libbarvinok-core.la $(BERNSTEIN_LA)
219 libbarvinok_la_LDFLAGS = @BV_LDFLAGS@ -version-info @versioninfo@ \
220                                 $(AM_LDFLAGS)
221 LDADD = libbarvinok-core.la @POLYLIB_LIBS@ @PIPLIB_LIBS@
223 test_SOURCES = \
224         evalue_read.c \
225         evalue_read.h \
226         test.c
227 testlib_SOURCES = \
228         evalue_read.c \
229         evalue_read.h \
230         testlib.cc
231 barvinok_count_SOURCES = barvinok_count.c
232 barvinok_ehrhart_SOURCES = \
233         barvinok_ehrhart.cc \
234         evalue_convert.cc \
235         evalue_convert.h \
236         $(FDSTREAM)
237 barvinok_union_SOURCES = barvinok_union.cc
238 if HAVE_OMEGA
239 BEEO_SOURCES = \
240         omega_interface/Exit.cc \
241         omega_interface/convert.cc \
242         omega_interface/count.cc
243 else
244 BEEO_SOURCES = 
245 endif
246 if USE_FDSTREAM
247 FDSTREAM = fdstream.cc fdstream.h
248 endif
249 barvinok_enumerate_SOURCES = \
250         barvinok_enumerate.cc \
251         evalue_convert.cc \
252         evalue_convert.h \
253         $(FDSTREAM) \
254         skewed_genfun.cc \
255         skewed_genfun.h \
256         verify.h \
257         verify.c \
258         verif_ehrhart.h \
259         verif_ehrhart.c \
260         verify_series.h \
261         verify_series.cc
262 EXTRA_barvinok_enumerate_SOURCES = fdstream.cc fdstream.h
263 barvinok_enumerate_e_SOURCES = \
264         barvinok_enumerate_e.cc \
265         evalue_convert.cc \
266         evalue_convert.h \
267         $(FDSTREAM) \
268         skewed_genfun.cc \
269         skewed_genfun.h \
270         verify.h \
271         verify.c \
272         verif_ehrhart.h \
273         verif_ehrhart.c \
274         verify_series.h \
275         verify_series.cc \
276         $(BEEO_SOURCES)
277 EXTRA_barvinok_enumerate_e_SOURCES = fdstream.cc fdstream.h
278 if USE_PARKER
279     MONA_LIBS = -ldfa -lbdd -lmem
280     PARKER_LA = parker/libparker.la
281     PARKERLDFLAGS = -L$(MONAPATH)/DFA -L$(MONAPATH)/BDD -L$(MONAPATH)/Mem
282     PARKERCPPFLAGS = -I$(MONAPATH)/Mem -I$(MONAPATH)/DFA -I$(MONAPATH)/BDD
283 endif
284 barvinok_enumerate_e_CPPFLAGS = \
285         $(PARKERCPPFLAGS) @OMEGA_CPPFLAGS@ $(AM_CPPFLAGS)
286 barvinok_enumerate_e_LDFLAGS = $(PARKERLDFLAGS) @OMEGA_LDFLAGS@ @LDFLAGS@
287 barvinok_enumerate_e_LDADD = \
288         $(PARKER_LA) $(MONA_LIBS) @OMEGA_LIBS@ $(OMEGA_LA) libbarvinok-core.la \
289         @POLYLIB_LIBS@ @PIPLIB_LIBS@
290 barvinok_bound_SOURCES = \
291         evalue_convert.cc \
292         evalue_convert.h \
293         evalue_read.c \
294         evalue_read.h \
295         $(FDSTREAM) \
296         bound.cc \
297         verify.h \
298         verify.c
299 EXTRA_barvinok_bound_SOURCES = fdstream.cc fdstream.h
300 barvinok_bound_LDADD = \
301         libbarvinok-core.la libbarvinok.la @POLYLIB_LIBS@ @PIPLIB_LIBS@
302 barvinok_summate_SOURCES = \
303         barvinok_summate.cc \
304         evalue_convert.cc \
305         evalue_convert.h \
306         evalue_read.c \
307         evalue_read.h \
308         $(FDSTREAM) \
309         verify.h \
310         verify.c
311 EXTRA_barvinok_summate_SOURCES = fdstream.cc fdstream.h
312 4coins_SOURCES = 4coins.cc
313 semigroup_holes_SOURCES = semigroup_holes.cc
314 lexmin_SOURCES = \
315         lexmin.h \
316         lexmin.cc \
317         combine.c \
318         combine.h \
319         edomain.cc \
320         edomain.h \
321         evalue_util.cc \
322         evalue_util.h \
323         verify.h \
324         verify.c
325 test_approx_SOURCES = \
326         test_approx.c \
327         verify.h \
328         verify.c
329 test_bound_SOURCES = \
330         test_bound.cc \
331         evalue_convert.cc \
332         evalue_convert.h \
333         evalue_read.c \
334         evalue_read.h \
335         $(FDSTREAM) \
336         verify.h \
337         verify.c
338 EXTRA_test_bound_SOURCES = fdstream.cc fdstream.h
339 test_bound_LDADD = \
340         libbarvinok-core.la libbarvinok.la @POLYLIB_LIBS@ @PIPLIB_LIBS@
342 TESTFILES = $(shell find $(top_srcdir)/tests -type f ! -path '*CVS*')
344 EXTRA_DIST = \
345     ChangeLog \
346     $(TESTFILES) \
347     latte2polylib.pl \
348     NTL_5_3_2.patch \
349     basis_reduction_templ.c \
350     cdd94e-test \
351     polysign_cdd_template.cc \
352     barvinok/NTL.h.broken \
353     barvinok/NTL.h.normal \
354     barvinok/set.h.broken \
355     barvinok/set.h.normal \
356     doc/Internal.tex \
357     doc/applications.tex \
358     doc/barvinok.tex \
359     doc/omega.tex \
360     doc/polymake.tex \
361     doc/reports.tex \
362     doc/barvinok.bib \
363     doc/barvinok.gdf \
364     doc/chicago.bst \
365     doc/chicago.sty \
366     doc/mydefs.sty \
367     polymake/Makefile.in \
368     polymake/README \
369     polymake/autogen.sh \
370     polymake/configure.in \
371     polymake/convert.cc \
372     polymake/convert.h \
373     polymake/h_star_vector.cc \
374     polymake/lattice_points.cc
376 ACLOCAL_AMFLAGS = -I m4
378 install-data-local:
379         @test -z "$(pkgconfig_libdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfig_libdir)"
380         $(INSTALL_DATA) $(pkgconfig_libfile) "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
382 uninstall-local:
383         rm -f "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
385 dist-hook:
386         (cd $(distdir)/polymake; \
387             ./autogen.sh; rm -rf autogen.sh autom4te.cache)
388         (cd doc; make barvinok.pdf)
389         cp doc/barvinok.pdf $(distdir)/doc/
390         if test -f $(top_srcdir)/.git/HEAD; then \
391             echo @GIT_HEAD_VERSION@ > $(distdir)/GIT_HEAD_ID; \
392         else \
393             echo $(GIT_HEAD_ID) > $(distdir)/GIT_HEAD_ID; \
394         fi
396 dist-git: dist
397         mv $(distdir).tar.gz @GIT_HEAD_VERSION@.tar.gz
399 BEE_TESTDIRS = ehrhart_e ehrhart_e/scarf ehrhart_e/piplib
401 check: check-testlib check-enumerate check-enumerate_e check-test \
402         check-lexmin check-approx check-evalue check-euler check-lw
403 check-testlib: testlib$(EXEEXT)
404         ./testlib$(EXEEXT)
405 check-approx: test_approx$(EXEEXT)
406         @for i in $(top_srcdir)/tests/ehrhart/*; do \
407             if test -f $$i; then \
408                 echo $$i | ./test_approx$(EXEEXT) -q -r 10 || exit; \
409             fi \
410         done
411 check-evalue: @bv_barvinok_bound@ barvinok_summate$(EXEEXT)
412         @for i in $(top_srcdir)/tests/evalue/*; do \
413             if test -f $$i; then \
414                 echo $$i; \
415                 if test -n "@bv_barvinok_bound@"; then \
416                     ./barvinok_bound$(EXEEXT) -T -r30 < $$i || exit; \
417                     echo $$i | ./test_bound$(EXEEXT) -q -r30 || exit; \
418                 fi; \
419                 ./barvinok_summate$(EXEEXT) -T -r30 < $$i || exit; \
420             fi \
421         done
422 check-euler: barvinok_summate$(EXEEXT)
423         @for i in $(top_srcdir)/tests/euler/*; do \
424             if test -f $$i; then \
425                 for method in 'euler' 'laurent_old' 'laurent'; do \
426                     opt="--summation=$$method"; \
427                     echo $$i $$opt; \
428                     ./barvinok_summate$(EXEEXT) -T $$opt < $$i || exit; \
429                 done \
430             fi \
431         done
432 if HAVE_TOPCOM
433     TOPCOM_CD = '--chamber-decomposition=topcom'
434 endif
435 check-enumerate: barvinok_enumerate$(EXEEXT)
436         @for i in $(top_srcdir)/tests/ehrhart/*; do \
437             if test -f $$i; then \
438                 echo $$i; \
439                 for options in '' '--series' '--series --primal' $(TOPCOM_CD); do \
440                     for spec in 'random' 'bf' 'df'; do \
441                         opt="--specialization=$$spec $$options"; \
442                         echo "        $$opt"; \
443                         ./barvinok_enumerate$(EXEEXT) --verify $$opt < $$i || exit; \
444                     done \
445                 done; \
446                 opt="--summation=bernoulli"; \
447                 echo "        $$opt"; \
448                 ./barvinok_enumerate$(EXEEXT) --verify $$opt < $$i || exit; \
449             fi \
450         done
451 check-enumerate_e: barvinok_enumerate_e$(EXEEXT)
452         @for dir in $(BEE_TESTDIRS); do \
453             for i in $(top_srcdir)/tests/$$dir/*; do \
454                 if test -f $$i; then \
455                     for options in '' '--pip' '--pip --omega'; do \
456                         for spec in 'random' 'bf' 'df'; do \
457                             opt="--specialization=$$spec $$options"; \
458                             echo $$i $$opt; \
459                             ./barvinok_enumerate_e$(EXEEXT) --verify $$opt < $$i || exit; \
460                         done \
461                     done \
462                 fi \
463             done \
464         done
465         @for i in $(top_srcdir)/tests/ehrhart_e/scarf/*; do \
466             if test -f $$i; then \
467                 for spec in 'random' 'bf' 'df'; do \
468                     opt="--specialization=$$spec --scarf"; \
469                     echo $$i $$opt; \
470                     ./barvinok_enumerate_e$(EXEEXT) --verify $$opt < $$i || exit; \
471                 done; \
472                 echo $$i --series; \
473                 ./barvinok_enumerate_e$(EXEEXT) --verify --series < $$i || exit; \
474             fi \
475         done
476 check-test: test$(EXEEXT)
477         @failed=0; \
478         for i in $(top_srcdir)/tests/*; do \
479             if test -f $$i; then \
480                 for options in '--index=10' '--primal --index=10'; do \
481                     for spec in 'random' 'bf' 'df' 'todd'; do \
482                         opt="--specialization=$$spec $$options"; \
483                         echo -n $$i $$opt; \
484                         ./test$(EXEEXT) $$opt < $$i; \
485                         if test "$$?" -ne "0"; then \
486                             failed=`expr $$failed + 1`; \
487                             echo " NOT ok"; \
488                         else \
489                             echo " ok"; \
490                         fi; \
491                     done \
492                 done \
493             fi \
494         done; \
495         for i in $(top_srcdir)/tests/sample/*; do \
496             echo -n $$i; \
497             ./test$(EXEEXT) < $$i; \
498             if test "$$?" -ne "0"; then \
499                 failed=`expr $$failed + 1`; \
500                 echo " NOT ok"; \
501             else \
502                 echo " ok"; \
503             fi; \
504         done; \
505         if test $$failed != 0; then \
506                 echo "$$failed tests failed"; \
507                 exit -1; \
508         fi
509 check-lw: test$(EXEEXT)
510         @failed=0; \
511         for i in $(top_srcdir)/tests/lattice_width/*; do \
512             if test -f $$i; then \
513                 echo -n $$i; \
514                 ./test$(EXEEXT) < $$i; \
515                 if test "$$?" -ne "0"; then \
516                     failed=`expr $$failed + 1`; \
517                     echo " NOT ok"; \
518                 else \
519                     echo " ok"; \
520                 fi; \
521             fi \
522         done; \
523         if test $$failed != 0; then \
524                 echo "$$failed tests failed"; \
525                 exit -1; \
526         fi
527 if HAVE_GLPK
528 check-lexmin: lexmin$(EXEEXT)
529         @for i in $(top_srcdir)/tests/lexmin/*; do \
530             if test -f $$i; then \
531                 for spec in 'random' 'bf' 'df'; do \
532                     opt="--specialization=$$spec"; \
533                     echo $$i $$opt; \
534                     ./lexmin$(EXEEXT) --verify $$opt < $$i || exit; \
535                 done \
536             fi \
537         done
538 else
539 check-lexmin:
540 endif
542 version.h: @GIT_HEAD@
543         echo '#define GIT_HEAD_ID "'@GIT_HEAD_VERSION@'"' > $@