source: ThirdParty/SCIP/trunk/configure.ac @ 2690

Last change on this file since 2690 was 2690, checked in by stefan, 7 years ago

allow for several LP solvers in one SCIP library - yeah :-)

File size: 7.8 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],[trunk],[http://projects.coin-or.org/BuildTools/newticket])
14
15AC_COPYRIGHT([
16Copyright 2011-2012 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
50AC_COIN_INIT_AUTO_TOOLS
51
52#############################################################################
53#                         Check SCIP version number                         #
54#############################################################################
55
56AC_MSG_CHECKING([SCIP version])
57scipver=`awk '/define SCIP_VERSION/ {print $3}' ${srcdir}/scip/src/scip/def.h`
58scipsubver=`awk '/define SCIP_SUBVERSION/ {print $3}' ${srcdir}/scip/src/scip/def.h`
59AC_MSG_RESULT([${scipver}.${scipsubver}])
60if test $scipver -lt 300 -o $scipver -ge 310 ; then
61  AC_MSG_ERROR(["Incorrect SCIP version. This build system is made for SCIP 3.0.x"])
62fi
63
64#############################################################################
65#                       Check for external libraries                        #
66#############################################################################
67
68# check for some LP solvers
69AC_COIN_CHECK_PACKAGE(SoPlex, coinsoplex, SCIPLib)
70AC_COIN_CHECK_PACKAGE(Clp, clp, SCIPLib)
71AC_COIN_CHECK_USER_LIBRARY([Cplex], [CPX],[cplex.h],   [CPXgetstat],,   [SCIPLib])
72AC_COIN_CHECK_USER_LIBRARY([Mosek], [MSK],[mosek.h],   [MSK_makeenv],,  [SCIPLib])
73AC_COIN_CHECK_USER_LIBRARY([Xpress],[XPR],[xprs.h],    [XPRSinit],,     [SCIPLib])
74AC_COIN_CHECK_USER_LIBRARY([Gurobi],[GRB],[gurobi_c.h],[GRBloadenv],,   [SCIPLib])
75AC_COIN_CHECK_USER_LIBRARY([QSopt], [QSO],[qsopt.h],   [QScreate_prob],,[SCIPLib])
76
77AC_ARG_WITH([scip-lpsolver],
78  AS_HELP_STRING([--with-scip-lpsolver],
79    [specify default LP solver to use in SCIP (soplex, clp, cplex, mosek, xpress, gurobi, qsopt, none)]),
80  [if test "$withval" = no ; then
81     scip_lpsolver=none
82   else
83     scip_lpsolver="$withval"
84   fi],
85  [if test "$coin_has_soplex" = yes ; then
86     scip_lpsolver=soplex
87   elif test "$coin_has_clp" = yes ; then
88     scip_lpsolver=clp
89   elif test "$coin_has_cpx" = true ; then
90     scip_lpsolver=cplex
91   elif test "$coin_has_msk" = true ; then
92     scip_lpsolver=mosek
93   elif test "$coin_has_xpr" = true ; then
94     scip_lpsolver=xpress
95   elif test "$coin_has_grb" = true ; then
96     scip_lpsolver=gurobi
97   elif test "$coin_has_qso" = true ; then
98     scip_lpsolver=qsopt
99   else
100     scip_lpsolver=none
101   fi
102  ])
103
104case "$scip_lpsolver" in
105  soplex)
106    if test "$coin_has_soplex" = no ; then
107      AC_MSG_ERROR(["LP solver SoPlex not available.])
108    fi
109    AC_DEFINE(SCIP_LPISW_LPDEFAULT, SCIP_LPISW_SOPLEX, [Default LP solver in SCIP])
110  ;;
111  clp)
112    if test "$coin_has_clp" = no ; then
113      AC_MSG_ERROR(["LP solver CLP not available.])
114    fi
115    AC_DEFINE(SCIP_LPISW_LPDEFAULT, SCIP_LPISW_CLP, [Default LP solver in SCIP])
116  ;;
117  cplex)
118    if test "$coin_has_cpx" = false ; then
119      AC_MSG_ERROR(["LP solver CPLEX not available.])
120    fi
121    AC_DEFINE(SCIP_LPISW_LPDEFAULT, SCIP_LPISW_CPLEX, [Default LP solver in SCIP])
122  ;;
123  mosek)
124    if test "$coin_has_msk" = false ; then
125      AC_MSG_ERROR(["LP solver Mosek not available.])
126    fi
127    AC_DEFINE(SCIP_LPISW_LPDEFAULT, SCIP_LPISW_MOSEK, [Default LP solver in SCIP])
128  ;;
129  xpress)
130    if test "$coin_has_xpr" = false ; then
131      AC_MSG_ERROR(["LP solver Xpress not available.])
132    fi
133    AC_DEFINE(SCIP_LPISW_LPDEFAULT, SCIP_LPISW_XPRESS, [Default LP solver in SCIP])
134  ;;
135  gurobi)
136    if test "$coin_has_grb" = false ; then
137      AC_MSG_ERROR(["LP solver Gurobi not available.])
138    fi
139    AC_DEFINE(SCIP_LPISW_LPDEFAULT, SCIP_LPISW_GUROBI, [Default LP solver in SCIP])
140  ;;
141  qsopt)
142    if test "$coin_has_qso" = false ; then
143      AC_MSG_ERROR(["LP solver QSopt not available.])
144    fi
145    AC_DEFINE(SCIP_LPISW_LPDEFAULT, SCIP_LPISW_QSOPT, [Default LP solver in SCIP])
146  ;;
147  none)
148    AC_DEFINE(SCIP_LPISW_LPDEFAULT, SCIP_LPISW_NONE, [Default LP solver in SCIP])
149  ;;
150  *)
151    AC_MSG_ERROR([LP solver $scip_lpsolver unknown.])
152  ;;
153esac
154AC_MSG_NOTICE([default LP solver is $scip_lpsolver])
155
156# check for NLP solvers
157AC_COIN_CHECK_PACKAGE(Ipopt, ipopt, SCIPLib)
158
159#############################################################################
160#                       Check for system header and libraries               #
161#############################################################################
162
163EXTRAFLAGS=""
164
165AC_ARG_ENABLE([scip-threadsafe],
166  AS_HELP_STRING([--disable-scip-threadsafe],[do not build SCIP threadsafe (default=auto)]),
167  [scip_threadsafe=$enableval],
168  [scip_threadsafe=auto]) 
169
170if test $scip_threadsafe = yes || test $scip_threadsafe = auto ; then
171  AC_CHECK_LIB([pthread],[pthread_create],
172               [SCIPLIB_LIBS="-lpthread $SCIPLIB_LIBS"
173                SCIPLIB_PCLIBS="-lpthread $SCIPLIB_PCLIBS"
174               ],
175               [if test $scip_threadsafe = yes ; then
176                  AC_MSG_ERROR([--scip-threadsafe selected, but -lpthreads unavailable])
177                else
178                  AC_MSG_NOTICE([no pthreads, SCIP will not be threadsafe])
179                  EXTRAFLAGS="$EXTRAFLAGS -DNPARASCIP"
180                fi
181               ])
182else
183  EXTRAFLAGS="$EXTRAFLAGS -DNPARASCIP"
184fi
185
186AC_COIN_CHECK_GNU_ZLIB(SCIPlib)
187if test $coin_has_zlib = "yes"; then
188  EXTRAFLAGS="$EXTRAFLAGS -DWITH_ZLIB" 
189fi
190
191AC_COIN_CHECK_GMP(SCIPLib)
192if test $coin_has_gmp = yes; then
193  EXTRAFLAGS="$EXTRAFLAGS -DWITH_GMP" 
194fi
195
196AC_COIN_CHECK_GNU_READLINE(SCIPLib)
197if test $coin_has_readline = yes; then
198  EXTRAFLAGS="$EXTRAFLAGS -DWITH_READLINE" 
199fi
200
201AC_CHECK_MEMBER(struct sigaction.sa_handler,,
202  [EXTRAFLAGS="$EXTRAFLAGS -DNO_SIGACTION"],
203  [#include <signal.h>])
204   
205AC_CHECK_FUNC(rand_r,,
206  [EXTRAFLAGS="$EXTRAFLAGS -DNO_RAND_R"])
207   
208AC_CHECK_FUNC(strtok_r,,
209  [EXTRAFLAGS="$EXTRAFLAGS -DNO_STRTOK_R"])
210
211AC_CHECK_FUNC(strerror_r,,
212  [EXTRAFLAGS="$EXTRAFLAGS -DNO_STRERROR_R"])
213   
214AC_CHECK_HEADER([fenv.h],[EXTRAFLAGS="$EXTRAFLAGS -DROUNDING_FE"],
215  [AC_CHECK_HEADER([float.h],[EXTRAFLAGS="$EXTRAFLAGS -DROUNDING_MS"])])
216
217case "$CC" in
218  *gcc* )
219    EXTRAFLAGS="$EXTRAFLAGS -Wno-overlength-strings"
220    ;;
221esac
222 
223CFLAGS="$CFLAGS $EXTRAFLAGS"
224CXXFLAGS="$CXXFLAGS $EXTRAFLAGS"
225
226#############################################################################
227#                                Finish up                                  #
228#############################################################################
229
230AC_CONFIG_FILES([Makefile coinscip.pc coinscip-uninstalled.pc])
231
232AC_CONFIG_HEADER([config_scip.h])
233 
234AC_COIN_FINALIZE
Note: See TracBrowser for help on using the repository browser.