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

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

fix disabling scip-threadsafe and corresponding warning message

File size: 9.0 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 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)
70AC_COIN_CHECK_PACKAGE(Clp, clp)
71AC_COIN_CHECK_USER_LIBRARY([Cplex], [CPX],[cplex.h],   [CPXgetstat])
72AC_COIN_CHECK_USER_LIBRARY([Mosek], [MSK],[mosek.h],   [MSK_makeenv])
73AC_COIN_CHECK_USER_LIBRARY([Xpress],[XPR],[xprs.h],    [XPRSinit])
74AC_COIN_CHECK_USER_LIBRARY([Gurobi],[GRB],[gurobi_c.h],[GRBloadenv])
75AC_COIN_CHECK_USER_LIBRARY([QSopt], [QSO],[qsopt.h],   [QScreate_prob])
76
77AC_ARG_WITH([scip-lpsolver],
78  AS_HELP_STRING([--with-scip-lpsolver],
79    [specify 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    SCIPLIB_CFLAGS="$SCIPLIB_CFLAGS $SOPLEX_CFLAGS"
110    SCIPLIB_LIBS="$SCIPLIB_LIBS $SOPLEX_LIBS"
111    SCIPLIB_LIBS_INSTALLED="$SCIPLIB_LIBS $SOPLEX_LIBS_INSTALLED"
112    SCIPLIB_PCLIBS="$SCIPLIB_PCLIBS $SOPLEX_PCLIBS"
113    SCIPLIB_PCREQUIRES="$SCIPLIB_PCREQUIRES $SOPLEX_PCREQUIRES"
114  ;;
115  clp)
116    if test "$coin_has_clp" = no ; then
117      AC_MSG_ERROR(["LP solver CLP not available.])
118    fi
119    SCIPLIB_CFLAGS="$SCIPLIB_CFLAGS $CLP_CFLAGS"
120    SCIPLIB_LIBS="$SCIPLIB_LIBS $CLP_LIBS"
121    SCIPLIB_LIBS_INSTALLED="$SCIPLIB_LIBS $CLP_LIBS_INSTALLED"
122    SCIPLIB_PCLIBS="$SCIPLIB_PCLIBS $CLP_PCLIBS"
123    SCIPLIB_PCREQUIRES="$SCIPLIB_PCREQUIRES $CLP_PCREQUIRES"
124  ;;
125  cplex)
126    if test "$coin_has_cpx" = false ; then
127      AC_MSG_ERROR(["LP solver CPLEX not available.])
128    fi
129    SCIPLIB_CFLAGS="$SCIPLIB_CFLAGS -I$CPXINCDIR"
130    SCIPLIB_LIBS="$SCIPLIB_LIBS $CPXLIB"
131    SCIPLIB_LIBS_INSTALLED="$SCIPLIB_LIBS $CPXLIB"
132    SCIPLIB_PCLIBS="$SCIPLIB_PCLIBS $CPXLIB"
133  ;;
134  mosek)
135    if test "$coin_has_msk" = false ; then
136      AC_MSG_ERROR(["LP solver Mosek not available.])
137    fi
138    SCIPLIB_CFLAGS="$SCIPLIB_CFLAGS -I$MSKINCDIR"
139    SCIPLIB_LIBS="$SCIPLIB_LIBS $MSKLIB"
140    SCIPLIB_LIBS_INSTALLED="$SCIPLIB_LIBS $MSKLIB"
141    SCIPLIB_PCLIBS="$SCIPLIB_PCLIBS $MSKLIB"
142  ;;
143  xpress)
144    if test "$coin_has_xpr" = false ; then
145      AC_MSG_ERROR(["LP solver Xpress not available.])
146    fi
147    SCIPLIB_CFLAGS="$SCIPLIB_CFLAGS -I$XPRINCDIR"
148    SCIPLIB_LIBS="$SCIPLIB_LIBS $XPRLIB"
149    SCIPLIB_LIBS_INSTALLED="$SCIPLIB_LIBS $XPRLIB"
150    SCIPLIB_PCLIBS="$SCIPLIB_PCLIBS $XPRLIB"
151  ;;
152  gurobi)
153    if test "$coin_has_grb" = false ; then
154      AC_MSG_ERROR(["LP solver Gurobi not available.])
155    fi
156    SCIPLIB_CFLAGS="$SCIPLIB_CFLAGS -I$GRBINCDIR"
157    SCIPLIB_LIBS="$SCIPLIB_LIBS $GRBLIB"
158    SCIPLIB_LIBS_INSTALLED="$SCIPLIB_LIBS $GRBLIB"
159    SCIPLIB_PCLIBS="$SCIPLIB_PCLIBS $GRBLIB"
160  ;;
161  qsopt)
162    if test "$coin_has_qso" = false ; then
163      AC_MSG_ERROR(["LP solver QSopt not available.])
164    fi
165    SCIPLIB_CFLAGS="$SCIPLIB_CFLAGS -I$QSOINCDIR"
166    SCIPLIB_LIBS="$SCIPLIB_LIBS $QSOLIB"
167    SCIPLIB_LIBS_INSTALLED="$SCIPLIB_LIBS $QSOLIB"
168    SCIPLIB_PCLIBS="$SCIPLIB_PCLIBS $QSOLIB"
169  ;;
170  none)
171  ;;
172  *)
173    AC_MSG_ERROR([LP solver $scip_lpsolver unknown.])
174  ;;
175esac
176AC_MSG_NOTICE([build with LP solver $scip_lpsolver])
177AM_CONDITIONAL(SCIPLPI_SPX, test $scip_lpsolver = soplex)
178AM_CONDITIONAL(SCIPLPI_CLP, test $scip_lpsolver = clp)
179AM_CONDITIONAL(SCIPLPI_CPX, test $scip_lpsolver = cplex)
180AM_CONDITIONAL(SCIPLPI_MSK, test $scip_lpsolver = mosek)
181AM_CONDITIONAL(SCIPLPI_XPR, test $scip_lpsolver = xpress)
182AM_CONDITIONAL(SCIPLPI_GRB, test $scip_lpsolver = gurobi)
183AM_CONDITIONAL(SCIPLPI_QSO, test $scip_lpsolver = qsopt)
184AM_CONDITIONAL(SCIPLPI_NONE, test $scip_lpsolver = none)
185
186# check for NLP solvers
187AC_COIN_CHECK_PACKAGE(Ipopt, ipopt, SCIPLib)
188
189#############################################################################
190#                       Check for system header and libraries               #
191#############################################################################
192
193EXTRAFLAGS=""
194
195AC_ARG_ENABLE([scip-threadsafe],
196  AS_HELP_STRING([--disable-scip-threadsafe],[do not build SCIP threadsafe (default=auto)]),
197  [scip_threadsafe=$enableval],
198  [scip_threadsafe=auto]) 
199
200if test $scip_threadsafe = yes || test $scip_threadsafe = auto ; then
201  AC_CHECK_LIB([pthread],[pthread_create],
202               [SCIPLIB_LIBS="-lpthread $SCIPLIB_LIBS"
203                SCIPLIB_PCLIBS="-lpthread $SCIPLIB_PCLIBS"
204               ],
205               [if test $scip_threadsafe = yes ; then
206                  AC_MSG_ERROR([--scip-threadsafe selected, but -lpthreads unavailable])
207                else
208                  AC_MSG_NOTICE([no pthreads, SCIP will not be threadsafe])
209                  EXTRAFLAGS="$EXTRAFLAGS -DNPARASCIP"
210                fi
211               ])
212else
213  EXTRAFLAGS="$EXTRAFLAGS -DNPARASCIP"
214fi
215
216AC_COIN_CHECK_GNU_ZLIB(SCIPlib)
217if test $coin_has_zlib = "yes"; then
218  EXTRAFLAGS="$EXTRAFLAGS -DWITH_ZLIB" 
219fi
220
221AC_COIN_CHECK_GMP(SCIPLib)
222if test $coin_has_gmp = yes; then
223  EXTRAFLAGS="$EXTRAFLAGS -DWITH_GMP" 
224fi
225
226AC_COIN_CHECK_GNU_READLINE(SCIPLib)
227if test $coin_has_readline = yes; then
228  EXTRAFLAGS="$EXTRAFLAGS -DWITH_READLINE" 
229fi
230
231AC_CHECK_MEMBER(struct sigaction.sa_handler,,
232  [EXTRAFLAGS="$EXTRAFLAGS -DNO_SIGACTION"],
233  [#include <signal.h>])
234   
235AC_CHECK_FUNC(rand_r,,
236  [EXTRAFLAGS="$EXTRAFLAGS -DNO_RAND_R"])
237   
238AC_CHECK_FUNC(strtok_r,,
239  [EXTRAFLAGS="$EXTRAFLAGS -DNO_STRTOK_R"])
240
241AC_CHECK_FUNC(strerror_r,,
242  [EXTRAFLAGS="$EXTRAFLAGS -DNO_STRERROR_R"])
243   
244AC_CHECK_HEADER([fenv.h],[EXTRAFLAGS="$EXTRAFLAGS -DROUNDING_FE"],
245  [AC_CHECK_HEADER([float.h],[EXTRAFLAGS="$EXTRAFLAGS -DROUNDING_MS"])])
246
247case "$CC" in
248  *gcc* )
249    EXTRAFLAGS="$EXTRAFLAGS -Wno-overlength-strings"
250    ;;
251esac
252 
253CFLAGS="$CFLAGS $EXTRAFLAGS"
254CXXFLAGS="$CXXFLAGS $EXTRAFLAGS"
255
256#############################################################################
257#                                Finish up                                  #
258#############################################################################
259
260AC_CONFIG_FILES([Makefile coinscip.pc coinscip-uninstalled.pc])
261
262# dummy header file to avoid many extra compiler flags
263AC_CONFIG_HEADER([config_scip.h])
264 
265AC_COIN_FINALIZE
Note: See TracBrowser for help on using the repository browser.