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