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