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