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