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