This repository has been archived by the owner on Nov 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.am
315 lines (264 loc) · 12.2 KB
/
Makefile.am
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
## Makefile for the LattE distribution
ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = autogen.sh
## Distribution variables.
PACKAGES=gmp cddlib ntl
##PACKAGES+=cddplus # No longer needed
if ENABLE_LIDIA
PACKAGES+=lidia
endif
if ENABLE_4TI2
PACKAGES+=glpk 4ti2
endif
if ENABLE_LATTE
PACKAGES+=latte
endif
GMP_VERSION=6.1.2
GMP_TARGZ=$(top_srcdir)/gmp-$(GMP_VERSION).tar.bz2
GMP_DIR=gmp-$(GMP_VERSION)
## CDDPLUS_VERSION=077a
## CDDPLUS_TARGZ=$(top_srcdir)/cdd+-$(CDDPLUS_VERSION).tar.gz
## CDDPLUS_DIR=cdd+-$(CDDPLUS_VERSION)
CDDLIB_VERSION=0.94j
CDDLIB_TARGZ=$(top_srcdir)/cddlib-$(CDDLIB_VERSION).tar.gz
CDDLIB_DIR=cddlib-$(CDDLIB_VERSION)
NTL_VERSION=11.3.0
NTL_TARGZ=$(top_srcdir)/ntl-$(NTL_VERSION).tar.gz
NTL_DIR=ntl-$(NTL_VERSION)
LIDIA_VERSION=2.3.0+latte-patches-2014-10-04
LIDIA_TARGZ=$(top_srcdir)/lidia-base-$(LIDIA_VERSION).tar.gz $(top_srcdir)/lidia-FF-$(LIDIA_VERSION).tar.gz $(top_srcdir)/lidia-LA-$(LIDIA_VERSION).tar.gz
LIDIA_DIR=lidia-$(LIDIA_VERSION)
#LATTE_VERSION=$(PACKAGE_VERSION)
LATTE_VERSION=1.7.5
LATTE_TARGZ=$(top_srcdir)/latte-int-$(LATTE_VERSION).tar.gz
if ENABLE_LATTE_FROM_SVN
LATTE_DIR=latte-svn
LATTE_SVN_URL=https://polyhedron.math.ucdavis.edu/usvn/svn/latte/trunk
else
LATTE_DIR=latte-int-$(LATTE_VERSION)
#LATTE_DIR=../latte
endif
# GLPK is a prerequisite of 4ti2
GLPK_VERSION=4.65
GLPK_TARGZ=$(top_srcdir)/glpk-$(GLPK_VERSION).tar.gz
GLPK_DIR=glpk-$(GLPK_VERSION)
FORTYTWO_VERSION=1.6.9
FORTYTWO_TARGZ=$(top_srcdir)/4ti2-$(FORTYTWO_VERSION).tar.gz
FORTYTWO_DIR=4ti2-$(FORTYTWO_VERSION)
INSTALL_DIR=$(prefix)
## Exported variables.
LD_LIBRARY_PATH:=$(INSTALL_DIR)/lib:$(LD_LIBRARY_PATH)
PATH:=$(INSTALL_DIR)/bin:$(PATH)
export INSTALL_DIR
export MAKE
export LD_LIBRARY_PATH
export PATH
export CC
export CFLAGS
export CXX
export CXXFLAGS
export LDFLAGS
## Top-level targets.
all-local: build
build: $(PACKAGES:%=build_%)
clean-local: $(PACKAGES:%=clean_%)
rm -f .built_*
distclean-local: $(PACKAGES:%=distclean_%)
rm -f .configured_* .built_*
rm -rf dest
rm -rf */autom4te.cache
# Disable distcleancheck -- we leave the package build directories around.
distcleancheck:
@:
.PHONY: $(PACKAGES:%=build_%) \
$(PACKAGES:%=clean_%) \
$(PACKAGES:%=distclean_%) \
$(PACKAGES:%=configure_%)
EXTRA_DIST+=$(GMP_TARGZ) $(CDDLIB_TARGZ) $(NTL_TARGZ) \
$(LIDIA_TARGZ) $(LATTE_TARGZ) $(GLPK_TARGZ) $(FORTYTWO_TARGZ)
#EXTRA_DIST+=$(CDDPLUS_TARGZ)
# GMP.
#
# We do not give our CFLAGS and CXXFLAGS to GMP; it is easy to
# miscompile GMP if we force it to use our values of these variables.
build_gmp: $(GMP_DIR)/.built_gmp
configure_gmp: $(GMP_DIR)/config.status
#EXTRA_DIST += gmp-4.2.1-patch
$(GMP_DIR)/.unpacked_gmp: $(GMP_TARGZ)
$(TAR) xf $(GMP_TARGZ) \
&& touch $@
# (cd $(GMP_DIR) && patch -t -p1 ) < $(top_srcdir)/gmp-4.2.1-patch
$(GMP_DIR)/config.status: $(GMP_DIR)/.unpacked_gmp
( cd $(GMP_DIR) && unset CFLAGS CXXFLAGS; ./configure --prefix="$(INSTALL_DIR)" --enable-cxx --disable-shared $(LATTE_SUB_CONFIGURE_ARGS_GMP) $(GMP_CONFIGURE_OPTIONS) )
$(GMP_DIR)/.built_gmp: $(GMP_DIR)/config.status
( cd $(GMP_DIR) && $(MAKE) && $(MAKE) install ) && touch $@
clean_gmp:
-( rm -f $(GMP_DIR)/.built_gmp && cd $(GMP_DIR) && $(MAKE) clean )
distclean_gmp:
-( rm -f $(GMP_DIR)/.built_gmp && cd $(GMP_DIR) && $(MAKE) distclean )
# NTL.
NTL_CONFIG_FILE=$(NTL_DIR)/src/makefile
build_ntl: $(NTL_DIR)/.built_ntl
configure_ntl: $(NTL_CONFIG_FILE)
$(NTL_DIR)/.unpacked_ntl: $(NTL_TARGZ)
gunzip < $(NTL_TARGZ) | $(TAR) xf - \
&& touch $@
### We don't pass $(LATTE_SUB_CONFIGURE_ARGS) to NTL; it does not understand common autoconf options.
### NTL 11.3.0's configure script also does not accept configure option CC=...
### We configure NTL without C++11 for now.
if LATTE_ENABLE_SHARED
NTL_SHARED=on
else
NTL_SHARED=off
endif
$(NTL_CONFIG_FILE): $(NTL_DIR)/.unpacked_ntl $(GMP_DIR)/.built_gmp
( cd $(NTL_DIR)/src && ./configure CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)" AR="$(AR)" LIBTOOL="$(abs_top_builddir)/libtool" RANLIB="$(RANLIB)" PREFIX="$(INSTALL_DIR)" GMP_PREFIX="$(INSTALL_DIR)" NTL_GMP_LIP=on SHARED=$(NTL_SHARED) NTL_STD_CXX11=off NTL_THREADS=off NTL_SAFE_VECTORS=off $(LATTE_SUB_CONFIGURE_ARGS_NTL))
$(NTL_DIR)/.built_ntl: $(NTL_CONFIG_FILE) $(GMP_DIR)/.built_gmp
( cd $(NTL_DIR)/src && $(MAKE) setup1 && $(MAKE) setup2 && $(MAKE) setup3 && $(MAKE) setup4 && $(MAKE) ntl.a && $(MAKE) install ) \
&& touch $@
clean_ntl:
-( rm -f $(NTL_DIR)/.built_ntl && cd $(NTL_DIR)/src && $(MAKE) clean )
distclean_ntl:
-( rm -f $(NTL_DIR)/.built_ntl && cd $(NTL_DIR)/src && $(MAKE) clean; rm -f $(NTL_CONFIG_FILE) )
# LiDIA.
build_lidia: $(LIDIA_DIR)/.built_lidia
configure_lidia: $(LIDIA_DIR)/config.status $(GMP_DIR)/.built_gmp
#EXTRA_DIST += lidia-2.2.0.patch lidia-2.2.0-2.patch
$(LIDIA_DIR)/.unpacked_lidia: $(LIDIA_TARGZ)
for a in $(LIDIA_TARGZ); do \
gunzip < $$a | $(TAR) xf - || exit 1; \
done \
&& touch $@
$(LIDIA_DIR)/config.status: $(LIDIA_DIR)/.unpacked_lidia $(GMP_DIR)/.built_gmp
( cd $(LIDIA_DIR) && ./configure --with-arithmetic=gmp --disable-nf --disable-ec --disable-eco --disable-gec --with-extra-includes="$(INSTALL_DIR)"/include --with-extra-libs="$(INSTALL_DIR)"/lib --prefix="$(INSTALL_DIR)" --disable-shared $(LATTE_SUB_CONFIGURE_ARGS))
# LiDIA 2.2.0 installs its headers into lidia/ but expects them in LiDIA!?!
# So we make a symbolic link, just in case.
$(LIDIA_DIR)/.built_lidia: $(LIDIA_DIR)/config.status $(GMP_DIR)/.built_gmp
( cd $(LIDIA_DIR) && $(MAKE) && $(MAKE) install ) && ( cd "$(INSTALL_DIR)"/include && if [ ! -r LiDIA ] ; then ln -s lidia LiDIA; fi || true ) && touch $@
clean_lidia:
-( rm -f $(LIDIA_DIR)/.built_lidia && cd $(LIDIA_DIR) && $(MAKE) clean )
distclean_lidia:
-( rm -f $(LIDIA_DIR)/.built_lidia && cd $(LIDIA_DIR) && $(MAKE) distclean )
# cddlib.
#
build_cddlib: $(CDDLIB_DIR)/.built_cddlib
configure_cddlib: $(CDDLIB_DIR)/config.status $(GMP_DIR)/.built_gmp
$(CDDLIB_DIR)/.unpacked_cddlib: $(CDDLIB_TARGZ)
for a in $(CDDLIB_TARGZ); do \
gunzip < $$a | $(TAR) xf - || exit 1; \
done \
&& touch $@
## && (cd $(CDDLIB_DIR) && patch -t -p1 ) < $(top_srcdir)/cddlib-shared-library.patch \
## EXTRA_DIST += cddlib-shared-library.patch
$(CDDLIB_DIR)/config.status: $(CDDLIB_DIR)/.unpacked_cddlib $(GMP_DIR)/.built_gmp
( cd $(CDDLIB_DIR) && ./configure --prefix="$(INSTALL_DIR)" --disable-shared $(LATTE_SUB_CONFIGURE_ARGS) CXX="$(CXX)" CFLAGS="$(CFLAGS) -I$(INSTALL_DIR)/include" CXXFLAGS="$(CXXFLAGS) -I$(INSTALL_DIR)/include" LDFLAGS="$(LDFLAGS) -L$(INSTALL_DIR)/lib" )
$(CDDLIB_DIR)/.built_cddlib: $(CDDLIB_DIR)/config.status $(GMP_DIR)/.built_gmp
( cd $(CDDLIB_DIR) && $(MAKE) && $(MAKE) install ) && touch $@
clean_cddlib:
-( rm -f $(CDDLIB_DIR)/.built_cddlib && cd $(CDDLIB_DIR) && $(MAKE) clean )
distclean_cddlib:
-( rm -f $(CDDLIB_DIR)/.built_cddlib && cd $(CDDLIB_DIR) && $(MAKE) distclean )
# cdd+.
## CDDPLUS_VARIABLES=CC="$(CXX)" LIBDIR="$(INSTALL_DIR)"/lib GMPLIBDIR="$(INSTALL_DIR)"/lib INCLUDEDIR="$(INSTALL_DIR)"/include GMPINCLUDEDIR="$(INSTALL_DIR)"/include OPTFLAGS="$(CXXFLAGS)"
## build_cddplus: $(CDDPLUS_DIR)/.built_cddplus
## configure_cddplus: .unpacked_cddplus $(GMP_DIR)/.built_gmp
## EXTRA_DIST += cdd+-077a.patch
## .unpacked_cddplus: $(CDDPLUS_TARGZ)
## for a in $(CDDPLUS_TARGZ); do \
## gunzip < $$a | $(TAR) xf - || exit 1; \
## done \
## && (cd $(CDDPLUS_DIR) && $(PATCH) -p0) < $(top_srcdir)/cdd+-077a.patch \
## && touch $@
## $(CDDPLUS_DIR)/.built_cddplus: .unpacked_cddplus $(GMP_DIR)/.built_gmp
## ( cd $(CDDPLUS_DIR) && $(MAKE) $(CDDPLUS_VARIABLES) cddr+ cddf+ ) && $(mkinstalldirs) "$(INSTALL_DIR)"/bin && $(INSTALL) $(CDDPLUS_DIR)/cddr+ $(CDDPLUS_DIR)/cddf+ "$(INSTALL_DIR)"/bin && touch $@
## clean_cddplus:
## -( rm -f $(CDDPLUS_DIR)/.built_cddplus && cd $(CDDPLUS_DIR) && $(MAKE) clean )
## distclean_cddplus:
## -( rm -f $(CDDPLUS_DIR)/.built_cddplus && cd $(CDDPLUS_DIR) && $(MAKE) clean )
# GLPK.
build_glpk: $(GLPK_DIR)/.built_glpk
configure_glpk: $(GLPK_DIR)/config.status $(GMP_DIR)/.built_gmp
$(GLPK_DIR)/.unpacked_glpk: $(GLPK_TARGZ)
gunzip < $(GLPK_TARGZ) | $(TAR) xf - \
&& touch $@
$(GLPK_DIR)/config.status: $(GLPK_DIR)/.unpacked_glpk $(GMP_DIR)/.built_gmp
( cd $(GLPK_DIR) && ./configure --prefix="$(INSTALL_DIR)" --disable-shared $(GLPK_CONFIGURE_OPTIONS) $(LATTE_SUB_CONFIGURE_ARGS) CC="$(CC)" CXX="$(CXX)" CPPFLAGS="$(CPPFLAGS) -I$(INSTALL_DIR)/include" CFLAGS="$(CFLAGS) -I$(INSTALL_DIR)/include" CXXFLAGS="$(CXXFLAGS) -I$(INSTALL_DIR)/include" LDFLAGS="$(LDFLAGS) -L$(INSTALL_DIR)/lib" )
$(GLPK_DIR)/.built_glpk: $(GLPK_DIR)/config.status
( cd $(GLPK_DIR) && $(MAKE) && $(MAKE) install ) && touch $@
clean_glpk:
-( rm -f $(GLPK_DIR)/.built_glpk && cd $(GLPK_DIR) && $(MAKE) clean )
distclean_glpk:
-( rm -f $(GLPK_DIR)/.built_glpk && cd $(GLPK_DIR) && $(MAKE) distclean )
# 4ti2.
build_4ti2: $(FORTYTWO_DIR)/.built_4ti2
configure_4ti2: $(FORTYTWO_DIR)/config.status $(GLPK_DIR)/.built_glpk $(GMP_DIR)/.built_gmp
$(FORTYTWO_DIR)/.unpacked_4ti2: $(FORTYTWO_TARGZ)
gunzip < $(FORTYTWO_TARGZ) | $(TAR) xf - \
&& touch $@
$(FORTYTWO_DIR)/config.status: $(FORTYTWO_DIR)/.unpacked_4ti2 $(GLPK_DIR)/.built_glpk $(GMP_DIR)/.built_gmp
( cd $(FORTYTWO_DIR) && ./configure --prefix="$(INSTALL_DIR)" --with-gmp="$(INSTALL_DIR)" --with-glpk="$(INSTALL_DIR)" --disable-shared $(FORTYTWO_CONFIGURE_OPTIONS) $(LATTE_SUB_CONFIGURE_ARGS) CC="$(CC)" CXX="$(CXX)" CPPFLAGS="$(CPPFLAGS) -I$(INSTALL_DIR)/include" CFLAGS="$(CFLAGS) -I$(INSTALL_DIR)/include" CXXFLAGS="$(CXXFLAGS) -I$(INSTALL_DIR)/include" LDFLAGS="$(LDFLAGS) -L$(INSTALL_DIR)/lib")
## We currently have header file clashes between zsolve and groebner on Mac OS,
## due to semi-case-insensitivity. Work around for now, by only installing
## the header files of groebner -- we only need those...
## (This is already fixed for the upcoming 4ti2 releases.)
$(FORTYTWO_DIR)/.built_4ti2: $(FORTYTWO_DIR)/config.status
( cd $(FORTYTWO_DIR) && $(MAKE) && $(MAKE) install ) && touch $@
clean_4ti2:
-( rm -f $(FORTYTWO_DIR)/.built_4ti2 && cd $(FORTYTWO_DIR) && $(MAKE) clean )
distclean_4ti2:
-( rm -f $(FORTYTWO_DIR)/.built_4ti2 && cd $(FORTYTWO_DIR) && $(MAKE) distclean )
check-4ti2: $(FORTYTWO_DIR)/.built_4ti2
( cd $(FORTYTWO_DIR) && make check )
# LattE.
if ENABLE_LIDIA
BUILT_LIDIA=$(LIDIA_DIR)/.built_lidia
else
BUILT_LIDIA=
endif
if ENABLE_4TI2
BUILT_4TI2=$(FORTYTWO_DIR)/.built_4ti2
else
BUILT_4TI2=
endif
build_latte: .built_latte
configure_latte: $(LATTE_DIR)/config.status $(GMP_DIR)/.built_gmp $(CDDLIB_DIR)/.built_cddlib $(NTL_DIR)/.built_ntl
##$(CDDPLUS_DIR)/.built_cddplus # no longer needed
if ENABLE_LATTE_FROM_SVN
$(LATTE_DIR)/.unpacked_latte:
svn co $(LATTE_SVN_URL) $(LATTE_DIR) && (cd $(LATTE_DIR) && ./autogen.sh) && touch $@
else
$(LATTE_DIR)/.unpacked_latte: $(LATTE_TARGZ)
for a in $(LATTE_TARGZ); do \
gunzip < $$a | $(TAR) xf - || exit 1; \
done && touch $@
endif
$(LATTE_DIR)/config.status: $(LATTE_DIR)/.unpacked_latte $(GMP_DIR)/.built_gmp $(CDDLIB_DIR)/.built_cddlib $(BUILT_LIDIA) $(NTL_DIR)/.built_ntl $(BUILT_4TI2)
( cd $(LATTE_DIR) && ./configure --with-default="$(INSTALL_DIR)" --prefix="$(INSTALL_DIR)" --enable-relocatable --disable-shared $(LATTE_SUB_CONFIGURE_ARGS))
##$(CDDPLUS_DIR)/.built_cddplus # no longer needed
.built_latte: $(LATTE_DIR)/config.status $(GMP_DIR)/.built_gmp $(CDDLIB_DIR)/.built_cddlib $(BUILT_LIDIA) $(NTL_DIR)/.built_ntl $(BUILT_4TI2)
( cd $(LATTE_DIR) && $(MAKE) && $(MAKE) install ) && touch $@
##$(CDDPLUS_DIR)/.built_cddplus
clean_latte:
-( rm -f .built_latte && cd $(LATTE_DIR) && $(MAKE) clean )
distclean_latte:
-( rm -f .built_latte && cd $(LATTE_DIR) && $(MAKE) distclean )
check-latte:
( cd $(LATTE_DIR) && $(MAKE) check && $(MAKE) installcheck )
## Some checking:
if ENABLE_4TI2
check-local: check-4ti2
endif
if ENABLE_LATTE
check-local: check-latte
endif
## Uninstalling is too hairy, just disable the check for it:
distuninstallcheck:
@:
## Maintainer targets
update-changelog:
(cd $(srcdir) && svn2cl --output=ChangeLog.svn2cl --authors=.svn2cl-authors https://svn-mkoeppe.math.ucdavis.edu/usvn/svn/latte/distro)
# The following targets assume that prefix has not been altered to point to some shared directory.
BINDISTNAME=$(PACKAGE)-$(VERSION)-$(target_triplet)
$(BINDISTNAME).zip: install
(cd ${prefix} && zip -rq $(abs_builddir)/$@ .)
binary-dist: $(BINDISTNAME).zip