source: trunk/Bonmin/configure.ac @ 767

Last change on this file since 767 was 767, checked in by pbonami, 12 years ago

Commit the (non-working) code for outputing tables of options

  • Property svn:eol-style set to native
  • Property svn:keywords set to "Author Date Id Revision"
File size: 7.3 KB
Line 
1# Copyright (C) 2006 International Business Machines.
2# All Rights Reserved.
3# This file is distributed under the Common Public License.
4
5## $Id: configure.ac 767 2007-09-09 02:40:00Z 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],[0.9],[coin-bonmin@list.coin-or.org])
16
17AC_COPYRIGHT([
18Copyright 2006 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
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
80#############################################################################
81#                            Third party solvers                            #
82#############################################################################
83
84# Check which third party solvers are available ToDo!
85AC_COIN_HAS_USER_LIBRARY([Cplex],[CPX],[cplex.h],[CPXgetstat])
86AC_COIN_HAS_USER_LIBRARY([Glpk],[GLPK],[glpk.h],[glp_lpx_simplex _glp_lpx_simplex])
87AC_COIN_HAS_USER_LIBRARY([FortMP],[FMP])  #ToDo! is Fortran?
88AC_COIN_HAS_USER_LIBRARY([Mosek],[MSK],[mosekdl.h],[MSK_openmosek])
89AC_COIN_HAS_USER_LIBRARY([Osl],[OSL],[ekk_c_api.h],[ekk_simplex])
90AC_COIN_HAS_USER_LIBRARY([Soplex],[SPX],[spxsolver.h]) # ToDo
91AC_COIN_HAS_USER_LIBRARY([Xpress],[XPR],[xprs.h],[XPRSsetintcontrol])
92
93#############################################################################
94#                       Other third party software                          #
95#############################################################################
96
97# Ampl Solver library
98AC_COIN_HAS_ASL
99
100
101# Some internal variables
102if test x"$BUILD_FP" != x; then
103  build_fp=yes
104fi
105AM_CONDITIONAL(BUILD_FP, test x$build_fp = xyes)
106
107#####################
108# FILTER SQP SOLVER #
109#####################
110
111filtersqpobjdir=../ThirdParty/FilterSQP
112filtersqpsrcdir=$srcdir/$filtersqpobjdir
113
114AC_MSG_NOTICE([Checking for Filter SQP library])
115
116AC_ARG_WITH([filtersqp],
117            AC_HELP_STRING([--with-filtersqp],
118                           [specify library for FilterSQP (or BUILD for compilation)]),
119            [use_filtersqp=$withval], [use_filtersqp=detect])
120
121if test "$use_filtersqp" = BUILD || test "$use_filtersqp" = detect; then
122# Check which files are available
123  AC_COIN_CHECK_FILE([$filtersqpsrcdir/source/src/filter.f],
124                     [AC_DEFINE(COIN_HAS_FILTERSQP,1,
125                                [Define to 1 if FilterSQP is available])
126                      use_filtersqp=BUILD],
127                     [if test "$use_filtersqp" = BUILD; then
128                       AC_MSG_ERROR([Filter SQP files are not available])
129                      fi])
130fi
131if test "$use_filtersqp" = detect; then
132  use_filtersqp=no
133fi
134
135if test "$use_filtersqp" = BUILD; then
136  FILTERSQPLIBADD=`cd $filtersqpobjdir; pwd`/libfiltersqp.la
137  coin_need_flibs=yes
138elif test "$use_filtersqp" != no; then
139  AC_MSG_CHECKING([whether user supplied FILTERSQPLIB=\"$use_filtersqp\" works])
140  SAVE_LIBS="$LIBS"
141  LIBS="$use_filtersqp $LIBS $FLIBS"
142  ADDLIBS="$use_filtersqp $ADDLIBS"
143  AC_LANG_PUSH([Fortran 77])
144  AC_TRY_LINK([],
145[      call filterSQP
146      end
147      subroutine confun
148      end
149      subroutine objfun
150      end
151      subroutine gradient
152      end
153      subroutine hessian],
154              [AC_MSG_RESULT([yes])],
155              [AC_MSG_RESULT([no])
156               AC_MSG_ERROR([user supplied FilterSQP library \"$use_filtersqp\" does not work])])
157  AC_LANG_POP([Fortran 77])
158  LIBS="$SAVE_LIBS"
159fi
160
161AM_CONDITIONAL([COIN_HAS_FILTERSQP], [test "$use_filtersqp" != no])
162AC_SUBST(FILTERSQPLIBADD)
163
164##########
165# ASTYLE #
166##########
167ASTYLE=astyle
168AC_SUBST(ASTYLE)
169ASTYLEFLAGS="--mode=c --indent=spaces=2 --indent-cases --indent-namespaces --min-conditional-indent=1 --brackets=linux --brackets=break-closing-headers --max-instatement-indent=2"
170AC_SUBST(ASTYLEFLAGS)   
171
172#############################################################################
173#                            Stuff for Examples                             #
174#############################################################################
175
176AC_COIN_VPATH_LINK(test/bonmin.opt)
177AC_COIN_VPATH_LINK(test/mytoy.nl)
178AC_CONFIG_LINKS([test/MyBonmin.cpp:examples/CppExample/MyBonmin.cpp
179                 test/MyTMINLP.cpp:examples/CppExample/MyTMINLP.cpp
180                 test/MyTMINLP.hpp:examples/CppExample/MyTMINLP.hpp])
181
182##############################################################################
183#                   Finishing up by writing all the output                   #
184##############################################################################
185
186AC_CONFIG_FILES([Makefile
187                 src/Apps/Makefile
188                 experimental/Bcp/Makefile
189                 src/CbcBonmin/Makefile
190                 src/Interfaces/Makefile
191                 src/Interfaces/Ipopt/Makefile
192                 src/Interfaces/Filter/Makefile
193                 src/Interfaces/Ampl/Makefile
194                 src/Algorithms/Makefile
195                 src/Algorithms/Ampl/Makefile
196                 src/Algorithms/Branching/Makefile
197                 src/Algorithms/OaGenerators/Makefile
198                 experimental/FP/Makefile
199                 experimental/NotConvex/Makefile
200                 examples/OptionDocGen/Makefile
201                 test/Makefile
202                 examples/CppExample/Makefile])
203
204AC_CONFIG_HEADER([inc/config_bonmin.h])
205
206AC_COIN_FINALIZE
Note: See TracBrowser for help on using the repository browser.