-
Notifications
You must be signed in to change notification settings - Fork 41
/
configure.ac
245 lines (199 loc) · 9.08 KB
/
configure.ac
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
# Copyright (C) 2006 International Business Machines.
# All Rights Reserved.
# This file is distributed under the Eclipse Public License.
#
# Author: Andreas Waechter IBM 2006-04-13
#############################################################################
# Names and other basic things #
#############################################################################
AC_INIT([Osi],[devel],[https://github.com/coin-or/Osi/issues/new],[coin-or-osi],[https://github.com/coin-or/Osi])
AC_COPYRIGHT([
Copyright 2006 International Business Machines and others.
All Rights Reserved.
This file is part of the open source package Osi which is distributed
under the Eclipse Public License.])
# List one file in the package so that the configure script can test whether
# the package is actually there.
AC_CONFIG_SRCDIR(src/Osi/OsiSolverInterface.cpp)
# Do some initialization work (version numbers, change prefix default, ...)
AC_COIN_INITIALIZE
#############################################################################
# Standard build tool stuff #
#############################################################################
# Get the name of the C++ compiler and appropriate compiler options.
AC_COIN_PROG_CXX
# This is a C++ package, set the language accordingly.
AC_LANG_PUSH(C++)
# Initialize libtool.
AC_COIN_PROG_LIBTOOL
# set RPATH_FLAGS to the compiler link flags required to hardcode location
# of the shared objects (expanded_libdir is set somewhere in configure before)
# (use in examples Makefile)
AC_COIN_RPATH_FLAGS([$expanded_libdir])
#############################################################################
# Math headers #
#############################################################################
# Check for cmath/math.h, cfloat/float.h, cieeefp/ieeefp.h
AC_COIN_CHECK_MATH_HDRS
#############################################################################
# COIN-OR components #
#############################################################################
# Find components for OsiLib
AC_COIN_CHK_PKG(CoinUtils,[OsiLib OsiTest])
if test "$coin_has_coinutils" != yes ; then
AC_MSG_ERROR([Required package CoinUtils not available.])
fi
# Finalize libs and cflags for building OsiLib.
AC_COIN_FINALIZE_FLAGS(OsiLib)
# We just need the COIN_HAS_XXX and XXX_DATA variables for the data projects.
AC_COIN_CHK_PKG(Sample,,[coindatasample],[],dataonly)
AC_COIN_CHK_PKG(Netlib,,[coindatanetlib],[],dataonly)
# Finalise lflags and cflags, then tack on information from OsiLib, which is
# not yet installed.
AC_COIN_FINALIZE_FLAGS(OsiCommonTestLib)
AC_COIN_CHK_HERE([OsiLib],[OsiCommonTestLib],[osi])
#############################################################################
# Third party solvers #
#############################################################################
# These are third-party solvers with source distributions that can be
# downloaded and built. The general flow here is as above: Initialise the
# library, add external components, finalize the flags, and add any components
# being built here.
AC_COIN_CHK_PKG(Glpk,[OsiGlpkLib OsiTest],[coinglpk])
AC_LANG_PUSH(C++)
AC_COIN_CHK_LIBHDR(SoPlex,[OsiSpxLib OsiTest],[-lsoplex],[],[],
[new soplex::DIdxSet()],
[#include "soplex.h"
#if SOPLEX_VERSION >= 400
#error "OsiSpx requires SoPlex < 4.0"
#endif
])
AC_LANG_POP(C++)
AC_COIN_CHK_LIBHDR(Cplex,[OsiCpxLib OsiTest],[-lcplex -lpthread -lm -ldl],[],[],
[int err;
#if CPX_VERSION >= 800
CPXopenCPLEX(&err);
#else
CPXopenCPLEXdevelop(&err);
#endif],
[#include "cplex.h"])
AC_COIN_CHK_LIBHDR(Mosek,[OsiMskLib OsiTest],[-lmosek64 -lpthread],[],[],
[MSKenv_t env_;
#if MSK_VERSION_MAJOR >= 7
MSK_makeenv(&env_,NULL);
#else
MSK_makeenv(&env_,NULL,NULL,NULL,NULL);
#endif],
[#include "mosek.h"
#include <stdlib.h>])
AC_COIN_CHK_LIBHDR(Xpress,[OsiXprLib OsiTest],[-lxprs -lxprl],[],[],
[XPRSinit(NULL)],
[#include "xprs.h"
#include <stdlib.h>])
AC_COIN_CHK_LIBHDR(Gurobi,[OsiGrbLib OsiTest],[-lgurobi -lpthread -lm],[],[],
[GRBenv* env_;
GRBloadenv(&env_, NULL)],
[#include "gurobi_c.h"
#include <stdlib.h>])
AC_COIN_FINALIZE_FLAGS([OsiGlpkLib OsiSpxLib OsiCpxLib OsiMskLib OsiXprLib OsiGrbLib OsiTest])
AC_COIN_CHK_HERE([OsiLib],[OsiGlpkLib OsiSpxLib OsiCpxLib OsiMskLib OsiXprLib OsiGrbLib],[osi])
#############################################################################
# Examples solver #
#############################################################################
# Choose a solver interface that can be used in the examples
if test "$coin_has_glpk" = yes ; then
OSI_EXAMPLES_SOLVER_NAME=OsiGlpkSolverInterface
OSI_EXAMPLES_SOLVER_CFLAGS="$OSIGLPKLIB_CFLAGS"
OSI_EXAMPLES_SOLVER_LFLAGS="$OSIGLPKLIB_LFLAGS"
OSI_EXAMPLES_SOLVER_PCNAME=osi-glpk
elif test "$coin_has_cplex" = yes ; then
OSI_EXAMPLES_SOLVER_NAME=OsiCpxSolverInterface
OSI_EXAMPLES_SOLVER_CFLAGS="$OSICPXLIB_CFLAGS"
OSI_EXAMPLES_SOLVER_LFLAGS="$OSICPXLIB_LFLAGS"
OSI_EXAMPLES_SOLVER_PCNAME=osi-cplex
elif test "$coin_has_gurobi" = yes ; then
OSI_EXAMPLES_SOLVER_NAME=OsiGrbSolverInterface
OSI_EXAMPLES_SOLVER_CFLAGS="$OSIGRBLIB_CFLAGS"
OSI_EXAMPLES_SOLVER_LFLAGS="$OSIGRBLIB_LFLAGS"
OSI_EXAMPLES_SOLVER_PCNAME=osi-gurobi
elif test "$coin_has_mosek" = yes ; then
OSI_EXAMPLES_SOLVER_NAME=OsiMskSolverInterface
OSI_EXAMPLES_SOLVER_CFLAGS="$OSIMSKLIB_CFLAGS"
OSI_EXAMPLES_SOLVER_LFLAGS="$OSIMSKLIB_LFLAGS"
OSI_EXAMPLES_SOLVER_PCNAME=osi-mosek
elif test "$coin_has_xpress" = yes ; then
OSI_EXAMPLES_SOLVER_NAME=OsiXprSolverInterface
OSI_EXAMPLES_SOLVER_CFLAGS="$OSIXPRLIB_CFLAGS"
OSI_EXAMPLES_SOLVER_LFLAGS="$OSIXPRLIB_LFLAGS"
OSI_EXAMPLES_SOLVER_PCNAME=osi-xpress
elif test "$coin_has_soplex" = yes ; then
OSI_EXAMPLES_SOLVER_NAME=OsiSpxSolverInterface
OSI_EXAMPLES_SOLVER_CFLAGS="$OSISPXLIB_CFLAGS"
OSI_EXAMPLES_SOLVER_LFLAGS="$OSISPXLIB_LFLAGS"
OSI_EXAMPLES_SOLVER_PCNAME=osi-soplex
else
AC_MSG_WARN([No solver available, examples will not work.])
fi
AC_SUBST(OSI_EXAMPLES_SOLVER_NAME)
AC_SUBST(OSI_EXAMPLES_SOLVER_CFLAGS)
AC_SUBST(OSI_EXAMPLES_SOLVER_LFLAGS)
AC_SUBST(OSI_EXAMPLES_SOLVER_PCNAME)
#############################################################################
# Configuration options for individual OSIs #
#############################################################################
# If any of the tests performed in this section actually require the presence
# of the solver (file presence, link checks, etc.) be sure to guard the call.
# We assume that GLPK is not too old
AC_DEFINE(GLPK_HAS_INTOPT, [1],
[Define to 1 if GLPK has the advanced B&B solver lpx_intopt])
#############################################################################
# Check for doxygen #
#############################################################################
AC_COIN_DOXYGEN([CoinUtils])
##############################################################################
# Finishing up by writing all the output #
##############################################################################
# Here list all the files that configure should create (except for the
# configuration header file)
AC_CONFIG_FILES([Makefile
examples/Makefile
src/Osi/Makefile
src/OsiCpx/Makefile
src/OsiGlpk/Makefile
src/OsiMsk/Makefile
src/OsiXpr/Makefile
src/OsiGrb/Makefile
src/OsiSpx/Makefile
src/OsiCommonTest/Makefile
test/Makefile
osi.pc
osi-unittests.pc])
# Here put the location and name of the configuration header file
AC_CONFIG_HEADERS([src/Osi/config.h src/Osi/config_osi.h src/OsiCommonTest/config_osicommontest.h])
if test "$coin_has_cplex" = true ; then
AC_CONFIG_FILES([osi-cplex.pc:src/OsiCpx/osi-cplex.pc.in])
AC_CONFIG_HEADERS([src/OsiCpx/config_osicpx.h])
fi
if test "$coin_has_glpk" = yes ; then
AC_CONFIG_FILES([osi-glpk.pc:src/OsiGlpk/osi-glpk.pc.in])
AC_CONFIG_HEADERS([src/OsiGlpk/config_osiglpk.h])
fi
if test "$coin_has_gurobi" = yes ; then
AC_CONFIG_FILES([osi-gurobi.pc:src/OsiGrb/osi-gurobi.pc.in])
AC_CONFIG_HEADERS([src/OsiGrb/config_osigrb.h])
fi
if test "$coin_has_mosek" = yes ; then
AC_CONFIG_FILES([osi-mosek.pc:src/OsiMsk/osi-mosek.pc.in])
AC_CONFIG_HEADERS([src/OsiMsk/config_osimsk.h])
fi
if test "$coin_has_xpress" = yes ; then
AC_CONFIG_FILES([osi-xpress.pc:src/OsiXpr/osi-xpress.pc.in])
AC_CONFIG_HEADERS([src/OsiXpr/config_osixpr.h])
fi
if test "$coin_has_soplex" = yes ; then
AC_CONFIG_FILES([osi-soplex.pc:src/OsiSpx/osi-soplex.pc.in])
AC_CONFIG_HEADERS([src/OsiSpx/config_osispx.h])
fi
AC_CONFIG_FILES([doxydoc/doxygen.conf])
# Finally, we let configure write all the output...
AC_COIN_FINALIZE