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