source: ThirdParty/SCIP/stable/1.4/configure.ac @ 3429

Last change on this file since 3429 was 3429, checked in by tkr, 7 years ago

temporarily committing release candidate

File size: 8.1 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.4.1],[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,5:1:4)
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 310 -o $scipver -ge 320 ; then
61  AC_MSG_ERROR(["Incorrect SCIP version. This build system is made for SCIP 3.1.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, soplex2, 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=soplex2
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  soplex2)
112    if test "$coin_has_soplex" = no ; then
113      AC_MSG_ERROR(["LP solver SoPlex not available.])
114    fi
115    AC_DEFINE(SCIP_LPISW_LPDEFAULT, SCIP_LPISW_SOPLEX2, [Default LP solver in SCIP])
116  ;;
117  clp)
118    if test "$coin_has_clp" = no ; then
119      AC_MSG_ERROR(["LP solver CLP not available.])
120    fi
121    AC_DEFINE(SCIP_LPISW_LPDEFAULT, SCIP_LPISW_CLP, [Default LP solver in SCIP])
122  ;;
123  cplex)
124    if test "$coin_has_cpx" = false ; then
125      AC_MSG_ERROR(["LP solver CPLEX not available.])
126    fi
127    AC_DEFINE(SCIP_LPISW_LPDEFAULT, SCIP_LPISW_CPLEX, [Default LP solver in SCIP])
128  ;;
129  mosek)
130    if test "$coin_has_msk" = false ; then
131      AC_MSG_ERROR(["LP solver Mosek not available.])
132    fi
133    AC_DEFINE(SCIP_LPISW_LPDEFAULT, SCIP_LPISW_MOSEK, [Default LP solver in SCIP])
134  ;;
135  xpress)
136    if test "$coin_has_xpr" = false ; then
137      AC_MSG_ERROR(["LP solver Xpress not available.])
138    fi
139    AC_DEFINE(SCIP_LPISW_LPDEFAULT, SCIP_LPISW_XPRESS, [Default LP solver in SCIP])
140  ;;
141  gurobi)
142    if test "$coin_has_grb" = false ; then
143      AC_MSG_ERROR(["LP solver Gurobi not available.])
144    fi
145    AC_DEFINE(SCIP_LPISW_LPDEFAULT, SCIP_LPISW_GUROBI, [Default LP solver in SCIP])
146  ;;
147  qsopt)
148    if test "$coin_has_qso" = false ; then
149      AC_MSG_ERROR(["LP solver QSopt not available.])
150    fi
151    AC_DEFINE(SCIP_LPISW_LPDEFAULT, SCIP_LPISW_QSOPT, [Default LP solver in SCIP])
152  ;;
153  none)
154    AC_DEFINE(SCIP_LPISW_LPDEFAULT, SCIP_LPISW_NONE, [Default LP solver in SCIP])
155  ;;
156  *)
157    AC_MSG_ERROR([LP solver $scip_lpsolver unknown.])
158  ;;
159esac
160AC_MSG_NOTICE([default LP solver is $scip_lpsolver])
161
162# check for NLP solvers
163AC_COIN_CHECK_PACKAGE(Ipopt, ipopt, SCIPLib)
164
165#############################################################################
166#                       Check for system header and libraries               #
167#############################################################################
168
169EXTRAFLAGS="-DWITH_SCIPDEF"
170
171AC_ARG_ENABLE([scip-threadsafe],
172  AS_HELP_STRING([--disable-scip-threadsafe],[do not build SCIP threadsafe (default=auto)]),
173  [scip_threadsafe=$enableval],
174  [scip_threadsafe=auto]) 
175
176if test $scip_threadsafe = yes || test $scip_threadsafe = auto ; then
177  AC_CHECK_LIB([pthread],[pthread_create],
178               [SCIPLIB_LIBS="-lpthread $SCIPLIB_LIBS"
179                SCIPLIB_PCLIBS="-lpthread $SCIPLIB_PCLIBS"
180               ],
181               [if test $scip_threadsafe = yes ; then
182                  AC_MSG_ERROR([--scip-threadsafe selected, but -lpthreads unavailable])
183                else
184                  AC_MSG_NOTICE([no pthreads, SCIP will not be threadsafe])
185                  EXTRAFLAGS="$EXTRAFLAGS -DNPARASCIP"
186                fi
187               ])
188else
189  EXTRAFLAGS="$EXTRAFLAGS -DNPARASCIP"
190fi
191
192AC_COIN_CHECK_GNU_ZLIB(SCIPlib)
193if test $coin_has_zlib = "yes"; then
194  EXTRAFLAGS="$EXTRAFLAGS -DWITH_ZLIB" 
195fi
196
197AC_COIN_CHECK_GMP(SCIPLib)
198if test $coin_has_gmp = yes; then
199  EXTRAFLAGS="$EXTRAFLAGS -DWITH_GMP" 
200fi
201
202AC_COIN_CHECK_GNU_READLINE(SCIPLib)
203if test $coin_has_readline = yes; then
204  EXTRAFLAGS="$EXTRAFLAGS -DWITH_READLINE" 
205fi
206
207AC_CHECK_MEMBER(struct sigaction.sa_handler,,
208  [EXTRAFLAGS="$EXTRAFLAGS -DNO_SIGACTION"],
209  [#include <signal.h>])
210   
211AC_CHECK_FUNC(rand_r,,
212  [EXTRAFLAGS="$EXTRAFLAGS -DNO_RAND_R"])
213   
214AC_CHECK_FUNC(strtok_r,,
215  [EXTRAFLAGS="$EXTRAFLAGS -DNO_STRTOK_R"])
216
217AC_CHECK_FUNC(strerror_r,,
218  [EXTRAFLAGS="$EXTRAFLAGS -DNO_STRERROR_R"])
219   
220AC_CHECK_HEADER([fenv.h],[EXTRAFLAGS="$EXTRAFLAGS -DROUNDING_FE"],
221  [AC_CHECK_HEADER([float.h],[EXTRAFLAGS="$EXTRAFLAGS -DROUNDING_MS"])])
222
223case "$CC" in
224  *gcc* )
225    EXTRAFLAGS="$EXTRAFLAGS -Wno-overlength-strings"
226    ;;
227esac
228
229CFLAGS="$CFLAGS $EXTRAFLAGS"
230CXXFLAGS="$CXXFLAGS $EXTRAFLAGS"
231
232#############################################################################
233#                                Finish up                                  #
234#############################################################################
235
236AC_CONFIG_FILES([Makefile coinscip.pc coinscip-uninstalled.pc])
237
238AC_CONFIG_HEADER([config_scip.h])
239 
240AC_COIN_FINALIZE
Note: See TracBrowser for help on using the repository browser.