move omega subdir to omega_interface
[barvinok.git] / Makefile.am
blob25a0d89571a86b025fd1f1ada97dc3d3c535e515
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_interface doc
19 FORCE:
20 lib/libgnu.la: FORCE
21         cd lib; $(MAKE) $(AM_MAKEFLAGS) libgnu.la
22 bernstein/libbernstein.la: FORCE
23         cd bernstein; $(MAKE) $(AM_MAKEFLAGS) libbernstein.la
24 polylib/libpolylibgmp.la: FORCE
25         cd polylib; $(MAKE) $(AM_MAKEFLAGS) libpolylibgmp.la
26 piplib/libpiplibMP.la: FORCE
27         cd piplib; $(MAKE) $(AM_MAKEFLAGS) libpiplibMP.la
28 zsolve/libzsolve.la: FORCE
29         cd zsolve; $(MAKE) $(AM_MAKEFLAGS) libzsolve.la
30 parker/libparker.la: FORCE
31         cd parker; $(MAKE) $(AM_MAKEFLAGS) libparker.la
33 AM_CPPFLAGS = -I$(srcdir)/bernstein/include -I$(srcdir)/lib -Ilib \
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_core_la_SOURCES = \
163     basis_reduction_cdd.cc \
164     basis_reduction_glpk.c \
165     hilbert.c \
166     polysign_cddf.cc \
167     polysign_cdd.cc \
168     polysign.c \
169     initcdd.cc \
170     initcdd.h \
171     topcom.c \
172     topcom.h
173 if BUNDLED_POLYLIB
174     POLYLIB_LA = $(top_builddir)/polylib/libpolylibgmp.la
175 endif
176 if BUNDLED_PIPLIB
177     PIPLIB_LA = $(top_builddir)/piplib/libpiplibMP.la
178 endif
179 if USE_ZSOLVE
180     ZSOLVE_LA = zsolve/libzsolve.la
181 endif
182 libbarvinok_core_la_LIBADD = @LTLIBOBJS@ $(POLYLIB_LA) @POLYLIB_LIBS@ \
183                              $(PIPLIB_LA) @PIPLIB_LIBS@ \
184                              $(ZSOLVE_LA) lib/libgnu.la
185 libbarvinok_core_la_LDFLAGS = @BV_LDFLAGS@ -version-info @versioninfo@ \
186                                 $(AM_LDFLAGS)
187 if HAVE_GINAC
188     BERNSTEIN_CC = bernstein.cc ex_convert.cc range.cc
189 else
190     BERNSTEIN_CC = dummy.c
191 endif
192 libbarvinok_la_SOURCES = \
193     $(BERNSTEIN_CC)
194 EXTRA_libbarvinok_la_SOURCES = \
195     ex_convert.cc \
196     ex_convert.h \
197     range.cc \
198     range.h \
199     bernstein.cc \
200     dummy.c
201 if HAVE_GINAC
202     BERNSTEIN_LA = $(top_builddir)/bernstein/libbernstein.la
203 endif
204 libbarvinok_la_LIBADD = libbarvinok-core.la $(BERNSTEIN_LA)
205 libbarvinok_la_LDFLAGS = @BV_LDFLAGS@ -version-info @versioninfo@ \
206                                 $(AM_LDFLAGS)
207 LDADD = libbarvinok-core.la @POLYLIB_LIBS@ @PIPLIB_LIBS@
209 test_SOURCES = \
210         evalue_read.c \
211         evalue_read.h \
212         test.c
213 testlib_SOURCES = \
214         evalue_read.c \
215         evalue_read.h \
216         testlib.cc
217 barvinok_count_SOURCES = barvinok_count.c
218 barvinok_ehrhart_SOURCES = \
219         barvinok_ehrhart.cc \
220         evalue_convert.cc \
221         evalue_convert.h \
222         $(FDSTREAM)
223 barvinok_union_SOURCES = barvinok_union.cc
224 if HAVE_OMEGA
225 BEEO_SOURCES = \
226         omega_interface/Exit.cc \
227         omega_interface/convert.cc \
228         omega_interface/count.cc
229 else
230 BEEO_SOURCES = 
231 endif
232 if USE_FDSTREAM
233 FDSTREAM = fdstream.cc fdstream.h
234 endif
235 barvinok_enumerate_SOURCES = \
236         barvinok_enumerate.cc \
237         evalue_convert.cc \
238         evalue_convert.h \
239         $(FDSTREAM) \
240         skewed_genfun.cc \
241         skewed_genfun.h \
242         verify.h \
243         verify.c \
244         verif_ehrhart.h \
245         verif_ehrhart.c \
246         verify_series.h \
247         verify_series.cc
248 EXTRA_barvinok_enumerate_SOURCES = fdstream.cc fdstream.h
249 barvinok_enumerate_e_SOURCES = \
250         barvinok_enumerate_e.cc \
251         evalue_convert.cc \
252         evalue_convert.h \
253         $(FDSTREAM) \
254         skewed_genfun.cc \
255         skewed_genfun.h \
256         verify.h \
257         verify.c \
258         verif_ehrhart.h \
259         verif_ehrhart.c \
260         verify_series.h \
261         verify_series.cc \
262         $(BEEO_SOURCES)
263 EXTRA_barvinok_enumerate_e_SOURCES = fdstream.cc fdstream.h
264 if USE_PARKER
265     MONA_LIBS = -ldfa -lbdd -lmem
266     PARKER_LA = parker/libparker.la
267     PARKERLDFLAGS = -L$(MONAPATH)/DFA -L$(MONAPATH)/BDD -L$(MONAPATH)/Mem
268     PARKERCPPFLAGS = -I$(MONAPATH)/Mem -I$(MONAPATH)/DFA -I$(MONAPATH)/BDD
269 endif
270 barvinok_enumerate_e_CPPFLAGS = \
271         $(PARKERCPPFLAGS) @OMEGA_CPPFLAGS@ $(AM_CPPFLAGS)
272 barvinok_enumerate_e_LDFLAGS = $(PARKERLDFLAGS) @OMEGA_LDFLAGS@ @LDFLAGS@
273 barvinok_enumerate_e_LDADD = \
274         $(PARKER_LA) $(MONA_LIBS) @OMEGA_LIBS@ libbarvinok-core.la \
275         @POLYLIB_LIBS@ @PIPLIB_LIBS@
276 barvinok_bound_SOURCES = \
277         evalue_convert.cc \
278         evalue_convert.h \
279         evalue_read.c \
280         evalue_read.h \
281         $(FDSTREAM) \
282         bound.cc \
283         verify.h \
284         verify.c
285 EXTRA_barvinok_bound_SOURCES = fdstream.cc fdstream.h
286 barvinok_bound_LDADD = \
287         libbarvinok-core.la libbarvinok.la @POLYLIB_LIBS@ @PIPLIB_LIBS@
288 barvinok_summate_SOURCES = \
289         barvinok_summate.cc \
290         evalue_convert.cc \
291         evalue_convert.h \
292         evalue_read.c \
293         evalue_read.h \
294         $(FDSTREAM) \
295         verify.h \
296         verify.c
297 EXTRA_barvinok_summate_SOURCES = fdstream.cc fdstream.h
298 4coins_SOURCES = 4coins.cc
299 lexmin_SOURCES = \
300         lexmin.h \
301         lexmin.cc \
302         combine.c \
303         combine.h \
304         edomain.cc \
305         edomain.h \
306         evalue_util.cc \
307         evalue_util.h \
308         verify.h \
309         verify.c
310 test_approx_SOURCES = \
311         test_approx.c \
312         verify.h \
313         verify.c
314 test_bound_SOURCES = \
315         test_bound.cc \
316         evalue_convert.cc \
317         evalue_convert.h \
318         evalue_read.c \
319         evalue_read.h \
320         $(FDSTREAM) \
321         verify.h \
322         verify.c
323 EXTRA_test_bound_SOURCES = fdstream.cc fdstream.h
324 test_bound_LDADD = \
325         libbarvinok-core.la libbarvinok.la @POLYLIB_LIBS@ @PIPLIB_LIBS@
327 TESTFILES = $(shell find $(top_srcdir)/tests -type f ! -path '*CVS*')
329 EXTRA_DIST = \
330     ChangeLog \
331     $(TESTFILES) \
332     latte2polylib.pl \
333     NTL_5_3_2.patch \
334     basis_reduction_templ.c \
335     cdd94e-test \
336     polysign_cdd_template.cc \
337     barvinok/NTL.h.broken \
338     barvinok/NTL.h.normal \
339     barvinok/set.h.broken \
340     barvinok/set.h.normal \
341     doc/Internal.tex \
342     doc/applications.tex \
343     doc/barvinok.tex \
344     doc/omega.tex \
345     doc/polymake.tex \
346     doc/reports.tex \
347     doc/barvinok.bib \
348     doc/barvinok.gdf \
349     doc/chicago.bst \
350     doc/chicago.sty \
351     doc/mydefs.sty \
352     polymake/Makefile.in \
353     polymake/README \
354     polymake/autogen.sh \
355     polymake/configure.in \
356     polymake/convert.cc \
357     polymake/convert.h \
358     polymake/h_star_vector.cc \
359     polymake/lattice_points.cc
361 ACLOCAL_AMFLAGS = -I m4
363 install-data-local:
364         @test -z "$(pkgconfig_libdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfig_libdir)"
365         $(INSTALL_DATA) $(pkgconfig_libfile) "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
367 uninstall-local:
368         rm -f "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
370 dist-hook:
371         (cd $(distdir)/polymake; \
372             ./autogen.sh; rm -rf autogen.sh autom4te.cache)
373         (cd doc; make barvinok.pdf)
374         cp doc/barvinok.pdf $(distdir)/doc/
375         if test -f $(top_srcdir)/.git/HEAD; then \
376             echo @GIT_HEAD_VERSION@ > $(distdir)/GIT_HEAD_ID; \
377         else \
378             echo $(GIT_HEAD_ID) > $(distdir)/GIT_HEAD_ID; \
379         fi
381 dist-git: dist
382         mv $(distdir).tar.gz @GIT_HEAD_VERSION@.tar.gz
384 BEE_TESTDIRS = ehrhart_e ehrhart_e/scarf ehrhart_e/piplib
386 check: check-testlib check-enumerate check-enumerate_e check-test \
387         check-lexmin check-approx check-evalue check-euler check-lw
388 check-testlib: testlib$(EXEEXT)
389         ./testlib$(EXEEXT)
390 check-approx: test_approx$(EXEEXT)
391         @for i in $(top_srcdir)/tests/ehrhart/*; do \
392             if test -f $$i; then \
393                 echo $$i | ./test_approx$(EXEEXT) -q -r 10 || exit; \
394             fi \
395         done
396 check-evalue: @bv_barvinok_bound@ barvinok_summate$(EXEEXT)
397         @for i in $(top_srcdir)/tests/evalue/*; do \
398             if test -f $$i; then \
399                 echo $$i; \
400                 if test -n "@bv_barvinok_bound@"; then \
401                     ./barvinok_bound$(EXEEXT) -T -r30 < $$i || exit; \
402                     echo $$i | ./test_bound$(EXEEXT) -q -r30 || exit; \
403                 fi; \
404                 ./barvinok_summate$(EXEEXT) -T -r30 < $$i || exit; \
405             fi \
406         done
407 check-euler: barvinok_summate$(EXEEXT)
408         @for i in $(top_srcdir)/tests/euler/*; do \
409             if test -f $$i; then \
410                 for method in 'euler' 'laurent'; do \
411                     opt="--summation=$$method"; \
412                     echo $$i $$opt; \
413                     ./barvinok_summate$(EXEEXT) -T $$opt < $$i || exit; \
414                 done \
415             fi \
416         done
417 if HAVE_TOPCOM
418     TOPCOM_CD = '--chamber-decomposition=topcom'
419 endif
420 check-enumerate: barvinok_enumerate$(EXEEXT)
421         @for i in $(top_srcdir)/tests/ehrhart/*; do \
422             if test -f $$i; then \
423                 echo $$i; \
424                 for options in '' '--series' '--series --primal' $(TOPCOM_CD); do \
425                     for spec in 'random' 'bf' 'df'; do \
426                         opt="--specialization=$$spec $$options"; \
427                         echo "        $$opt"; \
428                         ./barvinok_enumerate$(EXEEXT) --verify $$opt < $$i || exit; \
429                     done \
430                 done; \
431                 opt="--summation=bernoulli"; \
432                 echo "        $$opt"; \
433                 ./barvinok_enumerate$(EXEEXT) --verify $$opt < $$i || exit; \
434             fi \
435         done
436 check-enumerate_e: barvinok_enumerate_e$(EXEEXT)
437         @for dir in $(BEE_TESTDIRS); do \
438             for i in $(top_srcdir)/tests/$$dir/*; do \
439                 if test -f $$i; then \
440                     for options in '' '--pip' '--pip --omega'; do \
441                         for spec in 'random' 'bf' 'df'; do \
442                             opt="--specialization=$$spec $$options"; \
443                             echo $$i $$opt; \
444                             ./barvinok_enumerate_e$(EXEEXT) --verify $$opt < $$i || exit; \
445                         done \
446                     done \
447                 fi \
448             done \
449         done
450         @for i in $(top_srcdir)/tests/ehrhart_e/scarf/*; do \
451             if test -f $$i; then \
452                 for spec in 'random' 'bf' 'df'; do \
453                     opt="--specialization=$$spec --scarf"; \
454                     echo $$i $$opt; \
455                     ./barvinok_enumerate_e$(EXEEXT) --verify $$opt < $$i || exit; \
456                 done; \
457                 echo $$i --series; \
458                 ./barvinok_enumerate_e$(EXEEXT) --verify --series < $$i || exit; \
459             fi \
460         done
461 check-test: test$(EXEEXT)
462         @for i in $(top_srcdir)/tests/*; do \
463             if test -f $$i; then \
464                 for options in '--index=10' '--primal --index=10'; do \
465                     for spec in 'random' 'bf' 'df' 'todd'; do \
466                         opt="--specialization=$$spec $$options"; \
467                         echo -n $$i $$opt; \
468                         ./test$(EXEEXT) $$opt < $$i || echo -n " NOT"; \
469                         echo " ok"; \
470                     done \
471                 done \
472             fi \
473         done
474 check-lw: test$(EXEEXT)
475         @for i in $(top_srcdir)/tests/lattice_width/*; do \
476             if test -f $$i; then \
477                 echo -n $$i; \
478                 ./test$(EXEEXT) < $$i || echo -n " NOT"; \
479                 echo " ok"; \
480             fi \
481         done
482 if HAVE_GLPK
483 check-lexmin: lexmin$(EXEEXT)
484         @for i in $(top_srcdir)/tests/lexmin/*; do \
485             if test -f $$i; then \
486                 for spec in 'random' 'bf' 'df'; do \
487                     opt="--specialization=$$spec"; \
488                     echo $$i $$opt; \
489                     ./lexmin$(EXEEXT) --verify $$opt < $$i || exit; \
490                 done \
491             fi \
492         done
493 else
494 check-lexmin:
495 endif
497 version.h: @GIT_HEAD@
498         echo '#define GIT_HEAD_ID "'@GIT_HEAD_VERSION@'"' > $@