iscc: only print valid results
[barvinok.git] / Makefile.am
blobada4e5e21967efe2adc95542fca4e708e4393ddf
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_ISL_POLYLIB
15     MAYBE_ISL_POLYLIB = isl-polylib
16     ISL_POLYLIB_LA = $(top_builddir)/isl-polylib/libisl-polylib.la
17 endif
18 if BUNDLED_CLOOG
19     MAYBE_CLOOG = cloog
20     CLOOG_LA = $(top_builddir)/cloog/libcloog-isl.la
21 endif
22 if BUNDLED_OMEGA
23     MAYBE_OMEGA = omega
24     OMEGA_LA = $(top_builddir)/omega/omega_lib/libomega.la
25 endif
26 if USE_ZSOLVE
27     MAYBE_ZSOLVE = zsolve
28 endif
29 if USE_PARKER
30     MAYBE_PARKER = parker
31 endif
32 SUBDIRS = $(MAYBE_POLYLIB) $(MAYBE_ISL) $(MAYBE_ISL_POLYLIB) \
33                 $(MAYBE_CLOOG) $(MAYBE_OMEGA) \
34                 $(MAYBE_ZSOLVE) $(MAYBE_PARKER) . doc
35 DIST_SUBDIRS = $(MAYBE_POLYLIB) $(MAYBE_ISL) \
36                 $(MAYBE_ISL_POLYLIB) $(MAYBE_CLOOG) $(MAYBE_OMEGA) \
37                 zsolve parker doc
39 FORCE:
40 polylib/libpolylibgmp.la: FORCE
41         cd polylib; $(MAKE) $(AM_MAKEFLAGS) libpolylibgmp.la
42 isl/libisl.la: FORCE
43         cd isl; $(MAKE) $(AM_MAKEFLAGS) libisl.la
44 isl-polylib/libisl-polylib.la: $(LOCAL_ISL_LA) $(LOCAL_POLYLIB_LA) FORCE
45         cd isl-polylib; $(MAKE) $(AM_MAKEFLAGS) libisl-polylib.la
46 cloog/libcloog-isl.la: $(LOCAL_ISL_LA) FORCE
47         cd cloog; $(MAKE) $(AM_MAKEFLAGS) libcloog-isl.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 = @POLYLIB_CPPFLAGS@ \
56               @ISL_CFLAGS@ @ISL_POLYLIB_CFLAGS@ @NTL_CPPFLAGS@
57 AM_LDFLAGS = @POLYLIB_LDFLAGS@ @NTL_LDFLAGS@
59 LIB_ISL = $(ISL_LA) @ISL_LIBS@
60 LIB_ISL_POLYLIB = $(ISL_POLYLIB_LA) @ISL_POLYLIB_LIBS@
61 LIB_CLOOG = $(CLOOG_LA) @CLOOG_LIBS@
63 lib_LTLIBRARIES = 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 \
71                   @bv_cone_hilbert_basis@ cone_integer_hull \
72                   polytope_lattice_width \
73                   polyhedron_integer_hull vector_partition_chambers \
74                   semigroup_holes \
75                   barvinok_bound test_bound
76 EXTRA_PROGRAMS = cone_hilbert_basis
77 pkginclude_HEADERS = \
78     barvinok/NTL_QQ.h \
79     barvinok/isl.h \
80     barvinok/barvinok.h \
81     barvinok/util.h \
82     barvinok/evalue.h \
83     barvinok/genfun.h \
84     barvinok/options.h \
85     barvinok/polylib.h \
86     barvinok/sample.h \
87     barvinok/basis_reduction.h
88 nodist_pkginclude_HEADERS = \
89     barvinok/NTL.h \
90     barvinok/set.h
91 LINK = $(CXXLINK)
93 if HAVE_CDDLIB
94     BR_CDD = basis_reduction_cdd.cc initcdd.cc
95     POLYSIGN_CDD = polysign_cddf.cc polysign_cdd.cc
96 endif
97 if HAVE_GLPK
98     BR_GLPK = basis_reduction_glpk.c
99     POLYSIGN_GLPK = polysign_glpk.c
100 endif
101 if HAVE_TOPCOM
102     TOPCOM = topcom.c topcom.h
103 endif
104 if USE_ZSOLVE
105     HILBERT_C = hilbert.c
106 endif
107 libbarvinok_la_SOURCES = \
108     barvinok/evalue.h \
109     barvinok/genfun.h \
110     barvinok/util.h \
111     barvinok/barvinok.h \
112     NTL_QQ.cc \
113     basis_reduction.c \
114     evalue.c \
115     genfun.cc \
116     util.c \
117     version.c \
118     bernoulli.c \
119     bernoulli.h \
120     bfcounter.cc \
121     bfcounter.h \
122     binomial.c \
123     binomial.h \
124     conversion.cc \
125     conversion.h \
126     counter.cc \
127     counter.h \
128     decomposer.cc \
129     decomposer.h \
130     dpoly.cc \
131     dpoly.h \
132     euler.cc \
133     euler.h \
134     evalue_isl.c \
135     genfun_constructor.cc \
136     genfun_constructor.h \
137     $(HILBERT_C) \
138     hilbert.h \
139     hull.c \
140     hull.h \
141     ilp.c \
142     ilp.h \
143     isl_param_util.c \
144     isl_param_util.h \
145     lattice_point.cc \
146     lattice_point.h \
147     lattice_width.c \
148     lattice_width.h \
149     laurent.cc \
150     laurent.h \
151     laurent_old.cc \
152     laurent_old.h \
153     normalization.c \
154     normalization.h \
155     options.c \
156     param_polynomial.cc \
157     param_polynomial.h \
158     param_util.c \
159     param_util.h \
160     $(POLYSIGN_CDD) \
161     $(POLYSIGN_GLPK) \
162     $(POLYSIGN_PIP) \
163     polysign.c \
164     polysign_isl.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     $(BR_PIP)
196 EXTRA_libbarvinok_la_SOURCES = \
197     basis_reduction_cdd.cc \
198     basis_reduction_glpk.c \
199     hilbert.c \
200     polysign_cddf.cc \
201     polysign_cdd.cc \
202     polysign.c \
203     initcdd.cc \
204     initcdd.h \
205     topcom.c \
206     topcom.h
207 if USE_ZSOLVE
208     ZSOLVE_LA = zsolve/libzsolve.la
209 endif
210 libbarvinok_la_LIBADD = @LTLIBOBJS@ $(LIB_ISL_POLYLIB) $(LIB_ISL) \
211                              $(POLYLIB_LA) @POLYLIB_LIBS@ \
212                              $(ZSOLVE_LA)
213 libbarvinok_la_LDFLAGS = @BV_LDFLAGS@ -version-info @versioninfo@ \
214                                 $(AM_LDFLAGS)
215 LDADD = libbarvinok.la @ISL_POLYLIB_LIBS@ @ISL_LIBS@ \
216         @POLYLIB_LIBS@
218 test_SOURCES = \
219         test.c
220 testlib_SOURCES = \
221         evalue_read.c \
222         evalue_read.h \
223         testlib.cc
224 barvinok_count_SOURCES = barvinok_count.c
225 barvinok_ehrhart_SOURCES = \
226         barvinok_ehrhart_options.c \
227         barvinok_ehrhart_options.h \
228         barvinok_ehrhart.cc \
229         evalue_convert_options.c \
230         evalue_convert.cc \
231         evalue_convert.h \
232         $(FDSTREAM)
233 barvinok_union_SOURCES = \
234         barvinok_union_options.c \
235         barvinok_union_options.h \
236         barvinok_union.cc
237 if HAVE_OMEGA
238 BEEO_SOURCES = \
239         omega_interface/Exit.cc \
240         omega_interface/convert.h \
241         omega_interface/convert.cc \
242         omega_interface/count.h \
243         omega_interface/count.cc
244 else
245 BEEO_SOURCES = 
246 endif
247 if USE_FDSTREAM
248 FDSTREAM = fdstream.cc fdstream.h
249 endif
250 barvinok_enumerate_SOURCES = \
251         barvinok_enumerate_options.c \
252         barvinok_enumerate_options.h \
253         barvinok_enumerate.cc \
254         evalue_convert_options.c \
255         evalue_convert.cc \
256         evalue_convert.h \
257         $(FDSTREAM) \
258         skewed_genfun.cc \
259         skewed_genfun.h \
260         verify.h \
261         verify.c \
262         verif_ehrhart.h \
263         verif_ehrhart.c \
264         verify_series.h \
265         verify_series.cc
266 EXTRA_barvinok_enumerate_SOURCES = fdstream.cc fdstream.h
267 barvinok_enumerate_e_SOURCES = \
268         barvinok_enumerate_e_options.c \
269         barvinok_enumerate_e_options.h \
270         barvinok_enumerate_e.cc \
271         evalue_convert_options.c \
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         $(BEEO_SOURCES)
284 EXTRA_barvinok_enumerate_e_SOURCES = fdstream.cc fdstream.h
285 if USE_PARKER
286     MONA_LIBS = -ldfa -lbdd -lmem
287     PARKER_LA = parker/libparker.la
288     PARKERLDFLAGS = -L$(MONAPATH)/DFA -L$(MONAPATH)/BDD -L$(MONAPATH)/Mem
289     PARKERCPPFLAGS = -I$(MONAPATH)/Mem -I$(MONAPATH)/DFA -I$(MONAPATH)/BDD
290 endif
291 barvinok_enumerate_e_CPPFLAGS = \
292         $(PARKERCPPFLAGS) @OMEGA_CPPFLAGS@ $(AM_CPPFLAGS)
293 barvinok_enumerate_e_LDFLAGS = $(PARKERLDFLAGS) @OMEGA_LDFLAGS@ @LDFLAGS@
294 barvinok_enumerate_e_LDADD = \
295         $(PARKER_LA) $(MONA_LIBS) @OMEGA_LIBS@ $(OMEGA_LA) libbarvinok.la \
296         @ISL_POLYLIB_LIBS@ @ISL_LIBS@ @POLYLIB_LIBS@
297 barvinok_bound_SOURCES = \
298         bound.c \
299         verify.h \
300         verify.c
301 EXTRA_barvinok_bound_SOURCES = fdstream.cc fdstream.h
302 barvinok_bound_LDADD = \
303         libbarvinok.la @ISL_POLYLIB_LIBS@ @ISL_LIBS@ \
304         @POLYLIB_LIBS@
305 barvinok_summate_SOURCES = \
306         barvinok_summate.c \
307         verify.h \
308         verify.c
309 EXTRA_barvinok_summate_SOURCES = fdstream.cc fdstream.h
310 4coins_SOURCES = 4coins.cc
311 semigroup_holes_SOURCES = semigroup_holes.cc
312 lexmin_SOURCES = \
313         lexmin_options.c \
314         lexmin.h \
315         lexmin.cc \
316         edomain.cc \
317         edomain.h \
318         evalue_util.cc \
319         evalue_util.h \
320         verify.h \
321         verify.c
322 test_approx_SOURCES = \
323         test_approx.c \
324         verify.h \
325         verify.c
326 test_bound_SOURCES = \
327         test_bound.c \
328         verify.h \
329         verify.c
330 EXTRA_test_bound_SOURCES = fdstream.cc fdstream.h
331 test_bound_LDADD = \
332         libbarvinok.la @ISL_POLYLIB_LIBS@ @ISL_LIBS@ \
333         @POLYLIB_LIBS@
334 iscc_SOURCES =  \
335         isl_obj_list.h \
336         isl_obj_list.c \
337         isl_obj_str.h \
338         isl_obj_str.c \
339         iscc.c
340 iscc_CPPFLAGS = @CLOOG_CFLAGS@ $(AM_CPPFLAGS)
341 iscc_LDADD = \
342         libbarvinok.la $(LIB_CLOOG) @ISL_POLYLIB_LIBS@ @ISL_LIBS@ \
343         @POLYLIB_LIBS@
345 TESTFILES = $(shell find $(top_srcdir)/tests -type f ! -path '*CVS*')
347 EXTRA_DIST = \
348     ChangeLog \
349     $(TESTFILES) \
350     latte2polylib.pl \
351     NTL_5_3_2.patch \
352     basis_reduction_templ.c \
353     cdd94e-test \
354     polysign_cdd_template.cc \
355     barvinok/NTL.h.broken \
356     barvinok/NTL.h.normal \
357     barvinok/set.h.broken \
358     barvinok/set.h.normal \
359     doc/isl.tex \
360     doc/Internal.tex \
361     doc/applications.tex \
362     doc/barvinok.tex \
363     doc/polymake.tex \
364     doc/reports.tex \
365     doc/barvinok.bib \
366     doc/barvinok.gdf \
367     doc/chicago.bst \
368     doc/chicago.sty \
369     doc/mydefs.sty \
370     polymake/Makefile.in \
371     polymake/README \
372     polymake/autogen.sh \
373     polymake/configure.in \
374     polymake/convert.cc \
375     polymake/convert.h \
376     polymake/h_star_vector.cc \
377     polymake/lattice_points.cc
379 ACLOCAL_AMFLAGS = -I m4
381 install-data-local:
382         @test -z "$(pkgconfig_libdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfig_libdir)"
383         $(INSTALL_DATA) $(pkgconfig_libfile) "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
385 uninstall-local:
386         rm -f "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
388 dist-hook:
389         (cd $(distdir)/polymake; \
390             ./autogen.sh; rm -rf autogen.sh autom4te.cache)
391         (cd doc; make barvinok.pdf)
392         cp doc/barvinok.pdf $(distdir)/doc/
393         if test -f $(top_srcdir)/.git/HEAD; then \
394             echo @GIT_HEAD_VERSION@ > $(distdir)/GIT_HEAD_ID; \
395         else \
396             echo $(GIT_HEAD_ID) > $(distdir)/GIT_HEAD_ID; \
397         fi
399 dist-git: dist
400         mv $(distdir).tar.gz @GIT_HEAD_VERSION@.tar.gz
402 BEE_TESTDIRS = ehrhart_e ehrhart_e/scarf ehrhart_e/piplib
404 check: check-testlib check-enumerate check-enumerate_e check-test \
405         check-lexmin check-approx check-pwqp check-euler check-lw
406 check-testlib: testlib$(EXEEXT)
407         ./testlib$(EXEEXT)
408 check-approx: test_approx$(EXEEXT)
409         @for i in $(top_srcdir)/tests/ehrhart/*; do \
410             if test -f $$i; then \
411                 echo $$i | ./test_approx$(EXEEXT) -q -r 10 || exit; \
412             fi \
413         done
414 check-pwqp: barvinok_bound$(EXEEXT) test_bound$(EXEEXT) barvinok_summate$(EXEEXT)
415         @for i in $(top_srcdir)/tests/pwqp/*; do \
416             if test -f $$i; then \
417                 echo $$i; \
418                 ./barvinok_bound$(EXEEXT) -T -r30 < $$i || exit; \
419                 echo $$i | ./test_bound$(EXEEXT) -q -r30 || exit; \
420                 ./barvinok_summate$(EXEEXT) -T -r30 < $$i || exit; \
421             fi \
422         done
423 check-euler: barvinok_summate$(EXEEXT)
424         @for i in $(top_srcdir)/tests/euler/*; do \
425             if test -f $$i; then \
426                 for method in 'euler' 'laurent_old' 'laurent'; do \
427                     opt="--summation=$$method"; \
428                     echo $$i $$opt; \
429                     ./barvinok_summate$(EXEEXT) -T $$opt < $$i || exit; \
430                 done \
431             fi \
432         done
433 if HAVE_TOPCOM
434     TOPCOM_CD = '--chamber-decomposition=topcom'
435 endif
436 ISL_CD = '--chamber-decomposition=isl'
437 check-enumerate: barvinok_enumerate$(EXEEXT)
438         @for i in $(top_srcdir)/tests/ehrhart/*; do \
439             if test -f $$i; then \
440                 echo $$i; \
441                 for options in '' '--series' '--series --primal' $(TOPCOM_CD) $(ISL_CD); do \
442                     for spec in 'random' 'bf' 'df'; do \
443                         opt="--specialization=$$spec $$options"; \
444                         echo "        $$opt"; \
445                         ./barvinok_enumerate$(EXEEXT) --verify $$opt < $$i || exit; \
446                     done \
447                 done; \
448                 opt="--summation=bernoulli"; \
449                 echo "        $$opt"; \
450                 ./barvinok_enumerate$(EXEEXT) --verify $$opt < $$i || exit; \
451             fi \
452         done
453 if HAVE_OMEGA
454     SPEC_OMEGA = '--isl --omega'
455 endif
456 check-enumerate_e: barvinok_enumerate_e$(EXEEXT)
457         @for dir in $(BEE_TESTDIRS); do \
458             for i in $(top_srcdir)/tests/$$dir/*; do \
459                 if test -f $$i; then \
460                     for options in '' $(SPEC_OMEGA) '--isl'; do \
461                         for spec in 'random' 'bf' 'df'; do \
462                             opt="--specialization=$$spec $$options"; \
463                             echo $$i $$opt; \
464                             ./barvinok_enumerate_e$(EXEEXT) --verify $$opt < $$i || exit; \
465                         done \
466                     done \
467                 fi \
468             done \
469         done
470         @for i in $(top_srcdir)/tests/ehrhart_e/scarf/*; do \
471             if test -f $$i; then \
472                 for spec in 'random' 'bf' 'df'; do \
473                     opt="--specialization=$$spec --scarf"; \
474                     echo $$i $$opt; \
475                     ./barvinok_enumerate_e$(EXEEXT) --verify $$opt < $$i || exit; \
476                 done; \
477                 echo $$i --series; \
478                 ./barvinok_enumerate_e$(EXEEXT) --verify --series < $$i || exit; \
479             fi \
480         done
481 check-test: test$(EXEEXT)
482         @failed=0; \
483         for i in $(top_srcdir)/tests/*; do \
484             if test -f $$i; then \
485                 for options in '--index=10' '--primal --index=10'; do \
486                     for spec in 'random' 'bf' 'df' 'todd'; do \
487                         opt="--specialization=$$spec $$options"; \
488                         echo -n $$i $$opt; \
489                         ./test$(EXEEXT) $$opt < $$i; \
490                         if test "$$?" -ne "0"; then \
491                             failed=`expr $$failed + 1`; \
492                             echo " NOT ok"; \
493                         else \
494                             echo " ok"; \
495                         fi; \
496                     done \
497                 done \
498             fi \
499         done; \
500         for i in $(top_srcdir)/tests/sample/*; do \
501             echo -n $$i; \
502             ./test$(EXEEXT) < $$i; \
503             if test "$$?" -ne "0"; then \
504                 failed=`expr $$failed + 1`; \
505                 echo " NOT ok"; \
506             else \
507                 echo " ok"; \
508             fi; \
509         done; \
510         if test $$failed != 0; then \
511                 echo "$$failed tests failed"; \
512                 exit -1; \
513         fi
514 check-lw: test$(EXEEXT)
515         @failed=0; \
516         for i in $(top_srcdir)/tests/lattice_width/*; do \
517             if test -f $$i; then \
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             fi \
527         done; \
528         if test $$failed != 0; then \
529                 echo "$$failed tests failed"; \
530                 exit -1; \
531         fi
532 check-lexmin: lexmin$(EXEEXT)
533         @for i in $(top_srcdir)/tests/lexmin/*; do \
534             if test -f $$i; then \
535                 for spec in 'random' 'bf' 'df'; do \
536                     opt="--specialization=$$spec"; \
537                     echo $$i $$opt; \
538                     ./lexmin$(EXEEXT) --verify $$opt < $$i || exit; \
539                 done \
540             fi \
541         done
543 version.h: @GIT_HEAD@
544         echo '#define GIT_HEAD_ID "'@GIT_HEAD_VERSION@'"' > $@