update isl-polylib for fix in header file
[barvinok.git] / Makefile.am
blobfb03a0bc53fdb796f4ab054542831ad2b9adb55b
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_PIPLIB
7     MAYBE_PIPLIB = piplib
8 endif
9 if BUNDLED_ISL
10     MAYBE_ISL = isl
11     ISL_LA = $(top_builddir)/isl/libisl.la
12     LOCAL_ISL_LA = isl/libisl.la
13 endif
14 if BUILD_ISL
15     ISL_LA = $(ISL_BUILDDIR)/libisl.la
16 endif
17 if BUNDLED_ISL_POLYLIB
18     MAYBE_ISL_POLYLIB = isl-polylib
19     ISL_POLYLIB_LA = $(top_builddir)/isl-polylib/libisl-polylib.la
20 endif
21 if BUNDLED_OMEGA
22     MAYBE_OMEGA = omega
23     OMEGA_LA = $(top_builddir)/omega/omega_lib/libomega.la
24 endif
25 if USE_ZSOLVE
26     MAYBE_ZSOLVE = zsolve
27 endif
28 if USE_PARKER
29     MAYBE_PARKER = parker
30 endif
31 SUBDIRS = $(MAYBE_PIPLIB) $(MAYBE_POLYLIB) $(MAYBE_ISL) $(MAYBE_ISL_POLYLIB) \
32                 $(MAYBE_OMEGA) \
33                 $(MAYBE_ZSOLVE) $(MAYBE_PARKER) . doc
34 DIST_SUBDIRS = $(MAYBE_PIPLIB) $(MAYBE_POLYLIB) $(MAYBE_ISL) \
35                 $(MAYBE_ISL_POLYLIB) $(MAYBE_OMEGA) \
36                 zsolve parker doc
38 FORCE:
39 polylib/libpolylibgmp.la: FORCE
40         cd polylib; $(MAKE) $(AM_MAKEFLAGS) libpolylibgmp.la
41 piplib/libpiplibMP.la: FORCE
42         cd piplib; $(MAKE) $(AM_MAKEFLAGS) libpiplibMP.la
43 isl/libisl.la: FORCE
44         cd isl; $(MAKE) $(AM_MAKEFLAGS) libisl.la
45 isl-polylib/libisl-polylib.la: $(LOCAL_ISL_LA) $(LOCAL_POLYLIB_LA) FORCE
46         cd isl-polylib; $(MAKE) $(AM_MAKEFLAGS) libisl-polylib.la
47 omega/omega_lib/libomega.la: FORCE
48         cd omega/omega_lib; $(MAKE) $(AM_MAKEFLAGS) libomega.la
49 zsolve/libzsolve.la: FORCE
50         cd zsolve; $(MAKE) $(AM_MAKEFLAGS) libzsolve.la
51 parker/libparker.la: FORCE
52         cd parker; $(MAKE) $(AM_MAKEFLAGS) libparker.la
54 AM_CPPFLAGS = @POLYLIB_CPPFLAGS@ @PIPLIB_CPPFLAGS@ \
55               @ISL_CFLAGS@ @ISL_POLYLIB_CFLAGS@ @NTL_CPPFLAGS@
56 AM_LDFLAGS = @POLYLIB_LDFLAGS@ @PIPLIB_LDFLAGS@ @NTL_LDFLAGS@
58 LIB_ISL = $(ISL_LA) @ISL_LIBS@
59 LIB_ISL_POLYLIB = $(ISL_POLYLIB_LA) @ISL_POLYLIB_LIBS@
61 lib_LTLIBRARIES = libbarvinok.la
62 bin_PROGRAMS = barvinok_count barvinok_enumerate barvinok_enumerate_e \
63                   barvinok_ehrhart polytope_scan iscc
64 noinst_PROGRAMS = test testlib randomtest \
65                   remove_redundant_equalities \
66                   barvinok_union polytope_volume test_approx \
67                   barvinok_summate verify_lexsmaller \
68                   polyhedron_sample 4coins lexmin \
69                   @bv_cone_hilbert_basis@ cone_integer_hull \
70                   polytope_lattice_width \
71                   polyhedron_integer_hull vector_partition_chambers \
72                   semigroup_holes evalue_convert \
73                   barvinok_bound test_bound
74 EXTRA_PROGRAMS = cone_hilbert_basis
75 pkginclude_HEADERS = \
76     barvinok/NTL_QQ.h \
77     barvinok/isl.h \
78     barvinok/barvinok.h \
79     barvinok/util.h \
80     barvinok/evalue.h \
81     barvinok/genfun.h \
82     barvinok/options.h \
83     barvinok/polylib.h \
84     barvinok/sample.h \
85     barvinok/basis_reduction.h
86 nodist_pkginclude_HEADERS = \
87     barvinok/NTL.h \
88     barvinok/set.h
89 LINK = $(CXXLINK)
91 if HAVE_CDDLIB
92     BR_CDD = basis_reduction_cdd.cc initcdd.cc
93     POLYSIGN_CDD = polysign_cddf.cc polysign_cdd.cc
94 endif
95 if HAVE_GLPK
96     BR_GLPK = basis_reduction_glpk.c
97     POLYSIGN_GLPK = polysign_glpk.c
98 endif
99 if HAVE_TOPCOM
100     TOPCOM = topcom.c topcom.h
101 endif
102 if USE_ZSOLVE
103     HILBERT_C = hilbert.c
104 endif
105 if HAVE_PIPLIB
106     BR_PIP = basis_reduction_pip.c basis_reduction_pip_dual.c
107     POLYSIGN_PIP = polysign_pip.c
108 endif
109 libbarvinok_la_SOURCES = \
110     barvinok/evalue.h \
111     barvinok/genfun.h \
112     barvinok/util.h \
113     barvinok/barvinok.h \
114     NTL_QQ.cc \
115     basis_reduction.c \
116     evalue.c \
117     genfun.cc \
118     util.c \
119     version.c \
120     bernoulli.c \
121     bernoulli.h \
122     bfcounter.cc \
123     bfcounter.h \
124     binomial.c \
125     binomial.h \
126     conversion.cc \
127     conversion.h \
128     counter.cc \
129     counter.h \
130     decomposer.cc \
131     decomposer.h \
132     dpoly.cc \
133     dpoly.h \
134     euler.cc \
135     euler.h \
136     evalue_isl.c \
137     genfun_constructor.cc \
138     genfun_constructor.h \
139     $(HILBERT_C) \
140     hilbert.h \
141     hull.c \
142     hull.h \
143     ilp.c \
144     ilp.h \
145     isl_param_util.c \
146     isl_param_util.h \
147     lattice_point.cc \
148     lattice_point.h \
149     lattice_width.c \
150     lattice_width.h \
151     laurent.cc \
152     laurent.h \
153     laurent_old.cc \
154     laurent_old.h \
155     normalization.c \
156     normalization.h \
157     options.c \
158     param_polynomial.cc \
159     param_polynomial.h \
160     param_util.c \
161     param_util.h \
162     $(POLYSIGN_CDD) \
163     $(POLYSIGN_GLPK) \
164     $(POLYSIGN_PIP) \
165     polysign.c \
166     polysign_polylib.c \
167     polysign.h \
168     power.h \
169     reduce_domain.c \
170     reduce_domain.h \
171     reducer.cc \
172     reducer.h \
173     remove_equalities.h \
174     remove_equalities.c \
175     sample.c \
176     scale.c \
177     scale.h \
178     scarf.cc \
179     section_array.h \
180     series.cc \
181     $(TOPCOM) \
182     summate.c \
183     summate.h \
184     vertex_cone.cc \
185     vertex_cone.h \
186     volume.c \
187     volume.h \
188     mat_util.cc \
189     mat_util.h \
190     matrix_read.cc \
191     matrix_read.h \
192     barvinok.cc \
193     barvinok_e.cc \
194     $(BR_CDD) \
195     $(BR_GLPK) \
196     $(BR_PIP)
197 EXTRA_libbarvinok_la_SOURCES = \
198     basis_reduction_cdd.cc \
199     basis_reduction_glpk.c \
200     hilbert.c \
201     polysign_cddf.cc \
202     polysign_cdd.cc \
203     polysign.c \
204     initcdd.cc \
205     initcdd.h \
206     topcom.c \
207     topcom.h
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         edomain.cc \
324         edomain.h \
325         evalue_util.cc \
326         evalue_util.h \
327         verify.h \
328         verify.c
329 test_approx_SOURCES = \
330         test_approx.c \
331         verify.h \
332         verify.c
333 test_bound_SOURCES = \
334         test_bound.c \
335         verify.h \
336         verify.c
337 EXTRA_test_bound_SOURCES = fdstream.cc fdstream.h
338 test_bound_LDADD = \
339         libbarvinok.la @ISL_POLYLIB_LIBS@ @ISL_LIBS@ \
340         @POLYLIB_LIBS@ @PIPLIB_LIBS@
341 evalue_convert_SOURCES = \
342         evalue_convert_main.c \
343         evalue_convert_options.c \
344         evalue_convert.cc \
345         evalue_convert.h \
346         evalue_read.c \
347         evalue_read.h \
348         $(FDSTREAM)
349 iscc_SOURCES =  \
350         isl_obj_list.h \
351         isl_obj_list.c \
352         isl_obj_str.h \
353         isl_obj_str.c \
354         iscc.c
355 iscc_CPPFLAGS = @CLOOG_CFLAGS@ $(AM_CPPFLAGS)
356 iscc_LDADD = \
357         libbarvinok.la @CLOOG_LIBS@ @CLOOG_LIBS@ @ISL_POLYLIB_LIBS@ @ISL_LIBS@ \
358         @POLYLIB_LIBS@ @PIPLIB_LIBS@
360 TESTFILES = $(shell find $(top_srcdir)/tests -type f ! -path '*CVS*')
362 EXTRA_DIST = \
363     ChangeLog \
364     $(TESTFILES) \
365     latte2polylib.pl \
366     NTL_5_3_2.patch \
367     basis_reduction_templ.c \
368     cdd94e-test \
369     polysign_cdd_template.cc \
370     barvinok/NTL.h.broken \
371     barvinok/NTL.h.normal \
372     barvinok/set.h.broken \
373     barvinok/set.h.normal \
374     doc/isl.tex \
375     doc/Internal.tex \
376     doc/applications.tex \
377     doc/barvinok.tex \
378     doc/polymake.tex \
379     doc/reports.tex \
380     doc/barvinok.bib \
381     doc/barvinok.gdf \
382     doc/chicago.bst \
383     doc/chicago.sty \
384     doc/mydefs.sty \
385     polymake/Makefile.in \
386     polymake/README \
387     polymake/autogen.sh \
388     polymake/configure.in \
389     polymake/convert.cc \
390     polymake/convert.h \
391     polymake/h_star_vector.cc \
392     polymake/lattice_points.cc
394 ACLOCAL_AMFLAGS = -I m4
396 install-data-local:
397         @test -z "$(pkgconfig_libdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfig_libdir)"
398         $(INSTALL_DATA) $(pkgconfig_libfile) "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
400 uninstall-local:
401         rm -f "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
403 dist-hook:
404         (cd $(distdir)/polymake; \
405             ./autogen.sh; rm -rf autogen.sh autom4te.cache)
406         (cd doc; make barvinok.pdf)
407         cp doc/barvinok.pdf $(distdir)/doc/
408         if test -f $(top_srcdir)/.git/HEAD; then \
409             echo @GIT_HEAD_VERSION@ > $(distdir)/GIT_HEAD_ID; \
410         else \
411             echo $(GIT_HEAD_ID) > $(distdir)/GIT_HEAD_ID; \
412         fi
414 dist-git: dist
415         mv $(distdir).tar.gz @GIT_HEAD_VERSION@.tar.gz
417 BEE_TESTDIRS = ehrhart_e ehrhart_e/scarf ehrhart_e/piplib
419 check: check-testlib check-enumerate check-enumerate_e check-test \
420         check-lexmin check-approx check-pwqp check-euler check-lw
421 check-testlib: testlib$(EXEEXT)
422         ./testlib$(EXEEXT)
423 check-approx: test_approx$(EXEEXT)
424         @for i in $(top_srcdir)/tests/ehrhart/*; do \
425             if test -f $$i; then \
426                 echo $$i | ./test_approx$(EXEEXT) -q -r 10 || exit; \
427             fi \
428         done
429 check-pwqp: barvinok_bound$(EXEEXT) test_bound$(EXEEXT) barvinok_summate$(EXEEXT)
430         @for i in $(top_srcdir)/tests/pwqp/*; do \
431             if test -f $$i; then \
432                 echo $$i; \
433                 ./barvinok_bound$(EXEEXT) -T -r30 < $$i || exit; \
434                 echo $$i | ./test_bound$(EXEEXT) -q -r30 || exit; \
435                 ./barvinok_summate$(EXEEXT) -T -r30 < $$i || exit; \
436             fi \
437         done
438 check-euler: barvinok_summate$(EXEEXT)
439         @for i in $(top_srcdir)/tests/euler/*; do \
440             if test -f $$i; then \
441                 for method in 'euler' 'laurent_old' 'laurent'; do \
442                     opt="--summation=$$method"; \
443                     echo $$i $$opt; \
444                     ./barvinok_summate$(EXEEXT) -T $$opt < $$i || exit; \
445                 done \
446             fi \
447         done
448 if HAVE_TOPCOM
449     TOPCOM_CD = '--chamber-decomposition=topcom'
450 endif
451 ISL_CD = '--chamber-decomposition=isl'
452 check-enumerate: barvinok_enumerate$(EXEEXT)
453         @for i in $(top_srcdir)/tests/ehrhart/*; do \
454             if test -f $$i; then \
455                 echo $$i; \
456                 for options in '' '--series' '--series --primal' $(TOPCOM_CD) $(ISL_CD); do \
457                     for spec in 'random' 'bf' 'df'; do \
458                         opt="--specialization=$$spec $$options"; \
459                         echo "        $$opt"; \
460                         ./barvinok_enumerate$(EXEEXT) --verify $$opt < $$i || exit; \
461                     done \
462                 done; \
463                 opt="--summation=bernoulli"; \
464                 echo "        $$opt"; \
465                 ./barvinok_enumerate$(EXEEXT) --verify $$opt < $$i || exit; \
466             fi \
467         done
468 if HAVE_OMEGA
469     SPEC_OMEGA = '--isl --omega'
470 endif
471 check-enumerate_e: barvinok_enumerate_e$(EXEEXT)
472         @for dir in $(BEE_TESTDIRS); do \
473             for i in $(top_srcdir)/tests/$$dir/*; do \
474                 if test -f $$i; then \
475                     for options in '' $(SPEC_OMEGA) '--isl'; do \
476                         for spec in 'random' 'bf' 'df'; do \
477                             opt="--specialization=$$spec $$options"; \
478                             echo $$i $$opt; \
479                             ./barvinok_enumerate_e$(EXEEXT) --verify $$opt < $$i || exit; \
480                         done \
481                     done \
482                 fi \
483             done \
484         done
485         @for i in $(top_srcdir)/tests/ehrhart_e/scarf/*; do \
486             if test -f $$i; then \
487                 for spec in 'random' 'bf' 'df'; do \
488                     opt="--specialization=$$spec --scarf"; \
489                     echo $$i $$opt; \
490                     ./barvinok_enumerate_e$(EXEEXT) --verify $$opt < $$i || exit; \
491                 done; \
492                 echo $$i --series; \
493                 ./barvinok_enumerate_e$(EXEEXT) --verify --series < $$i || exit; \
494             fi \
495         done
496 check-test: test$(EXEEXT)
497         @failed=0; \
498         for i in $(top_srcdir)/tests/*; do \
499             if test -f $$i; then \
500                 for options in '--index=10' '--primal --index=10'; do \
501                     for spec in 'random' 'bf' 'df' 'todd'; do \
502                         opt="--specialization=$$spec $$options"; \
503                         echo -n $$i $$opt; \
504                         ./test$(EXEEXT) $$opt < $$i; \
505                         if test "$$?" -ne "0"; then \
506                             failed=`expr $$failed + 1`; \
507                             echo " NOT ok"; \
508                         else \
509                             echo " ok"; \
510                         fi; \
511                     done \
512                 done \
513             fi \
514         done; \
515         for i in $(top_srcdir)/tests/sample/*; do \
516             echo -n $$i; \
517             ./test$(EXEEXT) < $$i; \
518             if test "$$?" -ne "0"; then \
519                 failed=`expr $$failed + 1`; \
520                 echo " NOT ok"; \
521             else \
522                 echo " ok"; \
523             fi; \
524         done; \
525         if test $$failed != 0; then \
526                 echo "$$failed tests failed"; \
527                 exit -1; \
528         fi
529 check-lw: test$(EXEEXT)
530         @failed=0; \
531         for i in $(top_srcdir)/tests/lattice_width/*; do \
532             if test -f $$i; then \
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             fi \
542         done; \
543         if test $$failed != 0; then \
544                 echo "$$failed tests failed"; \
545                 exit -1; \
546         fi
547 if HAVE_GLPK
548 check-lexmin: lexmin$(EXEEXT)
549         @for i in $(top_srcdir)/tests/lexmin/*; do \
550             if test -f $$i; then \
551                 for spec in 'random' 'bf' 'df'; do \
552                     opt="--specialization=$$spec"; \
553                     echo $$i $$opt; \
554                     ./lexmin$(EXEEXT) --verify $$opt < $$i || exit; \
555                 done \
556             fi \
557         done
558 else
559 check-lexmin:
560 endif
562 version.h: @GIT_HEAD@
563         echo '#define GIT_HEAD_ID "'@GIT_HEAD_VERSION@'"' > $@