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
|
From 4e0185faf3f97f0d027cf74df54d4b08adf1d355 Mon Sep 17 00:00:00 2001
From: Michael Orlitzky <michael@orlitzky.com>
Date: Wed, 15 May 2024 09:51:06 -0400
Subject: [PATCH 1/1] */*: patch build system for Gentoo
- No "external" anything
- Use libtool for libraries
- Unbundle gmp and cddlib
- Use modern cddlib include path
- Detect deps with pkg-config
- Build lib-reg after lib
- Don't hide all symbols with -fvisibility=hidden???
---
Makefile.am | 8 +---
configure.ac | 92 +++++++-------------------------------
lib-src-reg/LPinterface.hh | 4 +-
lib-src-reg/Makefile.am | 7 +--
lib-src/Makefile.am | 5 +--
src-reg/Makefile.am | 19 +-------
src/Makefile.am | 19 +-------
wrap-gmp-gmpxx/Makefile.am | 1 -
8 files changed, 29 insertions(+), 126 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 17f6960..02f80f3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1 @@
-SUBDIRS = wrap-gmp-gmpxx lib-src-reg lib-src src-reg src examples share
-EXTRA_DIST = external/Makefile
-EXTRA_DIST += external/gmp-6.2.1.tar.bz2
-EXTRA_DIST += external/cddlib-0.94j-TOPCOMb.tar.gz
-EXTRA_DIST += external/qsopt_ex-2.5.10.3.tar.gz
-EXTRA_DIST += external/gmpxx-patch
-
+SUBDIRS = wrap-gmp-gmpxx lib-src lib-src-reg src src-reg examples share
diff --git a/configure.ac b/configure.ac
index 2372711..0e6efd7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10,96 +10,36 @@ AC_SUBST([TOPCOMROOT], [`pwd`])
dnl set some compilation switches consistently:
AC_SUBST([AM_CPPFLAGS], ["-DSTL_SYMMETRIES -DSTL_CONTAINERS -DSTL_FLIPS -DSTL_CHIROTOPE -DGMPRATIONAL -DPERMLIB_DOMAIN_INT -DUSE_LEXORDER]")
-AC_SUBST([AM_CXXFLAGS], [" -fvisibility=hidden -fvisibility-inlines-hidden -pthread -std=c++17"])
-AC_SUBST([AM_LDFLAGS], ["-L../external/lib]")
-
-dnl backup the user variable LDFLAGS:
-dnl AC_SUBST([LDFLAGS_backup], [${LDFLAGS}])
-
-dnl add local libraries to LDFLAGS so that AC_CHECK_LIB will find them:
-dnl AC_SUBST([LDFLAGS], ["-L${TOPCOMROOT}/external/lib"])
+AC_SUBST([AM_CXXFLAGS], ["-std=c++17"])
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_CXX
-AC_PROG_RANLIB
+LT_INIT
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
dnl Check for libraries:
-dnl Make libgmp if requested:
-AC_LANG_PUSH(C++)
-AC_CHECK_HEADERS([gmpxx.h])
-AC_LANG_POP
-AM_CONDITIONAL(USE_LOCAL_GMP, [test "x$ac_cv_header_gmpxx_h" = "xno"])
-if test "x$ac_cv_header_gmpxx_h" = "xyes"; then
- AC_MSG_NOTICE([system libgmp is used])
-else
- AC_MSG_NOTICE([gmpxx.h not found on system - building gmp locally ...])
- make -C external gmp
- AC_MSG_NOTICE([... done])
-fi
-
-dnl Make libcddgmp:
-make -C external cdd
-
-dnl Check for requests for third-party packages:
-dnl Check for qsopt_ex:
-AC_MSG_CHECKING(whether QSOpt_ex support was enabled)
-AC_ARG_ENABLE([qsoptex],
- AS_HELP_STRING([--enable-qsoptex],
- [use QSOpt_ex as an LP solver for regularity checks (requires QSOpt_ex includes in ${TOPCOM}/external/include and libqsopt_ex.a in ${TOPCOM}/external/lib (built automatically during configure)])
+PKG_CHECK_MODULES(
+ [GMPXX],
+ [gmpxx],[
+ LIBS="${LIBS} ${GMPXX_LIBS}"
+ CPPFLAGS="${CPPFLAGS} ${GMPXX_CFLAGS}"
+ ],
+ [AC_MSG_ERROR([gmpxx not found])]
)
-AM_CONDITIONAL(USE_QSOPTEX, [test "x$enable_qsoptex" = "xyes"])
-if test "x$enable_qsoptex" = "xyes"; then
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_LIBQSOPTEX)
-
- dnl Check for compression libraries (qsopt_ex uses them if they are present):
- AC_CHECK_LIB([z], [gzopen], [], AC_MSG_NOTICE([compiling without libz]))
- AC_CHECK_LIB([bz2], [BZ2_bzopen], [], AC_MSG_NOTICE([compiling without libbz2]))
-
- dnl Make libqsopt_ex:
- make -C external qso
-else
- AC_MSG_RESULT(no)
-fi
-
-dnl Check for soplex:
-AC_MSG_CHECKING(whether soplex support was enabled)
-AC_ARG_ENABLE([soplex],
- AS_HELP_STRING([--enable-soplex],
- [use soplex as an LP solver for regularity checks (requires soplex includes and boost in ${TOPCOM}/external/include and libsoplex.a in ${TOPCOM}/external/lib)])
+PKG_CHECK_MODULES(
+ [CDDLIB],
+ [cddlib],[
+ LIBS="${LIBS} ${CDDLIB_LIBS}"
+ CPPFLAGS="${CPPFLAGS} ${CDDLIB_CFLAGS}"
+ ],
+ [AC_MSG_ERROR([cddlib not found])]
)
-if test "x$enable_soplex" = "xyes"; then
- AC_MSG_RESULT(yes)
-
- dnl Check for compression library (soplex needs it):
- AC_CHECK_LIB([z], [gzopen], [LIBS="-lsoplex $LIBS"; AC_DEFINE(HAVE_LIBSOPLEX)], AC_MSG_NOTICE([libz missing => soplex not enabled]))
-else
- AC_MSG_RESULT(no)
-fi
-AM_CONDITIONAL(USE_SOPLEX, [test "x$ac_cv_lib_z_gzopen" = "xyes" -a "x$enable_soplex" = "xyes"])
-
-dnl Check for Permlib:
-dnl AC_MSG_CHECKING(whether permlib support was enabled)
-dnl AC_ARG_ENABLE([permlib],
-dnl AS_HELP_STRING([--enable-permlib],
-dnl [support permlib for symmetry checks (requires permlib-includes and boost in ${TOPCOM}/external/include)])
-dnl )
-dnl AM_CONDITIONAL(USE_PERMLIB, [test "x$enable_permlib" = "xyes"])
-dnl if test "x$enable_permlib" = "xyes"; then
-dnl AC_DEFINE(HAVE_LIBPERMLIB)
-dnl AC_MSG_RESULT(yes)
-dnl else
-dnl AC_MSG_RESULT(no)
-dnl fi
-dnl restore the user variable LDLFAGS:
-dnl AC_SUBST([LDFLAGS], [${LDFLAGS_backup}])
AC_CONFIG_FILES([wrap-gmp-gmpxx/Makefile lib-src/Makefile lib-src-reg/Makefile src/Makefile src-reg/Makefile examples/Makefile share/Makefile Makefile])
AC_OUTPUT
diff --git a/lib-src-reg/LPinterface.hh b/lib-src-reg/LPinterface.hh
index 6522dbe..c376887 100644
--- a/lib-src-reg/LPinterface.hh
+++ b/lib-src-reg/LPinterface.hh
@@ -21,8 +21,8 @@
#include "LabelSet.hh"
#include "Rational.h"
-#include "setoper.h"
-#include "cdd.h"
+#include "cddlib/setoper.h"
+#include "cddlib/cdd.h"
namespace topcom {
diff --git a/lib-src-reg/Makefile.am b/lib-src-reg/Makefile.am
index fa8de11..13a0c87 100644
--- a/lib-src-reg/Makefile.am
+++ b/lib-src-reg/Makefile.am
@@ -1,6 +1,6 @@
-lib_LIBRARIES = libCHECKREG.a
+lib_LTLIBRARIES = libCHECKREG.la
-libCHECKREG_a_SOURCES = \
+libCHECKREG_la_SOURCES = \
QSOinterface.cc \
SPXinterface.cc \
LPinterface.cc \
@@ -12,9 +12,10 @@ SPXinterface.hh \
RegularityCheck.hh \
LPinterface.hh
+libCHECKREG_la_LIBADD = ../lib-src/libTOPCOM.la
+
AM_CPPFLAGS += -I../lib-src
AM_CPPFLAGS += -I../wrap-gmp-gmpxx
-AM_CPPFLAGS += -I../external/include
AM_CPPFLAGS += -I$(includedir)
AM_CPPFLAGS += -ftemplate-depth=100
diff --git a/lib-src/Makefile.am b/lib-src/Makefile.am
index c048061..dbaa888 100644
--- a/lib-src/Makefile.am
+++ b/lib-src/Makefile.am
@@ -1,6 +1,6 @@
-lib_LIBRARIES = libTOPCOM.a
+lib_LTLIBRARIES = libTOPCOM.la
-libTOPCOM_a_SOURCES = \
+libTOPCOM_la_SOURCES = \
Admissibles.cc \
CheckTriang.cc \
Circuits.cc \
@@ -134,7 +134,6 @@ Volumes.hh
AM_CPPFLAGS += -I../lib-src-reg
AM_CPPFLAGS += -I../wrap-gmp-gmpxx
-AM_CPPFLAGS += -I../external/include
AM_CPPFLAGS += -I$(includedir)
AM_CPPFLAGS += -ftemplate-depth=100
diff --git a/src-reg/Makefile.am b/src-reg/Makefile.am
index ed4a016..78e9c44 100644
--- a/src-reg/Makefile.am
+++ b/src-reg/Makefile.am
@@ -2,27 +2,12 @@ bin_PROGRAMS = checkregularity
checkregularity_SOURCES = checkregularity.cc
-LDADD = ../lib-src/libTOPCOM.a \
- ../lib-src-reg/libCHECKREG.a \
- ../external/lib/libcddgmp.a
-if USE_QSOPTEX
-LDADD += ../external/lib/libqsopt_ex.a
-endif
-
-if USE_SOPLEX
-LDADD += ../external/lib/libsoplex.a
-endif
-if USE_LOCAL_GMP
-LDADD += ../external/lib/libgmpxx.a \
- ../external/lib/libgmp.a
-else
-LIBS += -lgmpxx -lgmp
-endif
+checkregularity_LDADD = ../lib-src/libTOPCOM.la \
+ ../lib-src-reg/libCHECKREG.la
AM_CPPFLAGS += -I../lib-src
AM_CPPFLAGS += -I../lib-src-reg
AM_CPPFLAGS += -I../wrap-gmp-gmpxx
-AM_CPPFLAGS += -I../external/include
AM_CPPFLAGS += -I$(includedir)
AM_CPPFLAGS += -ftemplate-depth=100
diff --git a/src/Makefile.am b/src/Makefile.am
index c97ecc5..ce723fb 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -121,27 +121,12 @@ santos_triang_SOURCES = santos_triang.cc
santos_dim4_triang_SOURCES = santos_dim4_triang.cc
santos_22_triang_SOURCES = santos_22_triang.cc
-LDADD = ../lib-src/libTOPCOM.a \
- ../lib-src-reg/libCHECKREG.a \
- ../external/lib/libcddgmp.a
-if USE_QSOPTEX
-LDADD += ../external/lib/libqsopt_ex.a
-endif
-if USE_SOPLEX
-LDADD += ../external/lib/libsoplex.a
-endif
-if USE_LOCAL_GMP
-LDADD += ../external/lib/libgmpxx.a \
- ../external/lib/libgmp.a
-else
-LIBS += -lgmpxx -lgmp
-endif
-
+LDADD = ../lib-src/libTOPCOM.la \
+ ../lib-src-reg/libCHECKREG.la
AM_CPPFLAGS += -I../lib-src
AM_CPPFLAGS += -I../lib-src-reg
AM_CPPFLAGS += -I../wrap-gmp-gmpxx
-AM_CPPFLAGS += -I../external/include
AM_CPPFLAGS += -I$(includedir)
AM_CPPFLAGS += -ftemplate-depth=100
diff --git a/wrap-gmp-gmpxx/Makefile.am b/wrap-gmp-gmpxx/Makefile.am
index f85cfc5..41ad248 100644
--- a/wrap-gmp-gmpxx/Makefile.am
+++ b/wrap-gmp-gmpxx/Makefile.am
@@ -2,5 +2,4 @@ include_HEADERS = \
Integer.h \
Rational.h
-AM_CPPFLAGS += -I../external/include
AM_CPPFLAGS += -I$(includedir)
--
2.43.2
|