isl_map_card: postpone shuffling around of dimensions until PolyLib conversion
[barvinok.git] / Makefile.am
blobc06f08d3e16a7d46edb6e21f95dbfcf71440c759
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_CPPFLAGS = @CLOOG_CFLAGS@ $(AM_CPPFLAGS)
371 iscc_LDADD = \
372         libbarvinok.la @CLOOG_LIBS@ @CLOOG_LIBS@ @ISL_POLYLIB_LIBS@ @ISL_LIBS@ \
373         @POLYLIB_LIBS@ @PIPLIB_LIBS@
375 TESTFILES = $(shell find $(top_srcdir)/tests -type f ! -path '*CVS*')
377 EXTRA_DIST = \
378     ChangeLog \
379     $(TESTFILES) \
380     latte2polylib.pl \
381     NTL_5_3_2.patch \
382     basis_reduction_templ.c \
383     cdd94e-test \
384     polysign_cdd_template.cc \
385     barvinok/NTL.h.broken \
386     barvinok/NTL.h.normal \
387     barvinok/set.h.broken \
388     barvinok/set.h.normal \
389     doc/isl.tex \
390     doc/Internal.tex \
391     doc/applications.tex \
392     doc/barvinok.tex \
393     doc/polymake.tex \
394     doc/reports.tex \
395     doc/barvinok.bib \
396     doc/barvinok.gdf \
397     doc/chicago.bst \
398     doc/chicago.sty \
399     doc/mydefs.sty \
400     polymake/Makefile.in \
401     polymake/README \
402     polymake/autogen.sh \
403     polymake/configure.in \
404     polymake/convert.cc \
405     polymake/convert.h \
406     polymake/h_star_vector.cc \
407     polymake/lattice_points.cc
409 ACLOCAL_AMFLAGS = -I m4
411 install-data-local:
412         @test -z "$(pkgconfig_libdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfig_libdir)"
413         $(INSTALL_DATA) $(pkgconfig_libfile) "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
415 uninstall-local:
416         rm -f "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
418 dist-hook:
419         (cd $(distdir)/polymake; \
420             ./autogen.sh; rm -rf autogen.sh autom4te.cache)
421         (cd doc; make barvinok.pdf)
422         cp doc/barvinok.pdf $(distdir)/doc/
423         if test -f $(top_srcdir)/.git/HEAD; then \
424             echo @GIT_HEAD_VERSION@ > $(distdir)/GIT_HEAD_ID; \
425         else \
426             echo $(GIT_HEAD_ID) > $(distdir)/GIT_HEAD_ID; \
427         fi
429 dist-git: dist
430         mv $(distdir).tar.gz @GIT_HEAD_VERSION@.tar.gz
432 BEE_TESTDIRS = ehrhart_e ehrhart_e/scarf ehrhart_e/piplib
434 check: check-testlib check-enumerate check-enumerate_e check-test \
435         check-lexmin check-approx check-evalue check-euler check-lw
436 check-testlib: testlib$(EXEEXT)
437         ./testlib$(EXEEXT)
438 check-approx: test_approx$(EXEEXT)
439         @for i in $(top_srcdir)/tests/ehrhart/*; do \
440             if test -f $$i; then \
441                 echo $$i | ./test_approx$(EXEEXT) -q -r 10 || exit; \
442             fi \
443         done
444 check-evalue: barvinok_bound$(EXEEXT) test_bound$(EXEEXT) barvinok_summate$(EXEEXT)
445         @for i in $(top_srcdir)/tests/evalue/*; do \
446             if test -f $$i; then \
447                 echo $$i; \
448                 if test -n "@bv_barvinok_bound@"; then \
449                     ./barvinok_bound$(EXEEXT) -T -r30 < $$i || exit; \
450                     echo $$i | ./test_bound$(EXEEXT) -q -r30 || exit; \
451                 fi; \
452                 ./barvinok_summate$(EXEEXT) -T -r30 < $$i || exit; \
453             fi \
454         done
455 check-euler: barvinok_summate$(EXEEXT)
456         @for i in $(top_srcdir)/tests/euler/*; do \
457             if test -f $$i; then \
458                 for method in 'euler' 'laurent_old' 'laurent'; do \
459                     opt="--summation=$$method"; \
460                     echo $$i $$opt; \
461                     ./barvinok_summate$(EXEEXT) -T $$opt < $$i || exit; \
462                 done \
463             fi \
464         done
465 if HAVE_TOPCOM
466     TOPCOM_CD = '--chamber-decomposition=topcom'
467 endif
468 ISL_CD = '--chamber-decomposition=isl'
469 check-enumerate: barvinok_enumerate$(EXEEXT)
470         @for i in $(top_srcdir)/tests/ehrhart/*; do \
471             if test -f $$i; then \
472                 echo $$i; \
473                 for options in '' '--series' '--series --primal' $(TOPCOM_CD) $(ISL_CD); do \
474                     for spec in 'random' 'bf' 'df'; do \
475                         opt="--specialization=$$spec $$options"; \
476                         echo "        $$opt"; \
477                         ./barvinok_enumerate$(EXEEXT) --verify $$opt < $$i || exit; \
478                     done \
479                 done; \
480                 opt="--summation=bernoulli"; \
481                 echo "        $$opt"; \
482                 ./barvinok_enumerate$(EXEEXT) --verify $$opt < $$i || exit; \
483             fi \
484         done
485 if HAVE_OMEGA
486     SPEC_OMEGA = '--isl --omega'
487 endif
488 check-enumerate_e: barvinok_enumerate_e$(EXEEXT)
489         @for dir in $(BEE_TESTDIRS); do \
490             for i in $(top_srcdir)/tests/$$dir/*; do \
491                 if test -f $$i; then \
492                     for options in '' $(SPEC_OMEGA) '--isl'; do \
493                         for spec in 'random' 'bf' 'df'; do \
494                             opt="--specialization=$$spec $$options"; \
495                             echo $$i $$opt; \
496                             ./barvinok_enumerate_e$(EXEEXT) --verify $$opt < $$i || exit; \
497                         done \
498                     done \
499                 fi \
500             done \
501         done
502         @for i in $(top_srcdir)/tests/ehrhart_e/scarf/*; do \
503             if test -f $$i; then \
504                 for spec in 'random' 'bf' 'df'; do \
505                     opt="--specialization=$$spec --scarf"; \
506                     echo $$i $$opt; \
507                     ./barvinok_enumerate_e$(EXEEXT) --verify $$opt < $$i || exit; \
508                 done; \
509                 echo $$i --series; \
510                 ./barvinok_enumerate_e$(EXEEXT) --verify --series < $$i || exit; \
511             fi \
512         done
513 check-test: test$(EXEEXT)
514         @failed=0; \
515         for i in $(top_srcdir)/tests/*; do \
516             if test -f $$i; then \
517                 for options in '--index=10' '--primal --index=10'; do \
518                     for spec in 'random' 'bf' 'df' 'todd'; do \
519                         opt="--specialization=$$spec $$options"; \
520                         echo -n $$i $$opt; \
521                         ./test$(EXEEXT) $$opt < $$i; \
522                         if test "$$?" -ne "0"; then \
523                             failed=`expr $$failed + 1`; \
524                             echo " NOT ok"; \
525                         else \
526                             echo " ok"; \
527                         fi; \
528                     done \
529                 done \
530             fi \
531         done; \
532         for i in $(top_srcdir)/tests/sample/*; do \
533             echo -n $$i; \
534             ./test$(EXEEXT) < $$i; \
535             if test "$$?" -ne "0"; then \
536                 failed=`expr $$failed + 1`; \
537                 echo " NOT ok"; \
538             else \
539                 echo " ok"; \
540             fi; \
541         done; \
542         if test $$failed != 0; then \
543                 echo "$$failed tests failed"; \
544                 exit -1; \
545         fi
546 check-lw: test$(EXEEXT)
547         @failed=0; \
548         for i in $(top_srcdir)/tests/lattice_width/*; do \
549             if test -f $$i; then \
550                 echo -n $$i; \
551                 ./test$(EXEEXT) < $$i; \
552                 if test "$$?" -ne "0"; then \
553                     failed=`expr $$failed + 1`; \
554                     echo " NOT ok"; \
555                 else \
556                     echo " ok"; \
557                 fi; \
558             fi \
559         done; \
560         if test $$failed != 0; then \
561                 echo "$$failed tests failed"; \
562                 exit -1; \
563         fi
564 if HAVE_GLPK
565 check-lexmin: lexmin$(EXEEXT)
566         @for i in $(top_srcdir)/tests/lexmin/*; do \
567             if test -f $$i; then \
568                 for spec in 'random' 'bf' 'df'; do \
569                     opt="--specialization=$$spec"; \
570                     echo $$i $$opt; \
571                     ./lexmin$(EXEEXT) --verify $$opt < $$i || exit; \
572                 done \
573             fi \
574         done
575 else
576 check-lexmin:
577 endif
579 version.h: @GIT_HEAD@
580         echo '#define GIT_HEAD_ID "'@GIT_HEAD_VERSION@'"' > $@