source: trunk/Cbc/configure.ac @ 317

Last change on this file since 317 was 317, checked in by andreasw, 16 years ago

Several fixes to make autotools work on Cygwin

File size: 5.3 KB
Line 
1# Copyright (C) 2006 International Business Machines.
2# All Rights Reserved.
3# This file is distributed under the Common Public License.
4
5## $Id: configure.ac,v 1.1.2.1 2006/04/19 23:25:12 andreasw Exp $
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],[0.1],[coin-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
23AC_REVISION(0.9)
24
25# List one file in the package so that the configure script can test
26# whether the package is actually there
27AC_CONFIG_SRCDIR(src/CbcTree.hpp)
28
29#############################################################################
30#                         Standard build tool stuff                         #
31#############################################################################
32
33# Get the system type
34AC_CANONICAL_BUILD
35
36# Where should everything be installed by default?  Here, we want it
37# to be installed directly in 'bin', 'lib', 'include' subdirectories
38# of the directory where configure is run.  The default would be
39# /usr/local.
40AC_PREFIX_DEFAULT([`pwd`])
41
42# If this project depends on external projects, the Externals file in
43# the source root directory contains definition of where to find those
44# externals.  The following macro ensures that those externals are
45# retrieved by svn if they are not there yet.
46AC_COIN_SRCDIR_INIT
47
48# Check if user wants to produce debugging code
49AC_COIN_DEBUG_COMPILE
50
51# This package is written in C++
52AC_LANG(C++)
53
54# Get the name of the C++ compiler and appropriate compiler options
55AC_COIN_PROG_CXX
56
57# Initialize automake and libtool
58AC_COIN_INIT_AUTO_TOOLS
59
60#############################################################################
61#                              COIN components                              #
62#############################################################################
63
64AC_COIN_HAS_PROJECT(Cbc)
65AC_COIN_HAS_PROJECT(Cgl)
66AC_COIN_HAS_PROJECT(Clp)
67AC_COIN_HAS_PROJECT(CoinUtils)
68AC_COIN_HAS_PROJECT(Dylp)
69AC_COIN_HAS_PROJECT(Osi)
70AC_COIN_HAS_PROJECT(Sym)
71AC_COIN_HAS_PROJECT(Vol)
72
73# ToDo: find out when CBC_HAS_CLP should be defined!  For now, I
74# replaced all CBC_USE by COIN_HAS #ifdef's
75
76# Decide which one is the default solver
77AC_MSG_CHECKING(for CBC default solver)
78AC_ARG_WITH([cbc-default-solver],
79            AC_HELP_STRING([--with-cbc-default-solver],
80                           [specify default solver for Cbc in lower case letters (if not given, clp is assumed)]),
81            [cbc_default_solver=$with_val],
82            [cbc_default_solver=clp])
83AC_MSG_RESULT($cbc_default_solver)
84
85case $cbc_default_solver in
86  clp)
87    AC_DEFINE([CBC_DEFAULT_SOLVER],"clp",
88              [Define to the name of the default solver to be used in CBC in small letters])
89    ;;
90  dylp)
91    AC_DEFINE([CBC_DEFAULT_SOLVER],"dylp")
92    ;;
93  *)
94    AC_MSG_ERROR([Unknown solver $cbc_default_solver chosen as CBC's default solver])
95    ;;
96esac
97
98# Steal some files from Clp - they are going to be deleted by a
99# distclean in src (see the Makefile.am there)
100if test x"$coin_has_clp" != xunavailable; then
101  AC_MSG_NOTICE([Stealing CbcOrClpParam's files from Clp])
102  AC_CONFIG_LINKS([src/CbcOrClpParam.cpp:../Clp/src/CbcOrClpParam.cpp
103                   src/CbcOrClpParam.hpp:../Clp/src/CbcOrClpParam.hpp])
104fi
105
106#############################################################################
107#                            Third party solvers                            #
108#############################################################################
109
110# Some solvers require additional library, which we check for first.
111# ADDLIBS is our variable that accumulates the libraries necessary for
112# linking.
113AC_CHECK_LIB([pthread],[pthread_create],
114             [ADDLIBS="-lpthread $ADDLIBS"])
115AC_CHECK_LIB([dl],[dlopen],
116             [ADDLIBS="-ldl $ADDLIBS"])
117
118# Check which third party solvers are available ToDo!
119AC_COIN_HAS_USER_LIBRARY([Cplex],[CPX],[cplex],[cplex.h],[CPXgetstat])
120AC_COIN_HAS_USER_LIBRARY([Glpk],[GLPK],[glpk],[glpk.h],[glp_lpx_simplex])
121AC_COIN_HAS_USER_LIBRARY([FortMP],[FMP],[fmp])  #ToDo! is Fortran?
122AC_COIN_HAS_USER_LIBRARY([Mosek],[MSK],[mosekdl],[mosekdl.h],[MSK_openmosek])
123AC_COIN_HAS_USER_LIBRARY([Osl],[OSL],[osl],[ekk_c_api.h],[ekk_simplex])
124AC_COIN_HAS_USER_LIBRARY([Soplex],[SPX],[spx],[spxsolver.h]) # ToDo
125AC_COIN_HAS_USER_LIBRARY([Xpress],[XPR],[xpr],[xprs.h],[XPRSsetintcontrol])
126
127##############################################################################
128#                   Finishing up by writing all the output                   #
129##############################################################################
130
131# Here list all the files that configure should create (except for the
132# configuration header file)
133AC_CONFIG_FILES([Makefile
134                 src/Makefile
135                 test/Makefile
136                 cbc_addlibs.txt])
137
138# Here put the location and name of the configuration header file
139AC_CONFIG_HEADER([inc/config_cbc.h])
140
141# Finally, we let configure write all the output...
142AC_OUTPUT
143
144# ...and tell the user, that the configuration finished
145AC_MSG_NOTICE([Cbc configuration successful])
Note: See TracBrowser for help on using the repository browser.