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