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