source: branches/split/Cbc/configure.ac @ 1438

Last change on this file since 1438 was 1438, checked in by stefan, 10 years ago

add no pkg-config fallback (not tested)

  • Property svn:keywords set to Author Date Id Revision
File size: 10.0 KB
Line 
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 1438 2010-03-14 15:20:53Z stefan $
6
7# Author:  Andreas Waechter            IBM    2006-04-13
8
9#############################################################################
10#                       Names and other basic things                        #
11#############################################################################
12
13AC_PREREQ(2.59)
14
15AC_INIT([Cbc],[split],[cbc@list.coin-or.org])
16
17AC_COPYRIGHT([
18Copyright 2006 International Business Machines and others.
19All Rights Reserved.
20This file is part of the open source package Coin which is distributed
21under 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
25AC_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.
31AC_PREFIX_DEFAULT([`pwd`])
32
33#############################################################################
34#                         Standard build tool stuff                         #
35#############################################################################
36
37# Get the system type
38AC_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.
44AC_COIN_PROJECTDIR_INIT
45
46# Check if user wants to produce debugging code
47AC_COIN_DEBUG_COMPILE(Cbc)
48
49# Get the name of the C++ compiler and appropriate compiler options
50AC_COIN_PROG_CXX
51
52# Initialize automake and libtool
53AC_COIN_INIT_AUTO_TOOLS
54
55#############################################################################
56#                              COIN components                              #
57#############################################################################
58
59AC_COIN_HAS_MODULE(CoinDepend, [coinutils = split osi cgl])
60AC_COIN_HAS_MODULE(Clp,        [osi-clp])
61AC_COIN_HAS_MODULE(DyLP,       [osi-dylp])
62AC_COIN_HAS_MODULE(Vol,        [osi-vol])
63AC_COIN_HAS_MODULE(OsiTests,   [osi-unittests],   [required=0])
64AC_COIN_HAS_MODULE(Sample,     [coindatasample],  [required=0])
65AC_COIN_HAS_MODULE(Netlib,     [coindatanetlib],  [required=0])
66AC_COIN_HAS_MODULE(Miplib3,    [coindatamiplib3], [required=0])
67
68# fallbacks for CoinDepend and Clp if no pkg-config is available
69if test "$coin_has_coindepend" != yes ; then
70  AC_COIN_HAS_PROJECT(CoinUtils)
71  AC_COIN_HAS_PROJECT(Osi)
72  AC_COIN_HAS_PROJECT(Cgl)
73  if test $coin_has_coinutils != notGiven && test $coin_has_coinutils != skipping ; then
74    COINDEPEND_CFLAGS="-I`${CYGPATH_W} ${COINUTILSSRCDIR}/src` -I`${CYGPATH_W} ${COINUTILSOBJDIR}/inc`"
75    COINDEPEND_LIBS="${COINUTILSOBJDIR}/src/libCoinUtils.la `cat ${COINUTILSOBJDIR}/coinutils_addlibs.txt`"
76  else
77    AC_MSG_ERROR("Required package CoinUtils unavailable.")
78  fi
79  if test $coin_has_osi != notGiven && test $coin_has_osi != skipping ; then
80    COINDEPEND_CFLAGS="${COINDEPEND_CFLAGS} -I`${CYGPATH_W} ${OSISRCDIR}/src` -I`${CYGPATH_W} ${OSIOBJDIR}/inc`"
81    COINDEPEND_LIBS="${COINDEPEND_LIBS} ${OSIOBJDIR}/src/libOsi.la `cat ${OSIOBJDIR}/osi_addlibs.txt`"
82  else
83    AC_MSG_ERROR("Required package Osi unavailable.")
84  fi
85  if test $coin_has_cgl != notGiven && test $coin_has_cgl != skipping ; then
86    COINDEPEND_CFLAGS="${COINDEPEND_CFLAGS} -I`${CYGPATH_W} ${CGLSRCDIR}/src` -I`${CYGPATH_W} ${CGLOBJDIR}/inc` -I`${CYGPATH_W} ${CGLSRCDIR}/src/CglAllDifferent` -I`${CYGPATH_W} ${CGLSRCDIR}/src/CglClique` -I`${CYGPATH_W} ${CGLSRCDIR}/src/CglDuplicateRow` -I`${CYGPATH_W} ${CGLSRCDIR}/src/CglFlowCover` -I`${CYGPATH_W} ${CGLSRCDIR}/src/CglGomory` -I`${CYGPATH_W} ${CGLSRCDIR}/src/CglKnapsackCover` -I`${CYGPATH_W} ${CGLSRCDIR}/src/CglLandP` -I`${CYGPATH_W} ${CGLSRCDIR}/src/CglLiftAndProject` -I`${CYGPATH_W} ${CGLSRCDIR}/src/CglMixedIntegerRounding` -I`${CYGPATH_W} ${CGLSRCDIR}/src/CglMixedIntegerRounding2` -I`${CYGPATH_W} ${CGLSRCDIR}/src/CglOddHole` -I`${CYGPATH_W} ${CGLSRCDIR}/src/CglPreProcess` -I`${CYGPATH_W} ${CGLSRCDIR}/src/CglProbing` -I`${CYGPATH_W} ${CGLSRCDIR}/src/CglRedSplit` -I`${CYGPATH_W} ${CGLSRCDIR}/src/CglResidualCapacity` -I`${CYGPATH_W} ${CGLSRCDIR}/src/CglSimpleRounding` -I`${CYGPATH_W} ${CGLSRCDIR}/src/CglTwomir`"
87    COINDEPEND_LIBS="${COINDEPEND_LIBS} ${CGLOBJDIR}/src/libCgl.la `cat ${CGLOBJDIR}/cgl_addlibs.txt`"
88  else
89    AC_MSG_ERROR("Required package Cgl unavailable.")
90  fi
91  coin_has_coindepend=yes
92  AC_DEFINE(COIN_HAS_COINDEPEND,[1],[Define to 1 if the CoinDepend module is available])
93else
94  # to please configure
95  AM_CONDITIONAL(COIN_HAS_COINUTILS, [test 0 = 1])
96  AM_CONDITIONAL(COIN_HAS_OSI,       [test 0 = 1])
97  AM_CONDITIONAL(COIN_HAS_CGL,       [test 0 = 1])
98fi
99
100if test "$coin_has_clp" != yes ; then
101  AC_COIN_HAS_PROJECT(Clp)
102  if test $coin_has_clp != notGiven && test $coin_has_clp != skipping ; then
103    CLP_CFLAGS="-I`${CYGPATH_W} ${CLPSRCDIR}/src` -I`${CYGPATH_W} ${CLPSRCDIR}/src/OsiClp` -I`${CYGPATH_W} ${CLPOBJDIR}/inc`"
104    CLP_LIBS="${CLPOBJDIR}/src/libClp.la ${CLPOBJDIR}/src/OsiClp/libOsiClp.la `cat ${CLPOBJDIR}/clp_addlibs.txt`"
105    AC_DEFINE(COIN_HAS_CLP,[1],[Define to 1 if the Clp module is available])
106  else
107    AC_MSG_ERROR("Required package Clp unavailable.")
108  fi
109fi
110
111#############################################################################
112#                            Third party solvers                            #
113#############################################################################
114
115# Check which third party solvers are available
116AC_COIN_HAS_MODULE(Cpx,      [osi-cplex])
117AC_COIN_HAS_MODULE(Glpk,     [osi-glpk])
118#AC_COIN_HAS_MODULE(Grb,     [osi-gurobi])
119AC_COIN_HAS_MODULE(Msk,      [osi-mosek])
120#AC_COIN_HAS_MODULE(Spx,     [osi-soplex])
121AC_COIN_HAS_MODULE(Xpr,      [osi-xpress])
122
123#############################################################################
124#                       Other third party software                          #
125#############################################################################
126
127# Ampl Solver library
128AC_COIN_HAS_MODULE(ASL, [coinasl], [required=0])
129
130#############################################################################
131#                       CbcGeneric configuration                            #
132#############################################################################
133
134# Are we building cbc-generic? Default is no (false).
135
136AC_ARG_WITH([cbc-generic],
137  AS_HELP_STRING([--with-cbc-generic],
138                 [specify whether to build cbc-generic (default: no)]),
139  [case $withval in
140    yes) cbc_with_cbc_generic=true ;;
141      *) cbc_with_cbc_generic=false ;;
142   esac],
143  [cbc_with_cbc_generic=false])
144if test x"$cbc_with_cbc_generic" = xyes ; then
145  AC_MSG_NOTICE([building cbc-generic])
146fi
147AM_CONDITIONAL(CBC_BUILD_CBC_GENERIC,
148               test x"$cbc_with_cbc_generic" = xtrue)
149
150# Set the default solver for cbc-generic. In theory, any OsiXXX should work.
151# In practice, only the three listed below have had any testing.
152
153AC_MSG_CHECKING(for cbc-generic default solver)
154AC_ARG_WITH([cbc-generic-solver],
155            AC_HELP_STRING([--with-cbc-generic-solver],
156                           [specify default solver for cbc-generic in lower
157                            case letters (if not given, clp is assumed)]),
158            [cbc_default_solver=$withval],
159            [cbc_default_solver=clp])
160AC_MSG_RESULT($cbc_default_solver)
161
162case $cbc_default_solver in
163   clp)
164    ;;
165  dylp)
166    ;;
167  glpk)
168    ;;
169     *)
170    AC_MSG_WARN([Unrecognised solver $cbc_default_solver chosen as cbc-generic default solver.])
171    ;;
172esac
173AC_DEFINE_UNQUOTED([CBC_DEFAULT_SOLVER],"$cbc_default_solver",
174  [Define to the name of the default solver to be used in cbc-generic in small letters])
175AC_DEFINE_UNQUOTED(CBCVERSION, "$PACKAGE_VERSION", "Version of Cbc")
176
177
178#############################################################################
179#                       Cbc parallel configuration                          #
180#############################################################################
181
182# First we define a new option, --enable-cbc-parallel
183
184AC_ARG_ENABLE([cbc-parallel],
185[AC_HELP_STRING([--enable-cbc-parallel],
186                [enables compilation of the SMP version of Cbc])])
187
188if test "$enable_cbc_parallel" = yes; then
189  # Define the preprocessor macro
190  AC_DEFINE([CBC_THREAD],[1],[Define to 1 if the SMP version of Cbc should be compiled])
191  AC_CHECK_LIB([rt],[clock_gettime],
192               [ADDLIBS="-lrt $ADDLIBS"
193                AC_DEFINE([HAVE_CLOCK_GETTIME],[1],[Define if clock_gettime and rt library is available])],
194               [AC_MSG_WARN([--enable-cbc-parallel selected, but -lrt unavailable; using gettimeofday instead of clock_gettime])])
195  AC_CHECK_LIB([pthread],[pthread_create],
196               [ADDLIBS="-lpthread $ADDLIBS"],
197               [AC_MSG_ERROR([--enable-cbc-parallel selected, but -lpthreads unavailable])])
198fi
199
200##############################################################################
201#                   VPATH links for example input files                      #
202##############################################################################
203
204# In case this is a VPATH configuration we need to make sure that the
205# input files for the examples are available in the VPATH directory.
206
207AC_COIN_VPATH_LINK(examples/sudoku_sample.csv)
208AC_COIN_VPATH_LINK(examples/quad.mps)
209AC_COIN_VPATH_LINK(examples/quad2.mps)
210
211##############################################################################
212#                   Finishing up by writing all the output                   #
213##############################################################################
214
215# Here list all the files that configure should create (except for the
216# configuration header file)
217AC_CONFIG_FILES([Makefile
218                 examples/Makefile
219                 src/Makefile
220                 test/Makefile
221                 cbc_addlibs.txt
222                 cbc.pc cbc-uninstalled.pc])
223
224# Here put the location and name of the configuration header file
225AC_CONFIG_HEADER([inc/config_cbc.h])
226
227# Finally, we let configure write all the output...
228AC_COIN_FINALIZE
Note: See TracBrowser for help on using the repository browser.