source: stable/1.3/Bonmin/configure.ac @ 1581

Last change on this file since 1581 was 1581, checked in by pbonami, 10 years ago

restoring stable/1.3

  • Property svn:eol-style set to native
  • Property svn:keywords set to "Author Date Id Revision"
File size: 7.8 KB
Line 
1# Copyright (C) 2006, 2008 International Business Machines.
2# All Rights Reserved.
3# This file is distributed under the Common Public License.
4
5## $Id: configure.ac 1581 2010-01-23 12:37:06Z pbonami $
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([Bonmin],[1.3stable],[coin-bonmin@list.coin-or.org])
16
17AC_COPYRIGHT([
18Copyright 2006, 2008 International Business Machines and others.
19All Rights Reserved.
20This file is part of the open source package BONMIN which is distributed
21under the Common Public License.])
22
23# List one file in the package so that the configure script can test
24# whether the package is actually there
25AC_CONFIG_SRCDIR(src/CbcBonmin/BonCbc.hpp)
26
27# Where should everything be installed by default?  Here, we want it
28# to be installed directly in 'bin', 'lib', 'include' subdirectories
29# of the directory where configure is run.  The default would be
30# /usr/local.
31AC_PREFIX_DEFAULT([`pwd`])
32
33#############################################################################
34#                         Standard build tool stuff                         #
35#############################################################################
36
37# Get the system type
38AC_CANONICAL_BUILD
39
40# If this project depends on external projects, the Externals file in
41# the source root directory contains definition of where to find those
42# externals.  The following macro ensures that those externals are
43# retrieved by svn if they are not there yet.
44AC_COIN_PROJECTDIR_INIT
45
46# Check if user wants to produce debugging code
47AC_COIN_DEBUG_COMPILE(Bonmin)
48
49# Get the name of the C++ compiler and appropriate compiler options
50AC_COIN_PROG_CXX
51
52# AW: I'm adding the Fortran compiler now for FilterSQP - we should
53# make this optional
54
55# Get the name of the Fortran compiler and appropriate compiler options
56AC_COIN_PROG_F77
57
58# Find out how to call Fortran from C and determine Fortran runtime libraries
59AC_COIN_F77_WRAPPERS
60
61# Initialize automake and libtool
62AC_COIN_INIT_AUTO_TOOLS
63
64#############################################################################
65#                              COIN components                              #
66#############################################################################
67
68AC_COIN_HAS_PROJECT(Cbc)
69AC_COIN_HAS_PROJECT(Cgl)
70AC_COIN_HAS_PROJECT(Clp)
71AC_COIN_HAS_PROJECT(CoinUtils)
72AC_COIN_HAS_PROJECT(DyLP)
73AC_COIN_HAS_PROJECT(Ipopt)
74AC_COIN_HAS_PROJECT(Osi)
75AC_COIN_HAS_PROJECT(Sym)
76AC_COIN_HAS_PROJECT(Vol)
77AC_COIN_HAS_PROJECT(Bcp)
78AC_COIN_HAS_PROJECT(Couenne)
79
80AC_ARG_WITH([bonminbcp],
81            AC_HELP_STRING([--with-bonminbcp],
82                           [Compile Bonmin with Bcp-based parallel version]),
83            [use_bcp="$withval"], [use_bcp=no])
84if test "$use_bcp" = yes; then
85  if test $m4_tolower(coin_has_$1) = unavailable ||
86     test $m4_tolower(coin_has_$1) = skipping; then
87     AC_MSG_ERROR([You specified --with-bonminbcp, but Bcp is not available])
88  fi
89fi
90AM_CONDITIONAL(COMPILE_BONMINBCP, test "$use_bcp" = yes)
91
92#############################################################################
93#                            Third party solvers                            #
94#############################################################################
95
96# Check which third party solvers are available ToDo!
97AC_COIN_HAS_USER_LIBRARY([Cplex],[CPX],[cplex.h],[CPXgetstat])
98AC_COIN_HAS_GLPK(Glpk)
99AC_COIN_HAS_USER_LIBRARY([FortMP],[FMP])  #ToDo! is Fortran?
100AC_COIN_HAS_USER_LIBRARY([Mosek],[MSK],[mosek.h],[MSK_openmosek])
101AC_COIN_HAS_USER_LIBRARY([Osl],[OSL],[ekk_c_api.h],[ekk_simplex])
102AC_COIN_HAS_USER_LIBRARY([Soplex],[SPX],[spxsolver.h]) # ToDo
103AC_COIN_HAS_USER_LIBRARY([Xpress],[XPR],[xprs.h],[XPRSsetintcontrol])
104
105#############################################################################
106#                       Other third party software                          #
107#############################################################################
108
109# Ampl Solver library
110AC_COIN_HAS_ASL
111
112
113# Some internal variables
114if test x"$BUILD_FP" != x; then
115  build_fp=yes
116fi
117AM_CONDITIONAL(BUILD_FP, test x$build_fp = xyes)
118
119#####################
120# FILTER SQP SOLVER #
121#####################
122
123filtersqpobjdir=../ThirdParty/FilterSQP
124filtersqpsrcdir=$srcdir/$filtersqpobjdir
125
126AC_MSG_NOTICE([Checking for Filter SQP library])
127
128AC_ARG_WITH([filtersqp],
129            AC_HELP_STRING([--with-filtersqp],
130                           [specify library for FilterSQP (or BUILD for compilation)]),
131            [use_filtersqp=$withval], [use_filtersqp=detect])
132
133if test "$use_filtersqp" = BUILD || test "$use_filtersqp" = detect; then
134# Check which files are available
135  AC_COIN_CHECK_FILE([$filtersqpsrcdir/source/src/filter.f],
136                     [AC_DEFINE(COIN_HAS_FILTERSQP,1,
137                                [Define to 1 if FilterSQP is available])
138                      use_filtersqp=BUILD],
139                     [if test "$use_filtersqp" = BUILD; then
140                       AC_MSG_ERROR([Filter SQP files are not available])
141                      fi])
142fi
143if test "$use_filtersqp" = detect; then
144  use_filtersqp=no
145fi
146
147if test "$use_filtersqp" = BUILD; then
148  FILTERSQPLIBADD=`cd $filtersqpobjdir; pwd`/libfiltersqp.la
149  coin_need_flibs=yes
150elif test "$use_filtersqp" != no; then
151  AC_MSG_CHECKING([whether user supplied FILTERSQPLIB=\"$use_filtersqp\" works])
152  SAVE_LIBS="$LIBS"
153  LIBS="$use_filtersqp $LIBS $FLIBS"
154  ADDLIBS="$use_filtersqp $ADDLIBS"
155  AC_LANG_PUSH([Fortran 77])
156  AC_TRY_LINK([],
157[      call filterSQP
158      end
159      subroutine confun
160      end
161      subroutine objfun
162      end
163      subroutine gradient
164      end
165      subroutine hessian],
166              [AC_MSG_RESULT([yes])],
167              [AC_MSG_RESULT([no])
168               AC_MSG_ERROR([user supplied FilterSQP library \"$use_filtersqp\" does not work])])
169  AC_LANG_POP([Fortran 77])
170  LIBS="$SAVE_LIBS"
171fi
172
173AM_CONDITIONAL([COIN_HAS_FILTERSQP], [test "$use_filtersqp" != no])
174AC_SUBST(FILTERSQPLIBADD)
175
176##########
177# ASTYLE #
178##########
179ASTYLE=astyle
180AC_SUBST(ASTYLE)
181ASTYLEFLAGS="--mode=c --indent=spaces=2 --indent-cases --indent-namespaces --min-conditional-indent=1 --brackets=linux --brackets=break-closing-headers --max-instatement-indent=2"
182AC_SUBST(ASTYLEFLAGS)   
183
184#############################################################################
185#                            Stuff for Examples                             #
186#############################################################################
187
188AC_COIN_VPATH_LINK(test/bonmin.opt)
189AC_COIN_VPATH_LINK(test/mytoy.nl)
190AC_CONFIG_LINKS([test/MyBonmin.cpp:examples/CppExample/MyBonmin.cpp
191                 test/MyTMINLP.cpp:examples/CppExample/MyTMINLP.cpp
192                 test/MyTMINLP.hpp:examples/CppExample/MyTMINLP.hpp])
193
194##############################################################################
195#                   Finishing up by writing all the output                   #
196##############################################################################
197
198AC_CONFIG_FILES([Makefile
199                 src/Apps/Makefile
200                 experimental/Bcp/Makefile
201                 src/CbcBonmin/Makefile
202                 src/Interfaces/Makefile
203                 src/Interfaces/Ipopt/Makefile
204                 src/Interfaces/Filter/Makefile
205                 src/Interfaces/Ampl/Makefile
206                 src/Algorithms/Makefile
207                 src/Algorithms/Ampl/Makefile
208                 src/Algorithms/Branching/Makefile
209                 src/Algorithms/QuadCuts/Makefile
210                 src/Algorithms/OaGenerators/Makefile
211                 src/CbcBonmin/Heuristics/Makefile
212                 experimental/FP/Makefile
213                 examples/OptionDocGen/Makefile
214                 test/Makefile
215                 examples/CppExample/Makefile])
216
217AC_CONFIG_HEADER([inc/config_bonmin.h])
218
219AC_COIN_FINALIZE
Note: See TracBrowser for help on using the repository browser.