update isl for change in isl_hash_table_foreach
[barvinok.git] / Makefile.am
bloba65e7391cc9bcb62fec28819b0170df43bb66571
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.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_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     isl_param_util.c \
137     isl_param_util.h \
138     lattice_point.cc \
139     lattice_point.h \
140     lattice_width.c \
141     lattice_width.h \
142     laurent.cc \
143     laurent.h \
144     laurent_old.cc \
145     laurent_old.h \
146     normalization.c \
147     normalization.h \
148     options.c \
149     param_polynomial.cc \
150     param_polynomial.h \
151     param_util.c \
152     param_util.h \
153     $(POLYSIGN_CDD) \
154     $(POLYSIGN_GLPK) \
155     polysign.c \
156     polysign_pip.c \
157     polysign_polylib.c \
158     polysign.h \
159     power.h \
160     reduce_domain.c \
161     reduce_domain.h \
162     reducer.cc \
163     reducer.h \
164     remove_equalities.h \
165     remove_equalities.c \
166     sample.c \
167     scale.c \
168     scale.h \
169     scarf.cc \
170     section_array.h \
171     series.cc \
172     $(TOPCOM) \
173     summate.c \
174     summate.h \
175     vertex_cone.cc \
176     vertex_cone.h \
177     volume.c \
178     volume.h \
179     mat_util.cc \
180     mat_util.h \
181     matrix_read.cc \
182     matrix_read.h \
183     barvinok.cc \
184     barvinok_e.cc \
185     $(BR_CDD) \
186     $(BR_GLPK)
187 EXTRA_libbarvinok_la_SOURCES = \
188     basis_reduction_cdd.cc \
189     basis_reduction_glpk.c \
190     hilbert.c \
191     polysign_cddf.cc \
192     polysign_cdd.cc \
193     polysign.c \
194     initcdd.cc \
195     initcdd.h \
196     topcom.c \
197     topcom.h
198 if BUNDLED_POLYLIB
199     POLYLIB_LA = $(top_builddir)/polylib/libpolylibgmp.la
200 endif
201 if BUNDLED_PIPLIB
202     PIPLIB_LA = $(top_builddir)/piplib/libpiplibMP.la
203 endif
204 if USE_ZSOLVE
205     ZSOLVE_LA = zsolve/libzsolve.la
206 endif
207 libbarvinok_la_LIBADD = @LTLIBOBJS@ $(LIB_ISL_POLYLIB) $(LIB_ISL) \
208                              $(POLYLIB_LA) @POLYLIB_LIBS@ \
209                              $(PIPLIB_LA) @PIPLIB_LIBS@ \
210                              $(ZSOLVE_LA)
211 libbarvinok_la_LDFLAGS = @BV_LDFLAGS@ -version-info @versioninfo@ \
212                                 $(AM_LDFLAGS)
213 LDADD = libbarvinok.la @ISL_POLYLIB_LIBS@ @ISL_LIBS@ \
214         @POLYLIB_LIBS@ @PIPLIB_LIBS@
216 test_SOURCES = \
217         evalue_read.c \
218         evalue_read.h \
219         test.c
220 testlib_SOURCES = \
221         evalue_read.c \
222         evalue_read.h \
223         testlib.cc
224 barvinok_count_SOURCES = barvinok_count.c
225 barvinok_ehrhart_SOURCES = \
226         barvinok_ehrhart_options.c \
227         barvinok_ehrhart_options.h \
228         barvinok_ehrhart.cc \
229         evalue_convert_options.c \
230         evalue_convert.cc \
231         evalue_convert.h \
232         $(FDSTREAM)
233 barvinok_union_SOURCES = \
234         barvinok_union_options.c \
235         barvinok_union_options.h \
236         barvinok_union.cc
237 if HAVE_OMEGA
238 BEEO_SOURCES = \
239         omega_interface/Exit.cc \
240         omega_interface/convert.h \
241         omega_interface/convert.cc \
242         omega_interface/count.h \
243         omega_interface/count.cc
244 else
245 BEEO_SOURCES = 
246 endif
247 if USE_FDSTREAM
248 FDSTREAM = fdstream.cc fdstream.h
249 endif
250 barvinok_enumerate_SOURCES = \
251         barvinok_enumerate_options.c \
252         barvinok_enumerate_options.h \
253         barvinok_enumerate.cc \
254         evalue_convert_options.c \
255         evalue_convert.cc \
256         evalue_convert.h \
257         $(FDSTREAM) \
258         skewed_genfun.cc \
259         skewed_genfun.h \
260         verify.h \
261         verify.c \
262         verif_ehrhart.h \
263         verif_ehrhart.c \
264         verify_series.h \
265         verify_series.cc
266 EXTRA_barvinok_enumerate_SOURCES = fdstream.cc fdstream.h
267 barvinok_enumerate_e_SOURCES = \
268         barvinok_enumerate_e_options.c \
269         barvinok_enumerate_e_options.h \
270         barvinok_enumerate_e.cc \
271         evalue_convert_options.c \
272         evalue_convert.cc \
273         evalue_convert.h \
274         $(FDSTREAM) \
275         skewed_genfun.cc \
276         skewed_genfun.h \
277         verify.h \
278         verify.c \
279         verif_ehrhart.h \
280         verif_ehrhart.c \
281         verify_series.h \
282         verify_series.cc \
283         $(BEEO_SOURCES)
284 EXTRA_barvinok_enumerate_e_SOURCES = fdstream.cc fdstream.h
285 if USE_PARKER
286     MONA_LIBS = -ldfa -lbdd -lmem
287     PARKER_LA = parker/libparker.la
288     PARKERLDFLAGS = -L$(MONAPATH)/DFA -L$(MONAPATH)/BDD -L$(MONAPATH)/Mem
289     PARKERCPPFLAGS = -I$(MONAPATH)/Mem -I$(MONAPATH)/DFA -I$(MONAPATH)/BDD
290 endif
291 barvinok_enumerate_e_CPPFLAGS = \
292         $(PARKERCPPFLAGS) @OMEGA_CPPFLAGS@ $(AM_CPPFLAGS)
293 barvinok_enumerate_e_LDFLAGS = $(PARKERLDFLAGS) @OMEGA_LDFLAGS@ @LDFLAGS@
294 barvinok_enumerate_e_LDADD = \
295         $(PARKER_LA) $(MONA_LIBS) @OMEGA_LIBS@ $(OMEGA_LA) libbarvinok.la \
296         @ISL_POLYLIB_LIBS@ @ISL_LIBS@ @POLYLIB_LIBS@ @PIPLIB_LIBS@
297 barvinok_bound_SOURCES = \
298         evalue_convert_options.c \
299         evalue_convert.cc \
300         evalue_convert.h \
301         evalue_read.c \
302         evalue_read.h \
303         $(FDSTREAM) \
304         bound_options.h \
305         bound_options.c \
306         bound.cc \
307         verify.h \
308         verify.c
309 EXTRA_barvinok_bound_SOURCES = fdstream.cc fdstream.h
310 barvinok_bound_LDADD = \
311         libbarvinok.la @ISL_POLYLIB_LIBS@ @ISL_LIBS@ \
312         @POLYLIB_LIBS@ @PIPLIB_LIBS@
313 barvinok_summate_SOURCES = \
314         barvinok_summate_options.c \
315         barvinok_summate_options.h \
316         barvinok_summate.cc \
317         evalue_convert_options.c \
318         evalue_convert.cc \
319         evalue_convert.h \
320         evalue_read.c \
321         evalue_read.h \
322         $(FDSTREAM) \
323         verify.h \
324         verify.c
325 EXTRA_barvinok_summate_SOURCES = fdstream.cc fdstream.h
326 4coins_SOURCES = 4coins.cc
327 semigroup_holes_SOURCES = semigroup_holes.cc
328 lexmin_SOURCES = \
329         lexmin_options.c \
330         lexmin.h \
331         lexmin.cc \
332         combine.c \
333         combine.h \
334         edomain.cc \
335         edomain.h \
336         evalue_util.cc \
337         evalue_util.h \
338         verify.h \
339         verify.c
340 test_approx_SOURCES = \
341         test_approx.c \
342         verify.h \
343         verify.c
344 test_bound_SOURCES = \
345         test_bound.c \
346         evalue_convert_options.c \
347         evalue_convert.cc \
348         evalue_convert.h \
349         evalue_read.c \
350         evalue_read.h \
351         $(FDSTREAM) \
352         verify.h \
353         verify.c
354 EXTRA_test_bound_SOURCES = fdstream.cc fdstream.h
355 test_bound_LDADD = \
356         libbarvinok.la @ISL_POLYLIB_LIBS@ @ISL_LIBS@ \
357         @POLYLIB_LIBS@ @PIPLIB_LIBS@
358 evalue_convert_SOURCES = \
359         evalue_convert_main.c \
360         evalue_convert_options.c \
361         evalue_convert.cc \
362         evalue_convert.h \
363         evalue_read.c \
364         evalue_read.h \
365         $(FDSTREAM)
366 iscc_SOURCES =  \
367         isl_obj_list.h \
368         isl_obj_list.c \
369         iscc.c
370 iscc_LDADD = \
371         libbarvinok.la @ISL_POLYLIB_LIBS@ @ISL_LIBS@ \
372         @POLYLIB_LIBS@ @PIPLIB_LIBS@
374 TESTFILES = $(shell find $(top_srcdir)/tests -type f ! -path '*CVS*')
376 EXTRA_DIST = \
377     ChangeLog \
378     $(TESTFILES) \
379     latte2polylib.pl \
380     NTL_5_3_2.patch \
381     basis_reduction_templ.c \
382     cdd94e-test \
383     polysign_cdd_template.cc \
384     barvinok/NTL.h.broken \
385     barvinok/NTL.h.normal \
386     barvinok/set.h.broken \
387     barvinok/set.h.normal \
388     doc/isl.tex \
389     doc/Internal.tex \
390     doc/applications.tex \
391     doc/barvinok.tex \
392     doc/polymake.tex \
393     doc/reports.tex \
394     doc/barvinok.bib \
395     doc/barvinok.gdf \
396     doc/chicago.bst \
397     doc/chicago.sty \
398     doc/mydefs.sty \
399     polymake/Makefile.in \
400     polymake/README \
401     polymake/autogen.sh \
402     polymake/configure.in \
403     polymake/convert.cc \
404     polymake/convert.h \
405     polymake/h_star_vector.cc \
406     polymake/lattice_points.cc
408 ACLOCAL_AMFLAGS = -I m4
410 install-data-local:
411         @test -z "$(pkgconfig_libdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfig_libdir)"
412         $(INSTALL_DATA) $(pkgconfig_libfile) "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
414 uninstall-local:
415         rm -f "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
417 dist-hook:
418         (cd $(distdir)/polymake; \
419             ./autogen.sh; rm -rf autogen.sh autom4te.cache)
420         (cd doc; make barvinok.pdf)
421         cp doc/barvinok.pdf $(distdir)/doc/
422         if test -f $(top_srcdir)/.git/HEAD; then \
423             echo @GIT_HEAD_VERSION@ > $(distdir)/GIT_HEAD_ID; \
424         else \
425             echo $(GIT_HEAD_ID) > $(distdir)/GIT_HEAD_ID; \
426         fi
428 dist-git: dist
429         mv $(distdir).tar.gz @GIT_HEAD_VERSION@.tar.gz
431 BEE_TESTDIRS = ehrhart_e ehrhart_e/scarf ehrhart_e/piplib
433 check: check-testlib check-enumerate check-enumerate_e check-test \
434         check-lexmin check-approx check-evalue check-euler check-lw
435 check-testlib: testlib$(EXEEXT)
436         ./testlib$(EXEEXT)
437 check-approx: test_approx$(EXEEXT)
438         @for i in $(top_srcdir)/tests/ehrhart/*; do \
439             if test -f $$i; then \
440                 echo $$i | ./test_approx$(EXEEXT) -q -r 10 || exit; \
441             fi \
442         done
443 check-evalue: barvinok_bound$(EXEEXT) test_bound$(EXEEXT) barvinok_summate$(EXEEXT)
444         @for i in $(top_srcdir)/tests/evalue/*; do \
445             if test -f $$i; then \
446                 echo $$i; \
447                 if test -n "@bv_barvinok_bound@"; then \
448                     ./barvinok_bound$(EXEEXT) -T -r30 < $$i || exit; \
449                     echo $$i | ./test_bound$(EXEEXT) -q -r30 || exit; \
450                 fi; \
451                 ./barvinok_summate$(EXEEXT) -T -r30 < $$i || exit; \
452             fi \
453         done
454 check-euler: barvinok_summate$(EXEEXT)
455         @for i in $(top_srcdir)/tests/euler/*; do \
456             if test -f $$i; then \
457                 for method in 'euler' 'laurent_old' 'laurent'; do \
458                     opt="--summation=$$method"; \
459                     echo $$i $$opt; \
460                     ./barvinok_summate$(EXEEXT) -T $$opt < $$i || exit; \
461                 done \
462             fi \
463         done
464 if HAVE_TOPCOM
465     TOPCOM_CD = '--chamber-decomposition=topcom'
466 endif
467 ISL_CD = '--chamber-decomposition=isl'
468 check-enumerate: barvinok_enumerate$(EXEEXT)
469         @for i in $(top_srcdir)/tests/ehrhart/*; do \
470             if test -f $$i; then \
471                 echo $$i; \
472                 for options in '' '--series' '--series --primal' $(TOPCOM_CD) $(ISL_CD); do \
473                     for spec in 'random' 'bf' 'df'; do \
474                         opt="--specialization=$$spec $$options"; \
475                         echo "        $$opt"; \
476                         ./barvinok_enumerate$(EXEEXT) --verify $$opt < $$i || exit; \
477                     done \
478                 done; \
479                 opt="--summation=bernoulli"; \
480                 echo "        $$opt"; \
481                 ./barvinok_enumerate$(EXEEXT) --verify $$opt < $$i || exit; \
482             fi \
483         done
484 if HAVE_OMEGA
485     SPEC_OMEGA = '--isl --omega'
486 endif
487 check-enumerate_e: barvinok_enumerate_e$(EXEEXT)
488         @for dir in $(BEE_TESTDIRS); do \
489             for i in $(top_srcdir)/tests/$$dir/*; do \
490                 if test -f $$i; then \
491                     for options in '' $(SPEC_OMEGA) '--isl'; do \
492                         for spec in 'random' 'bf' 'df'; do \
493                             opt="--specialization=$$spec $$options"; \
494                             echo $$i $$opt; \
495                             ./barvinok_enumerate_e$(EXEEXT) --verify $$opt < $$i || exit; \
496                         done \
497                     done \
498                 fi \
499             done \
500         done
501         @for i in $(top_srcdir)/tests/ehrhart_e/scarf/*; do \
502             if test -f $$i; then \
503                 for spec in 'random' 'bf' 'df'; do \
504                     opt="--specialization=$$spec --scarf"; \
505                     echo $$i $$opt; \
506                     ./barvinok_enumerate_e$(EXEEXT) --verify $$opt < $$i || exit; \
507                 done; \
508                 echo $$i --series; \
509                 ./barvinok_enumerate_e$(EXEEXT) --verify --series < $$i || exit; \
510             fi \
511         done
512 check-test: test$(EXEEXT)
513         @failed=0; \
514         for i in $(top_srcdir)/tests/*; do \
515             if test -f $$i; then \
516                 for options in '--index=10' '--primal --index=10'; do \
517                     for spec in 'random' 'bf' 'df' 'todd'; do \
518                         opt="--specialization=$$spec $$options"; \
519                         echo -n $$i $$opt; \
520                         ./test$(EXEEXT) $$opt < $$i; \
521                         if test "$$?" -ne "0"; then \
522                             failed=`expr $$failed + 1`; \
523                             echo " NOT ok"; \
524                         else \
525                             echo " ok"; \
526                         fi; \
527                     done \
528                 done \
529             fi \
530         done; \
531         for i in $(top_srcdir)/tests/sample/*; do \
532             echo -n $$i; \
533             ./test$(EXEEXT) < $$i; \
534             if test "$$?" -ne "0"; then \
535                 failed=`expr $$failed + 1`; \
536                 echo " NOT ok"; \
537             else \
538                 echo " ok"; \
539             fi; \
540         done; \
541         if test $$failed != 0; then \
542                 echo "$$failed tests failed"; \
543                 exit -1; \
544         fi
545 check-lw: test$(EXEEXT)
546         @failed=0; \
547         for i in $(top_srcdir)/tests/lattice_width/*; do \
548             if test -f $$i; then \
549                 echo -n $$i; \
550                 ./test$(EXEEXT) < $$i; \
551                 if test "$$?" -ne "0"; then \
552                     failed=`expr $$failed + 1`; \
553                     echo " NOT ok"; \
554                 else \
555                     echo " ok"; \
556                 fi; \
557             fi \
558         done; \
559         if test $$failed != 0; then \
560                 echo "$$failed tests failed"; \
561                 exit -1; \
562         fi
563 if HAVE_GLPK
564 check-lexmin: lexmin$(EXEEXT)
565         @for i in $(top_srcdir)/tests/lexmin/*; do \
566             if test -f $$i; then \
567                 for spec in 'random' 'bf' 'df'; do \
568                     opt="--specialization=$$spec"; \
569                     echo $$i $$opt; \
570                     ./lexmin$(EXEEXT) --verify $$opt < $$i || exit; \
571                 done \
572             fi \
573         done
574 else
575 check-lexmin:
576 endif
578 version.h: @GIT_HEAD@
579         echo '#define GIT_HEAD_ID "'@GIT_HEAD_VERSION@'"' > $@