remove bernstein
[barvinok.git] / Makefile.am
blob9031faa2fce368d831769f1ab5ca13538ec75f9f
1 if BUNDLED_POLYLIB
2     MAYBE_POLYLIB = polylib
3 endif
4 if BUNDLED_PIPLIB
5     MAYBE_PIPLIB = piplib
6 endif
7 if BUNDLED_ISL
8     MAYBE_ISL = isl
9     ISL_LA = $(top_builddir)/isl/libisl.la
10 endif
11 if BUNDLED_ISL_POLYLIB
12     MAYBE_ISL_POLYLIB = isl-polylib
13     ISL_POLYLIB_LA = $(top_builddir)/isl-polylib/libisl-polylib.la
14 endif
15 if BUNDLED_OMEGA
16     MAYBE_OMEGA = omega
17     OMEGA_LA = $(top_builddir)/omega/omega_lib/libomega.la
18 endif
19 if USE_ZSOLVE
20     MAYBE_ZSOLVE = zsolve
21 endif
22 if USE_PARKER
23     MAYBE_PARKER = parker
24 endif
25 SUBDIRS = $(MAYBE_PIPLIB) $(MAYBE_POLYLIB) $(MAYBE_ISL) $(MAYBE_ISL_POLYLIB) \
26                 $(MAYBE_OMEGA) \
27                 $(MAYBE_ZSOLVE) $(MAYBE_PARKER) . doc
28 DIST_SUBDIRS = $(MAYBE_PIPLIB) $(MAYBE_POLYLIB) $(MAYBE_ISL) \
29                 $(MAYBE_ISL_POLYLIB) $(MAYBE_OMEGA) \
30                 zsolve parker doc
32 FORCE:
33 polylib/libpolylibgmp.la: FORCE
34         cd polylib; $(MAKE) $(AM_MAKEFLAGS) libpolylibgmp.la
35 piplib/libpiplibMP.la: FORCE
36         cd piplib; $(MAKE) $(AM_MAKEFLAGS) libpiplibMP.la
37 isl/libisl.la: FORCE
38         cd isl; $(MAKE) $(AM_MAKEFLAGS) libisl.la
39 isl-polylib/libisl-polylib.la: FORCE
40         cd isl-polylib; $(MAKE) $(AM_MAKEFLAGS) libisl-polylib.la
41 omega/omega_lib/libomega.la: FORCE
42         cd omega/omega_lib; $(MAKE) $(AM_MAKEFLAGS) libomega.la
43 zsolve/libzsolve.la: FORCE
44         cd zsolve; $(MAKE) $(AM_MAKEFLAGS) libzsolve.la
45 parker/libparker.la: FORCE
46         cd parker; $(MAKE) $(AM_MAKEFLAGS) libparker.la
48 AM_CPPFLAGS = @POLYLIB_CPPFLAGS@ @PIPLIB_CPPFLAGS@ \
49               @NTL_CPPFLAGS@ @ISL_CFLAGS@ @ISL_POLYLIB_CFLAGS@
50 AM_LDFLAGS = @POLYLIB_LDFLAGS@ @PIPLIB_LDFLAGS@ @NTL_LDFLAGS@
52 LIB_ISL = $(ISL_LA) @ISL_LIBS@
53 LIB_ISL_POLYLIB = $(ISL_POLYLIB_LA) @ISL_POLYLIB_LIBS@
55 lib_LTLIBRARIES = libbarvinok-core.la libbarvinok.la
56 bin_PROGRAMS = barvinok_count barvinok_enumerate barvinok_enumerate_e \
57                   barvinok_ehrhart polytope_scan iscc
58 noinst_PROGRAMS = test testlib randomtest \
59                   remove_redundant_equalities \
60                   barvinok_union polytope_volume test_approx \
61                   barvinok_summate verify_lexsmaller \
62                   polyhedron_sample 4coins lexmin \
63                   @bv_cone_hilbert_basis@ cone_integer_hull \
64                   polytope_lattice_width polytope_minimize \
65                   polyhedron_integer_hull vector_partition_chambers \
66                   semigroup_holes evalue_convert \
67                   barvinok_bound test_bound
68 EXTRA_PROGRAMS = cone_hilbert_basis
69 pkginclude_HEADERS = \
70     barvinok/NTL_QQ.h \
71     barvinok/barvinok.h \
72     barvinok/util.h \
73     barvinok/evalue.h \
74     barvinok/genfun.h \
75     barvinok/options.h \
76     barvinok/polylib.h \
77     barvinok/sample.h \
78     barvinok/basis_reduction.h
79 nodist_pkginclude_HEADERS = \
80     barvinok/NTL.h \
81     barvinok/set.h
82 LINK = $(CXXLINK)
84 if HAVE_CDDLIB
85     BR_CDD = basis_reduction_cdd.cc initcdd.cc
86     POLYSIGN_CDD = polysign_cddf.cc polysign_cdd.cc
87 endif
88 if HAVE_GLPK
89     BR_GLPK = basis_reduction_glpk.c
90     POLYSIGN_GLPK = polysign_glpk.c
91 endif
92 if HAVE_TOPCOM
93     TOPCOM = topcom.c topcom.h
94 endif
95 if USE_ZSOLVE
96     HILBERT_C = hilbert.c
97 endif
98 libbarvinok_core_la_SOURCES = \
99     barvinok/evalue.h \
100     barvinok/genfun.h \
101     barvinok/util.h \
102     barvinok/barvinok.h \
103     NTL_QQ.cc \
104     basis_reduction.c \
105     basis_reduction_pip.c \
106     basis_reduction_pip_dual.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     lattice_point.cc \
137     lattice_point.h \
138     lattice_width.c \
139     lattice_width.h \
140     laurent.cc \
141     laurent.h \
142     laurent_old.cc \
143     laurent_old.h \
144     normalization.c \
145     normalization.h \
146     options.c \
147     param_polynomial.cc \
148     param_polynomial.h \
149     param_util.c \
150     param_util.h \
151     $(POLYSIGN_CDD) \
152     $(POLYSIGN_GLPK) \
153     polysign.c \
154     polysign_pip.c \
155     polysign_polylib.c \
156     polysign.h \
157     power.h \
158     reduce_domain.c \
159     reduce_domain.h \
160     reducer.cc \
161     reducer.h \
162     remove_equalities.h \
163     remove_equalities.c \
164     sample.c \
165     scale.c \
166     scale.h \
167     scarf.cc \
168     section_array.h \
169     series.cc \
170     $(TOPCOM) \
171     summate.c \
172     summate.h \
173     vertex_cone.cc \
174     vertex_cone.h \
175     volume.c \
176     volume.h \
177     mat_util.cc \
178     mat_util.h \
179     matrix_read.cc \
180     matrix_read.h \
181     barvinok.cc \
182     barvinok_e.cc \
183     $(BR_CDD) \
184     $(BR_GLPK)
185 EXTRA_libbarvinok_core_la_SOURCES = \
186     basis_reduction_cdd.cc \
187     basis_reduction_glpk.c \
188     hilbert.c \
189     polysign_cddf.cc \
190     polysign_cdd.cc \
191     polysign.c \
192     initcdd.cc \
193     initcdd.h \
194     topcom.c \
195     topcom.h
196 if BUNDLED_POLYLIB
197     POLYLIB_LA = $(top_builddir)/polylib/libpolylibgmp.la
198 endif
199 if BUNDLED_PIPLIB
200     PIPLIB_LA = $(top_builddir)/piplib/libpiplibMP.la
201 endif
202 if USE_ZSOLVE
203     ZSOLVE_LA = zsolve/libzsolve.la
204 endif
205 libbarvinok_core_la_LIBADD = @LTLIBOBJS@ $(LIB_ISL_POLYLIB) $(LIB_ISL) \
206                              $(POLYLIB_LA) @POLYLIB_LIBS@ \
207                              $(PIPLIB_LA) @PIPLIB_LIBS@ \
208                              $(ZSOLVE_LA)
209 libbarvinok_core_la_LDFLAGS = @BV_LDFLAGS@ -version-info @versioninfo@ \
210                                 $(AM_LDFLAGS)
211 libbarvinok_la_SOURCES = \
212     dummy.c
213 libbarvinok_la_LIBADD = libbarvinok-core.la
214 libbarvinok_la_LDFLAGS = @BV_LDFLAGS@ -version-info @versioninfo@ \
215                                 $(AM_LDFLAGS)
216 LDADD = libbarvinok-core.la @ISL_POLYLIB_LIBS@ @ISL_LIBS@ \
217         @POLYLIB_LIBS@ @PIPLIB_LIBS@
219 test_SOURCES = \
220         evalue_read.c \
221         evalue_read.h \
222         test.c
223 testlib_SOURCES = \
224         evalue_read.c \
225         evalue_read.h \
226         testlib.cc
227 barvinok_count_SOURCES = barvinok_count.c
228 barvinok_ehrhart_SOURCES = \
229         barvinok_ehrhart_options.c \
230         barvinok_ehrhart_options.h \
231         barvinok_ehrhart.cc \
232         evalue_convert_options.c \
233         evalue_convert.cc \
234         evalue_convert.h \
235         $(FDSTREAM)
236 barvinok_union_SOURCES = \
237         barvinok_union_options.c \
238         barvinok_union_options.h \
239         barvinok_union.cc
240 if HAVE_OMEGA
241 BEEO_SOURCES = \
242         omega_interface/Exit.cc \
243         omega_interface/convert.h \
244         omega_interface/convert.cc \
245         omega_interface/count.h \
246         omega_interface/count.cc
247 else
248 BEEO_SOURCES = 
249 endif
250 if USE_FDSTREAM
251 FDSTREAM = fdstream.cc fdstream.h
252 endif
253 barvinok_enumerate_SOURCES = \
254         barvinok_enumerate_options.c \
255         barvinok_enumerate_options.h \
256         barvinok_enumerate.cc \
257         evalue_convert_options.c \
258         evalue_convert.cc \
259         evalue_convert.h \
260         $(FDSTREAM) \
261         skewed_genfun.cc \
262         skewed_genfun.h \
263         verify.h \
264         verify.c \
265         verif_ehrhart.h \
266         verif_ehrhart.c \
267         verify_series.h \
268         verify_series.cc
269 EXTRA_barvinok_enumerate_SOURCES = fdstream.cc fdstream.h
270 barvinok_enumerate_e_SOURCES = \
271         barvinok_enumerate_e_options.c \
272         barvinok_enumerate_e_options.h \
273         barvinok_enumerate_e.cc \
274         evalue_convert_options.c \
275         evalue_convert.cc \
276         evalue_convert.h \
277         $(FDSTREAM) \
278         skewed_genfun.cc \
279         skewed_genfun.h \
280         verify.h \
281         verify.c \
282         verif_ehrhart.h \
283         verif_ehrhart.c \
284         verify_series.h \
285         verify_series.cc \
286         $(BEEO_SOURCES)
287 EXTRA_barvinok_enumerate_e_SOURCES = fdstream.cc fdstream.h
288 if USE_PARKER
289     MONA_LIBS = -ldfa -lbdd -lmem
290     PARKER_LA = parker/libparker.la
291     PARKERLDFLAGS = -L$(MONAPATH)/DFA -L$(MONAPATH)/BDD -L$(MONAPATH)/Mem
292     PARKERCPPFLAGS = -I$(MONAPATH)/Mem -I$(MONAPATH)/DFA -I$(MONAPATH)/BDD
293 endif
294 barvinok_enumerate_e_CPPFLAGS = \
295         $(PARKERCPPFLAGS) @OMEGA_CPPFLAGS@ $(AM_CPPFLAGS)
296 barvinok_enumerate_e_LDFLAGS = $(PARKERLDFLAGS) @OMEGA_LDFLAGS@ @LDFLAGS@
297 barvinok_enumerate_e_LDADD = \
298         $(PARKER_LA) $(MONA_LIBS) @OMEGA_LIBS@ $(OMEGA_LA) libbarvinok-core.la \
299         @ISL_POLYLIB_LIBS@ @ISL_LIBS@ @POLYLIB_LIBS@ @PIPLIB_LIBS@
300 barvinok_bound_SOURCES = \
301         evalue_convert_options.c \
302         evalue_convert.cc \
303         evalue_convert.h \
304         evalue_read.c \
305         evalue_read.h \
306         $(FDSTREAM) \
307         bound_options.h \
308         bound_options.c \
309         bound.cc \
310         verify.h \
311         verify.c
312 EXTRA_barvinok_bound_SOURCES = fdstream.cc fdstream.h
313 barvinok_bound_LDADD = \
314         libbarvinok-core.la libbarvinok.la @ISL_POLYLIB_LIBS@ @ISL_LIBS@ \
315         @POLYLIB_LIBS@ @PIPLIB_LIBS@
316 barvinok_summate_SOURCES = \
317         barvinok_summate_options.c \
318         barvinok_summate_options.h \
319         barvinok_summate.cc \
320         evalue_convert_options.c \
321         evalue_convert.cc \
322         evalue_convert.h \
323         evalue_read.c \
324         evalue_read.h \
325         $(FDSTREAM) \
326         verify.h \
327         verify.c
328 EXTRA_barvinok_summate_SOURCES = fdstream.cc fdstream.h
329 4coins_SOURCES = 4coins.cc
330 semigroup_holes_SOURCES = semigroup_holes.cc
331 lexmin_SOURCES = \
332         lexmin_options.c \
333         lexmin.h \
334         lexmin.cc \
335         combine.c \
336         combine.h \
337         edomain.cc \
338         edomain.h \
339         evalue_util.cc \
340         evalue_util.h \
341         verify.h \
342         verify.c
343 test_approx_SOURCES = \
344         test_approx.c \
345         verify.h \
346         verify.c
347 test_bound_SOURCES = \
348         test_bound.c \
349         evalue_convert_options.c \
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_options.c \
364         evalue_convert.cc \
365         evalue_convert.h \
366         evalue_read.c \
367         evalue_read.h \
368         $(FDSTREAM)
369 iscc_SOURCES =  \
370         isl_obj_list.h \
371         isl_obj_list.c \
372         iscc.c
373 iscc_LDADD = \
374         libbarvinok.la libbarvinok-core.la @ISL_POLYLIB_LIBS@ @ISL_LIBS@ \
375         @POLYLIB_LIBS@ @PIPLIB_LIBS@
377 TESTFILES = $(shell find $(top_srcdir)/tests -type f ! -path '*CVS*')
379 EXTRA_DIST = \
380     ChangeLog \
381     $(TESTFILES) \
382     latte2polylib.pl \
383     NTL_5_3_2.patch \
384     basis_reduction_templ.c \
385     cdd94e-test \
386     polysign_cdd_template.cc \
387     barvinok/NTL.h.broken \
388     barvinok/NTL.h.normal \
389     barvinok/set.h.broken \
390     barvinok/set.h.normal \
391     doc/isl.tex \
392     doc/Internal.tex \
393     doc/applications.tex \
394     doc/barvinok.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: barvinok_bound$(EXEEXT) test_bound$(EXEEXT) 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 if HAVE_OMEGA
487     SPEC_OMEGA = '--isl --omega'
488 endif
489 check-enumerate_e: barvinok_enumerate_e$(EXEEXT)
490         @for dir in $(BEE_TESTDIRS); do \
491             for i in $(top_srcdir)/tests/$$dir/*; do \
492                 if test -f $$i; then \
493                     for options in '' $(SPEC_OMEGA) '--isl'; do \
494                         for spec in 'random' 'bf' 'df'; do \
495                             opt="--specialization=$$spec $$options"; \
496                             echo $$i $$opt; \
497                             ./barvinok_enumerate_e$(EXEEXT) --verify $$opt < $$i || exit; \
498                         done \
499                     done \
500                 fi \
501             done \
502         done
503         @for i in $(top_srcdir)/tests/ehrhart_e/scarf/*; do \
504             if test -f $$i; then \
505                 for spec in 'random' 'bf' 'df'; do \
506                     opt="--specialization=$$spec --scarf"; \
507                     echo $$i $$opt; \
508                     ./barvinok_enumerate_e$(EXEEXT) --verify $$opt < $$i || exit; \
509                 done; \
510                 echo $$i --series; \
511                 ./barvinok_enumerate_e$(EXEEXT) --verify --series < $$i || exit; \
512             fi \
513         done
514 check-test: test$(EXEEXT)
515         @failed=0; \
516         for i in $(top_srcdir)/tests/*; do \
517             if test -f $$i; then \
518                 for options in '--index=10' '--primal --index=10'; do \
519                     for spec in 'random' 'bf' 'df' 'todd'; do \
520                         opt="--specialization=$$spec $$options"; \
521                         echo -n $$i $$opt; \
522                         ./test$(EXEEXT) $$opt < $$i; \
523                         if test "$$?" -ne "0"; then \
524                             failed=`expr $$failed + 1`; \
525                             echo " NOT ok"; \
526                         else \
527                             echo " ok"; \
528                         fi; \
529                     done \
530                 done \
531             fi \
532         done; \
533         for i in $(top_srcdir)/tests/sample/*; do \
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         done; \
543         if test $$failed != 0; then \
544                 echo "$$failed tests failed"; \
545                 exit -1; \
546         fi
547 check-lw: test$(EXEEXT)
548         @failed=0; \
549         for i in $(top_srcdir)/tests/lattice_width/*; do \
550             if test -f $$i; then \
551                 echo -n $$i; \
552                 ./test$(EXEEXT) < $$i; \
553                 if test "$$?" -ne "0"; then \
554                     failed=`expr $$failed + 1`; \
555                     echo " NOT ok"; \
556                 else \
557                     echo " ok"; \
558                 fi; \
559             fi \
560         done; \
561         if test $$failed != 0; then \
562                 echo "$$failed tests failed"; \
563                 exit -1; \
564         fi
565 if HAVE_GLPK
566 check-lexmin: lexmin$(EXEEXT)
567         @for i in $(top_srcdir)/tests/lexmin/*; do \
568             if test -f $$i; then \
569                 for spec in 'random' 'bf' 'df'; do \
570                     opt="--specialization=$$spec"; \
571                     echo $$i $$opt; \
572                     ./lexmin$(EXEEXT) --verify $$opt < $$i || exit; \
573                 done \
574             fi \
575         done
576 else
577 check-lexmin:
578 endif
580 version.h: @GIT_HEAD@
581         echo '#define GIT_HEAD_ID "'@GIT_HEAD_VERSION@'"' > $@