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