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