1 | # Copyright (C) 2006, 2007 International Business Machines. |
---|
2 | # All Rights Reserved. |
---|
3 | # This file is distributed under the Common Public License. |
---|
4 | |
---|
5 | ## $Id: configure.ac 836 2007-12-06 02:59:34Z lou $ |
---|
6 | |
---|
7 | # Author: Andreas Waechter IBM 2006-04-13 |
---|
8 | |
---|
9 | ############################################################################# |
---|
10 | # Names and other basic things # |
---|
11 | ############################################################################# |
---|
12 | |
---|
13 | AC_PREREQ(2.59) |
---|
14 | |
---|
15 | AC_INIT([Cbc],[1.2trunk],[coin-cbc@list.coin-or.org]) |
---|
16 | |
---|
17 | AC_COPYRIGHT([ |
---|
18 | Copyright 2006 International Business Machines and others. |
---|
19 | All Rights Reserved. |
---|
20 | This file is part of the open source package Coin which is distributed |
---|
21 | under the Common Public License.]) |
---|
22 | |
---|
23 | # List one file in the package so that the configure script can test |
---|
24 | # whether the package is actually there |
---|
25 | AC_CONFIG_SRCDIR(src/CbcTree.hpp) |
---|
26 | |
---|
27 | # Where should everything be installed by default? Here, we want it |
---|
28 | # to be installed directly in 'bin', 'lib', 'include' subdirectories |
---|
29 | # of the directory where configure is run. The default would be |
---|
30 | # /usr/local. |
---|
31 | AC_PREFIX_DEFAULT([`pwd`]) |
---|
32 | |
---|
33 | ############################################################################# |
---|
34 | # Standard build tool stuff # |
---|
35 | ############################################################################# |
---|
36 | |
---|
37 | # Get the system type |
---|
38 | AC_CANONICAL_BUILD |
---|
39 | |
---|
40 | # If this project depends on external projects, the Externals file in |
---|
41 | # the source root directory contains definition of where to find those |
---|
42 | # externals. The following macro ensures that those externals are |
---|
43 | # retrieved by svn if they are not there yet. |
---|
44 | AC_COIN_PROJECTDIR_INIT |
---|
45 | |
---|
46 | # Check if user wants to produce debugging code |
---|
47 | AC_COIN_DEBUG_COMPILE(Cbc) |
---|
48 | |
---|
49 | # Get the name of the C++ compiler and appropriate compiler options |
---|
50 | AC_COIN_PROG_CXX |
---|
51 | |
---|
52 | # Initialize automake and libtool |
---|
53 | AC_COIN_INIT_AUTO_TOOLS |
---|
54 | |
---|
55 | ############################################################################# |
---|
56 | # COIN components # |
---|
57 | ############################################################################# |
---|
58 | |
---|
59 | AC_COIN_HAS_PROJECT(Cbc) |
---|
60 | AC_COIN_HAS_PROJECT(Cgl) |
---|
61 | AC_COIN_HAS_PROJECT(Clp) |
---|
62 | AC_COIN_HAS_PROJECT(CoinUtils) |
---|
63 | AC_COIN_HAS_PROJECT(DyLP) |
---|
64 | AC_COIN_HAS_PROJECT(Osi) |
---|
65 | AC_COIN_HAS_PROJECT(Vol) |
---|
66 | AC_COIN_HAS_PROJECT(SYMPHONY) |
---|
67 | |
---|
68 | ############################################################################# |
---|
69 | # Third party solvers # |
---|
70 | ############################################################################# |
---|
71 | |
---|
72 | # Check which third party solvers are available ToDo! |
---|
73 | AC_COIN_HAS_USER_LIBRARY([Cplex],[CPX],[cplex.h],[CPXgetstat]) |
---|
74 | AC_COIN_HAS_USER_LIBRARY([FortMP],[FMP]) #ToDo! is Fortran? |
---|
75 | AC_COIN_HAS_USER_LIBRARY([Mosek],[MSK],[mosek.h],[MSK_openmosek]) |
---|
76 | AC_COIN_HAS_USER_LIBRARY([Osl],[OSL],[ekk_c_api.h],[ekk_simplex]) |
---|
77 | AC_COIN_HAS_USER_LIBRARY([Soplex],[SPX],[spxsolver.h]) # ToDo |
---|
78 | AC_COIN_HAS_USER_LIBRARY([Xpress],[XPR],[xprs.h],[XPRSsetintcontrol]) |
---|
79 | |
---|
80 | AC_COIN_HAS_GLPK(Glpk) |
---|
81 | |
---|
82 | ############################################################################# |
---|
83 | # Other third party software # |
---|
84 | ############################################################################# |
---|
85 | |
---|
86 | # Ampl Solver library |
---|
87 | AC_COIN_HAS_ASL |
---|
88 | |
---|
89 | ############################################################################# |
---|
90 | # CbcGeneric configuration # |
---|
91 | ############################################################################# |
---|
92 | |
---|
93 | # Are we building cbc-generic? Default is no (false). |
---|
94 | |
---|
95 | AC_ARG_WITH([cbc-generic], |
---|
96 | AS_HELP_STRING([--with-cbc-generic], |
---|
97 | [specify whether to build cbc-generic (default: no)]), |
---|
98 | [case $withval in |
---|
99 | yes) cbc_with_cbc_generic=true ;; |
---|
100 | *) cbc_with_cbc_generic=false ;; |
---|
101 | esac], |
---|
102 | [cbc_with_cbc_generic=false]) |
---|
103 | if test x"$cbc_with_cbc_generic" = xyes ; then |
---|
104 | AC_MSG_NOTICE([building cbc-generic]) |
---|
105 | fi |
---|
106 | AM_CONDITIONAL(CBC_BUILD_CBC_GENERIC, |
---|
107 | test x"$cbc_with_cbc_generic" = xtrue) |
---|
108 | |
---|
109 | # Set the default solver for cbc-generic. In theory, any OsiXXX should work. |
---|
110 | # In practice, only the three listed below have had any testing. |
---|
111 | |
---|
112 | AC_MSG_CHECKING(for cbc-generic default solver) |
---|
113 | AC_ARG_WITH([cbc-generic-solver], |
---|
114 | AC_HELP_STRING([--with-cbc-generic-solver], |
---|
115 | [specify default solver for cbc-generic in lower |
---|
116 | case letters (if not given, clp is assumed)]), |
---|
117 | [cbc_default_solver=$withval], |
---|
118 | [cbc_default_solver=clp]) |
---|
119 | AC_MSG_RESULT($cbc_default_solver) |
---|
120 | |
---|
121 | case $cbc_default_solver in |
---|
122 | clp) |
---|
123 | ;; |
---|
124 | dylp) |
---|
125 | ;; |
---|
126 | glpk) |
---|
127 | ;; |
---|
128 | *) |
---|
129 | AC_MSG_WARN([Unrecognised solver $cbc_default_solver chosen as cbc-generic default solver.]) |
---|
130 | ;; |
---|
131 | esac |
---|
132 | AC_DEFINE_UNQUOTED([CBC_DEFAULT_SOLVER],"$cbc_default_solver", |
---|
133 | [Define to the name of the default solver to be used in cbc-generic in small letters]) |
---|
134 | |
---|
135 | |
---|
136 | ############################################################################# |
---|
137 | # Cbc parallel configuration # |
---|
138 | ############################################################################# |
---|
139 | |
---|
140 | # First we define a new option, --enable-cbc-parallel |
---|
141 | |
---|
142 | AC_ARG_ENABLE([cbc-parallel], |
---|
143 | [AC_HELP_STRING([--enable-cbc-parallel], |
---|
144 | [enables compilation of the SMP version of Cbc])]) |
---|
145 | |
---|
146 | if test "$enable_cbc_parallel" = yes; then |
---|
147 | # Define the preprocessor macro |
---|
148 | AC_DEFINE([CBC_THREAD],[1],[Define to 1 if the SMP version of Cbc should be compiled]) |
---|
149 | AC_CHECK_LIB([rt],[clock_gettime], |
---|
150 | [ADDLIBS="-lrt $ADDLIBS"], |
---|
151 | [AC_MSG_ERROR([--enable-cbc-parallel selected, but -lrt unavailable])]) |
---|
152 | AC_CHECK_LIB([pthread],[pthread_create], |
---|
153 | [ADDLIBS="-lpthread $ADDLIBS"], |
---|
154 | [AC_MSG_ERROR([--enable-cbc-parallel selected, but -lpthreads unavailable])]) |
---|
155 | fi |
---|
156 | |
---|
157 | ############################################################################## |
---|
158 | # VPATH links for example input files # |
---|
159 | ############################################################################## |
---|
160 | |
---|
161 | # In case this is a VPATH configuration we need to make sure that the |
---|
162 | # input files for the examples are available in the VPATH directory. |
---|
163 | |
---|
164 | AC_COIN_VPATH_LINK(examples/sudoku_sample.csv) |
---|
165 | AC_COIN_VPATH_LINK(examples/quad.mps) |
---|
166 | AC_COIN_VPATH_LINK(examples/quad2.mps) |
---|
167 | |
---|
168 | ############################################################################## |
---|
169 | # Finishing up by writing all the output # |
---|
170 | ############################################################################## |
---|
171 | |
---|
172 | # Here list all the files that configure should create (except for the |
---|
173 | # configuration header file) |
---|
174 | AC_CONFIG_FILES([Makefile |
---|
175 | examples/Makefile |
---|
176 | src/Makefile |
---|
177 | test/Makefile |
---|
178 | cbc_addlibs.txt]) |
---|
179 | |
---|
180 | # Here put the location and name of the configuration header file |
---|
181 | AC_CONFIG_HEADER([inc/config_cbc.h]) |
---|
182 | |
---|
183 | # Finally, we let configure write all the output... |
---|
184 | AC_COIN_FINALIZE |
---|