source: ThirdParty/SCIP/stable/1.0/configure.ac @ 2430

Last change on this file since 2430 was 2430, checked in by stefan, 8 years ago

sync with trunk rev2429

File size: 8.4 KB
Line 
1# Copyright (C) 2011 Stefan Vigerske and others
2# All Rights Reserved.
3# This file is distributed under the Eclipse Public License.
4
5## $Id: configure.ac 937 2010-10-02 19:05:12Z stefan $
6
7#############################################################################
8#                       Names and other basic things                        #
9#############################################################################
10
11AC_PREREQ(2.59)
12
13AC_INIT([ThirdPartyScip],[1.0],[http://projects.coin-or.org/BuildTools/newticket])
14
15AC_COPYRIGHT([
16Copyright 2011 Stefan Vigerske and others.
17All Rights Reserved.
18This file is part of the open source package COIN-OR which is distributed
19under the Eclipse Public License.])
20
21# List one file in the package so that the configure script can test
22# whether the package is actually there
23AC_CONFIG_SRCDIR(scip/src/scip/scip.h)
24
25# Where should everything be installed by default?  Here, we want it
26# to be installed directly in 'bin', 'lib', 'include' subdirectories
27# of the directory where configure is run.  The default would be
28# /usr/local.
29AC_PREFIX_DEFAULT([`pwd`])
30
31AC_COIN_PROJECTDIR_INIT(SCIP)
32
33#############################################################################
34#                         Standard build tool stuff                         #
35#############################################################################
36
37# Get the system type
38AC_CANONICAL_BUILD
39
40# Check if user wants to produce debugging code
41AC_COIN_DEBUG_COMPILE(SCIP)
42
43# Get the name of the C compiler and appropriate compiler options
44AC_COIN_PROG_CC
45
46# Get the name of the C++ compiler and appropriate compiler options
47AC_COIN_PROG_CXX
48
49# Initialize automake
50AM_INIT_AUTOMAKE([subdir-objects])
51AM_PROG_CC_C_O
52AC_COIN_INIT_AUTO_TOOLS
53
54#############################################################################
55#                         Check SCIP version number                         #
56#############################################################################
57
58AC_MSG_CHECKING([SCIP version])
59scipver=`awk '/define SCIP_VERSION/ {print $3}' ${srcdir}/scip/src/scip/def.h`
60scipsubver=`awk '/define SCIP_SUBVERSION/ {print $3}' ${srcdir}/scip/src/scip/def.h`
61AC_MSG_RESULT([${scipver}.${scipsubver}])
62if test $scipver -lt 200 -o $scipver -ge 210 ; then
63  AC_MSG_ERROR(["Incorrect SCIP version. This build system is made for SCIP 2.0.x"])
64fi
65
66#############################################################################
67#                       Check for external libraries                        #
68#############################################################################
69
70# check for some LP solvers
71AC_COIN_CHECK_PACKAGE(SoPlex, coinsoplex)
72AC_COIN_CHECK_PACKAGE(Clp, clp)
73AC_COIN_CHECK_USER_LIBRARY([Cplex], [CPX],[cplex.h],   [CPXgetstat])
74AC_COIN_CHECK_USER_LIBRARY([Mosek], [MSK],[mosek.h],   [MSK_makeenv])
75AC_COIN_CHECK_USER_LIBRARY([Xpress],[XPR],[xprs.h],    [XPRSinit])
76AC_COIN_CHECK_USER_LIBRARY([Gurobi],[GRB],[gurobi_c.h],[GRBloadenv])
77AC_COIN_CHECK_USER_LIBRARY([QSopt], [QSO],[qsopt.h],   [QScreate_prob])
78
79AC_ARG_WITH([scip-lpsolver],
80  AS_HELP_STRING([--with-scip-lpsolver],
81    [specify LP solver to use in SCIP (soplex, clp, cplex, mosek, xpress, gurobi, qsopt, none)]),
82  [if test "$withval" = no ; then
83     scip_lpsolver=none
84   else
85     scip_lpsolver="$withval"
86   fi],
87  [if test "$coin_has_soplex" = yes ; then
88     scip_lpsolver=soplex
89   elif test "$coin_has_clp" = yes ; then
90     scip_lpsolver=clp
91   elif test "$coin_has_cpx" = true ; then
92     scip_lpsolver=cplex
93   elif test "$coin_has_msk" = true ; then
94     scip_lpsolver=mosek
95   elif test "$coin_has_xpr" = true ; then
96     scip_lpsolver=xpress
97   elif test "$coin_has_grb" = true ; then
98     scip_lpsolver=gurobi
99   elif test "$coin_has_qso" = true ; then
100     scip_lpsolver=qsopt
101   else
102     scip_lpsolver=none
103   fi
104  ])
105 
106case "$scip_lpsolver" in
107  soplex)
108    if test "$coin_has_soplex" = no ; then
109      AC_MSG_ERROR(["LP solver SoPlex not available.])
110    fi
111    SCIPLIB_CFLAGS="$SCIPLIB_CFLAGS $SOPLEX_CFLAGS"
112    SCIPLIB_LIBS="$SCIPLIB_LIBS $SOPLEX_LIBS"
113    SCIPLIB_LIBS_INSTALLED="$SCIPLIB_LIBS $SOPLEX_LIBS_INSTALLED"
114    SCIPLIB_PCLIBS="$SCIPLIB_PCLIBS $SOPLEX_PCLIBS"
115    SCIPLIB_PCREQUIRES="$SCIPLIB_PCREQUIRES $SOPLEX_PCREQUIRES"
116  ;;
117  clp)
118    if test "$coin_has_clp" = no ; then
119      AC_MSG_ERROR(["LP solver CLP not available.])
120    fi
121    SCIPLIB_CFLAGS="$SCIPLIB_CFLAGS $CLP_CFLAGS"
122    SCIPLIB_LIBS="$SCIPLIB_LIBS $CLP_LIBS"
123    SCIPLIB_LIBS_INSTALLED="$SCIPLIB_LIBS $CLP_LIBS_INSTALLED"
124    SCIPLIB_PCLIBS="$SCIPLIB_PCLIBS $CLP_PCLIBS"
125    SCIPLIB_PCREQUIRES="$SCIPLIB_PCREQUIRES $CLP_PCREQUIRES"
126  ;;
127  cplex)
128    if test "$coin_has_cpx" = false ; then
129      AC_MSG_ERROR(["LP solver CPLEX not available.])
130    fi
131    SCIPLIB_CFLAGS="$SCIPLIB_CFLAGS -I$CPXINCDIR"
132    SCIPLIB_LIBS="$SCIPLIB_LIBS $CPXLIB"
133    SCIPLIB_LIBS_INSTALLED="$SCIPLIB_LIBS $CPXLIB"
134    SCIPLIB_PCLIBS="$SCIPLIB_PCLIBS $CPXLIB"
135  ;;
136  mosek)
137    if test "$coin_has_msk" = false ; then
138      AC_MSG_ERROR(["LP solver Mosek not available.])
139    fi
140    SCIPLIB_CFLAGS="$SCIPLIB_CFLAGS -I$MSKINCDIR"
141    SCIPLIB_LIBS="$SCIPLIB_LIBS $MSKLIB"
142    SCIPLIB_LIBS_INSTALLED="$SCIPLIB_LIBS $MSKLIB"
143    SCIPLIB_PCLIBS="$SCIPLIB_PCLIBS $MSKLIB"
144  ;;
145  xpress)
146    if test "$coin_has_xpr" = false ; then
147      AC_MSG_ERROR(["LP solver Xpress not available.])
148    fi
149    SCIPLIB_CFLAGS="$SCIPLIB_CFLAGS -I$XPRINCDIR"
150    SCIPLIB_LIBS="$SCIPLIB_LIBS $XPRLIB"
151    SCIPLIB_LIBS_INSTALLED="$SCIPLIB_LIBS $XPRLIB"
152    SCIPLIB_PCLIBS="$SCIPLIB_PCLIBS $XPRLIB"
153  ;;
154  gurobi)
155    if test "$coin_has_grb" = false ; then
156      AC_MSG_ERROR(["LP solver Gurobi not available.])
157    fi
158    SCIPLIB_CFLAGS="$SCIPLIB_CFLAGS -I$GRBINCDIR"
159    SCIPLIB_LIBS="$SCIPLIB_LIBS $GRBLIB"
160    SCIPLIB_LIBS_INSTALLED="$SCIPLIB_LIBS $GRBLIB"
161    SCIPLIB_PCLIBS="$SCIPLIB_PCLIBS $GRBLIB"
162  ;;
163  qsopt)
164    if test "$coin_has_qso" = false ; then
165      AC_MSG_ERROR(["LP solver QSopt not available.])
166    fi
167    SCIPLIB_CFLAGS="$SCIPLIB_CFLAGS -I$QSOINCDIR"
168    SCIPLIB_LIBS="$SCIPLIB_LIBS $QSOLIB"
169    SCIPLIB_LIBS_INSTALLED="$SCIPLIB_LIBS $QSOLIB"
170    SCIPLIB_PCLIBS="$SCIPLIB_PCLIBS $QSOLIB"
171  ;;
172  none)
173  ;;
174  *)
175    AC_MSG_ERROR([LP solver $scip_lpsolver unknown.])
176  ;;
177esac
178AC_MSG_NOTICE([build with LP solver $scip_lpsolver])
179AM_CONDITIONAL(SCIPLPI_SPX, test $scip_lpsolver = soplex)
180AM_CONDITIONAL(SCIPLPI_CLP, test $scip_lpsolver = clp)
181AM_CONDITIONAL(SCIPLPI_CPX, test $scip_lpsolver = cplex)
182AM_CONDITIONAL(SCIPLPI_MSK, test $scip_lpsolver = mosek)
183AM_CONDITIONAL(SCIPLPI_XPR, test $scip_lpsolver = xpress)
184AM_CONDITIONAL(SCIPLPI_GRB, test $scip_lpsolver = gurobi)
185AM_CONDITIONAL(SCIPLPI_QSO, test $scip_lpsolver = qsopt)
186AM_CONDITIONAL(SCIPLPI_NONE, test $scip_lpsolver = none)
187
188# check for NLP solvers
189if test $scipver -ge 202 ; then
190  AC_COIN_CHECK_PACKAGE(Ipopt, ipopt, SCIPLib)
191else
192  AM_CONDITIONAL(COIN_HAS_IPOPT, test 0 = 1)
193fi
194
195# check for CppAD
196AC_COIN_CHECK_PACKAGE(CppAD, cppad, SCIPLib)
197
198#############################################################################
199#                       Check for system header and libraries               #
200#############################################################################
201
202AC_COIN_CHECK_GNU_ZLIB(SCIPlib)
203if test $coin_has_zlib = "yes"; then
204  EXTRAFLAGS="$EXTRAFLAGS -DWITH_ZLIB" 
205fi
206
207AC_COIN_CHECK_GMP(SCIPLib)
208if test $coin_has_gmp = yes; then
209  EXTRAFLAGS="$EXTRAFLAGS -DWITH_GMP" 
210fi
211
212AC_COIN_CHECK_GNU_READLINE(SCIPLib)
213if test $coin_has_readline = yes; then
214  EXTRAFLAGS="$EXTRAFLAGS -DWITH_READLINE" 
215fi
216
217AC_CHECK_MEMBER(struct sigaction.sa_handler,,
218  [EXTRAFLAGS="$EXTRAFLAGS -DNO_SIGACTION"],
219  [#include <signal.h>])
220   
221AC_CHECK_FUNC(rand_r,,
222  [EXTRAFLAGS="$EXTRAFLAGS -DNO_RAND_R"])
223   
224AC_CHECK_FUNC(strtok_r,,
225  [EXTRAFLAGS="$EXTRAFLAGS -DNO_STRTOK_R"])
226
227AC_CHECK_FUNC(strerror_r,,
228  [EXTRAFLAGS="$EXTRAFLAGS -DNO_STRERROR_R"])
229   
230AC_CHECK_HEADER([fenv.h],[EXTRAFLAGS="$EXTRAFLAGS -DROUNDING_FE"],
231  [AC_CHECK_HEADER([float.h],[EXTRAFLAGS="$EXTRAFLAGS -DROUNDING_MS"])])
232
233case "$CC" in
234  *gcc* )
235    EXTRAFLAGS="$EXTRAFLAGS -Wno-overlength-strings"
236    ;;
237esac
238 
239CFLAGS="$CFLAGS $EXTRAFLAGS"
240CXXFLAGS="$CXXFLAGS $EXTRAFLAGS"
241
242#############################################################################
243#                                Finish up                                  #
244#############################################################################
245
246AC_CONFIG_FILES([Makefile coinscip.pc coinscip-uninstalled.pc])
247
248# dummy header file to avoid many extra compiler flags
249AC_CONFIG_HEADER([config_scip.h])
250 
251AC_COIN_FINALIZE
Note: See TracBrowser for help on using the repository browser.