fixed a memory leek in polyhedron.c
[polylib.git] / cln / Makefile.am
blobbbc3503ff25bdb0c60f70a565d28285274ce3f11
1 SUBDIRS = polylib
3 AM_CPPFLAGS = -I$(srcdir)/../include -I. -DCLN
5 poly_src = $(srcdir)/../applications
7 lib_LTLIBRARIES = libpolylibcln.la
8 LDADD = libpolylibcln.la
10 noinst_PROGRAMS = \
11         testlib \
12         example \
13         count \
14         Zpolytest \
15         polytest \
16         verif_ehrhart
18 bin_PROGRAMS = \
19         c2pcln \
20         r2pcln \
21         findvcln \
22         disjoint_union_sepcln \
23         disjoint_union_adjcln \
24         ehrhart_quick_apxcln \
25         ehrhart_upper_boundcln \
26         ehrhart_lower_boundcln \
27         ehrhart_rankingcln \
28         ehrhart_unioncln \
29         ppcln \
30         testehrhartcln
32 CFILES= \
33         ../source/arith/errors.c \
34         ../source/kernel/errormsg.c \
35         ../source/kernel/vector.c \
36         ../source/kernel/matrix.c \
37         ../source/kernel/polyhedron.c \
38         ../source/kernel/polyparam.c \
39         ../source/kernel/param.c \
40         ../source/kernel/alpha.c \
41         ../source/ehrhart/ehrhart.c \
42         ../source/ehrhart/ext_ehrhart.c \
43         ../source/ehrhart/eval_ehrhart.c \
44         ../source/ehrhart/homogenization.c \
45         ../source/ehrhart/ranking.c \
46         ../source/kernel/matrix_addon.c \
47         ../source/kernel/matrix_permutations.c \
48         ../source/kernel/compress_parms.c \
49         ../source/kernel/SolveDio.c \
50         ../source/kernel/Lattice.c \
51         ../source/kernel/Matop.c \
52         ../source/kernel/NormalForms.c \
53         ../source/kernel/Zpolyhedron.c          
55 libpolylibcln_la_SOURCES = $(CFILES)
56 # trick to force use of c++ linker
57 nodist_EXTRA_libpolylibcln_la_SOURCES = dummy.cxx
59 testlib_SOURCES = $(poly_src)/testlib.c
60 example_SOURCES = $(poly_src)/example.c
61 count_SOURCES = $(srcdir)/../source/count.c
62 Zpolytest_SOURCES = $(poly_src)/Zpolytest.c
63 ehrhart_rankingcln_SOURCES = $(poly_src)/ehrhart_ranking.c
64 ehrhart_unioncln_SOURCES = $(poly_src)/ehrhart_union.c
65 polytest_SOURCES = $(poly_src)/polytest.c
66 ppcln_SOURCES = $(poly_src)/pp.c
67 testehrhartcln_SOURCES = $(poly_src)/testehrhart.c
68 verif_ehrhart_SOURCES = $(poly_src)/verif_ehrhart.c
70 c2pcln_SOURCES = $(poly_src)/c2p.c
71 r2pcln_SOURCES = $(poly_src)/r2p.c
72 findvcln_SOURCES = $(poly_src)/findv.c
73 disjoint_union_sepcln_SOURCES = $(poly_src)/disjoint_union_sep.c
74 disjoint_union_adjcln_SOURCES = $(poly_src)/disjoint_union_adj.c
75 ehrhart_quick_apxcln_SOURCES = $(poly_src)/ehrhart_quick_apx.c
76 ehrhart_upper_boundcln_SOURCES =  $(poly_src)/ehrhart_upper_bound.c
77 ehrhart_lower_boundcln_SOURCES =  $(poly_src)/ehrhart_lower_bound.c
79 # hack to compile c source files using c++ compiler
80 CC=$(CXX)
82 ACLOCAL_AMFLAGS = -I m4
84 ZPOLYTESTS =  \
85         LatHNF1.in \
86         LatHNF2.in \
87         LatHNF3.in \
88         LatInter1.in \
89         LatInter2.in \
90         LatInc1.in \
91         LatInc2.in \
92         ZEmpty1.in \
93         ZEmpty2.in \
94         ZInter1.in \
95         ZInter2.in  \
96         ZInter3.in  \
97         ZUnion1.in \
98         ZUnion2.in \
99         ZDiff1.in \
100         ZDiff2.in \
101         ZImage1.in \
102         ZPre1.in \
103         ZPre2.in  \
104         ZPre3.in \
105         ZImPre1.in \
106         SplitZpol1.in \
107         SplitZpol2.in \
108         SplitZpol3.in
110 EHRHART =  \
111         0D.in \
112         0D2.in \
113         8hedron.in \
114         alex11.in \
115         alex1.in \
116         bart6.in \
117         bart8.in \
118         c3.in\
119         c4.in\
120         e0.in\
121         e10.in\
122         e11.in\
123         e12.in\
124         e13.in\
125         e14.in\
126         e15.in\
127         e16.in\
128         e1.in\
129         e2b.in\
130         e2.in\
131         e3.in\
132         e4.in\
133         e5.in\
134         e6.in\
135         e7.in\
136         e8.in\
137         e9.in\
138         esum.in \
139         g12.in\
140         g13.in\
141         g14.in\
142         g1.in\
143         g2.in\
144         g4.in\
145         g5.in\
146         isnm2.in\
147         t1.in\
148         t2.in\
149         t31.in\
150         t3.in\
151         t4.in\
152         t12.in\
153         tpar.in
155 EHRHART_UNION =  \
156         ue1.in \
157         ue2.in
159 RANKING =  \
160         asci03-core.in
162 GENERAL =  \
163         convex1.in \
164         convex2.in \
165         gauss1.in \
166         herve.in \
167         simpl1.in \
168         simpl2.in \
169         simpl3.in \
170         simpl4.in \
171         simpl5.in \
172         simpl6.in \
173         simpl7.in \
174         test1.in
176 PP =  \
177         c6.in \
178         c7.in
180 check:
181         @failedtest=0; \
182         for x in $(ZPOLYTESTS) ; do \
183                 echo "Verify file $$x" ; \
184                 ./Zpolytest$(TEST_BITS) < $(srcdir)/../Test/Zpolytest/$$x > xyz;\
185                 diff -w xyz $(srcdir)/../Test/Zpolytest/`basename $$x .in`.out ; \
186                 result=$$?; \
187                 if [ "$$result" -eq "1" ]; then \
188                         echo "Error: $$x is not the same"; \
189                         failedtest=`expr $$failedtest + 1`; \
190                 else \
191                         echo "$$x passed"; \
192                 fi; \
193         done ; \
194         if [ $$failedtest != 0 ]; then \
195                 echo "$$failedtest tests failed"; \
196         else \
197                 echo "Test Zpolytest works correctly"; \
198         fi
199         @failedtest=0; \
200         for x in $(EHRHART) ; do \
201                 echo "Verify file $$x" ; \
202                 ./testehrhartcln < $(srcdir)/../Test/ehrhart/$$x >xyz; \
203                 diff -w xyz $(srcdir)/../Test/ehrhart/`basename $$x .in`.out ; \
204                 result=$$?; \
205                 if [ "$$result" -eq "1" ]; then \
206                         echo "Error: $$x is not the same"; \
207                         failedtest=`expr $$failedtest + 1`; \
208                 else \
209                         echo "$$x passed"; \
210                 fi; \
211         done ; \
212         if [ $$failedtest != 0 ]; then \
213                 echo "$$failedtest tests failed"; \
214         else \
215                 echo "Test ehrhart works correctly"; \
216         fi
217         @failedtest=0; \
218         for x in $(EHRHART_UNION) ; do \
219                 echo "Verify file $$x" ; \
220                 ./ehrhart_unioncln < $(srcdir)/../Test/ehrhart_union/$$x > xyz;\
221                 diff -w xyz $(srcdir)/../Test/ehrhart_union/`basename $$x .in`.out ; \
222                 result=$$?; \
223                 if [ "$$result" -eq "1" ]; then \
224                         echo "Error: $$x is not the same"; \
225                         failedtest=`expr $$failedtest + 1`; \
226                 else \
227                         echo "$$x passed"; \
228                 fi; \
229         done ; \
230         if [ $$failedtest != 0 ]; then \
231                 echo "$$failedtest tests failed"; \
232         else \
233                 echo "Test ehrhart_union works correctly"; \
234         fi
235         @failedtest=0; \
236         for x in $(RANKING) ; do \
237                 echo "Verify file $$x" ; \
238                 ./ehrhart_rankingcln < $(srcdir)/../Test/ranking/$$x >xyz; \
239                 diff -w xyz $(srcdir)/../Test/ranking/`basename $$x .in`.out ; \
240                 result=$$?; \
241                 if [ "$$result" -eq "1" ]; then \
242                         echo "Error: $$x is not the same"; \
243                         failedtest=`expr $$failedtest + 1`; \
244                 else \
245                         echo "$$x passed"; \
246                 fi; \
247         done ; \
248         if [ $$failedtest != 0 ]; then \
249                 echo "$$failedtest tests failed"; \
250         else \
251                 echo "Test ehrhart_ranking works correctly"; \
252         fi
253         @failedtest=0; \
254         for x in $(GENERAL) ; do \
255                 echo "Verify file $$x"; \
256                 ./polytest < $(srcdir)/../Test/general/$$x > xyz;\
257                 diff -w xyz $(srcdir)/../Test/general/`basename $$x .in`.out ; \
258                 result=$$?; \
259                 if [ "$$result" -eq "1" ]; then \
260                         echo "Error: $$x is not the same"; \
261                         failedtest=`expr $$failedtest + 1`; \
262                 else \
263                         echo "$$x passed"; \
264                 fi; \
265         done ; \
266         if [ $$failedtest != 0 ]; then \
267                 echo "$$failedtest tests failed"; \
268         else \
269                 echo "Test polytest works correctly"; \
270         fi
271         @failedtest=0; \
272         for x in $(PP) ; do \
273                 echo "Verify file $$x"; \
274                 ./ppcln < $(srcdir)/../Test/pp/$$x > xyz;\
275                 diff -w xyz $(srcdir)/../Test/pp/`basename $$x .in`.out ; \
276                 result=$$?; \
277                 if [ "$$result" -eq "1" ]; then \
278                         echo "Error: $$x is not the same"; \
279                         failedtest=`expr $$failedtest + 1`; \
280                 else \
281                         echo "$$x passed"; \
282                 fi; \
283         done ; \
284         if [ $$failedtest != 0 ]; then \
285                 echo "$$failedtest tests failed"; \
286         else \
287                 echo "Test pp works correctly"; \
288         fi
290 longtest:
291         @for x in $(EHRHART) ; do \
292                 echo "Verify Ehrhart for $$x"; \
293                 ./verif_ehrhart < $(srcdir)/../Test/ehrhart/$$x ;\
294         done ;