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