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