1 | # Copyright (C) 2006 International Business Machines. |
---|
2 | # All Rights Reserved. |
---|
3 | # This file is distributed under the Eclipse Public License. |
---|
4 | |
---|
5 | ## $Id: configure.ac 1946 2013-04-18 13:39:00Z forrest $ |
---|
6 | |
---|
7 | # Author: Andreas Waechter IBM 2006-04-13 |
---|
8 | |
---|
9 | ############################################################################# |
---|
10 | # Names and other basic things # |
---|
11 | ############################################################################# |
---|
12 | |
---|
13 | AC_PREREQ(2.59) |
---|
14 | |
---|
15 | AC_INIT([Clp],[trunk],[clp@list.coin-or.org]) |
---|
16 | |
---|
17 | AC_COPYRIGHT([ |
---|
18 | Copyright 2006 International Business Machines and others. |
---|
19 | All Rights Reserved. |
---|
20 | This file is part of the open source package Coin which is distributed |
---|
21 | under the Eclipse Public License.]) |
---|
22 | |
---|
23 | # List one file in the package so that the configure script can test |
---|
24 | # whether the package is actually there |
---|
25 | AC_CONFIG_SRCDIR(src/ClpSimplex.cpp) |
---|
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. |
---|
31 | AC_PREFIX_DEFAULT([`pwd`]) |
---|
32 | |
---|
33 | ############################################################################# |
---|
34 | # Standard build tool stuff # |
---|
35 | ############################################################################# |
---|
36 | |
---|
37 | # Get the system type |
---|
38 | AC_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. |
---|
44 | AC_COIN_PROJECTDIR_INIT(Clp) |
---|
45 | |
---|
46 | # Check if user wants to produce debugging code |
---|
47 | AC_COIN_DEBUG_COMPILE(Clp) |
---|
48 | |
---|
49 | # Get the name of the C++ compiler and appropriate compiler options |
---|
50 | AC_COIN_PROG_CXX |
---|
51 | |
---|
52 | # Initialize automake and libtool |
---|
53 | AC_COIN_INIT_AUTO_TOOLS |
---|
54 | |
---|
55 | ############################################################################# |
---|
56 | # COIN-OR components # |
---|
57 | ############################################################################# |
---|
58 | |
---|
59 | AC_COIN_CHECK_PACKAGE(CoinUtils, [coinutils], [ClpLib]) |
---|
60 | if test $coin_has_coinutils != yes ; then |
---|
61 | AC_MSG_ERROR([Required package CoinUtils not available.]) |
---|
62 | fi |
---|
63 | AC_COIN_CHECK_PACKAGE(Osi, [osi], [OsiClpLib]) |
---|
64 | AC_COIN_CHECK_PACKAGE(OsiTests, [osi-unittests]) |
---|
65 | AC_COIN_CHECK_PACKAGE(Sample, [coindatasample]) |
---|
66 | AC_COIN_CHECK_PACKAGE(Netlib, [coindatanetlib]) |
---|
67 | |
---|
68 | ############################################################################# |
---|
69 | # Aboca # |
---|
70 | ############################################################################# |
---|
71 | |
---|
72 | # 1 - build Abc serial but no inherit code |
---|
73 | # 2 - build Abc serial and inherit code |
---|
74 | # 3 - build Abc cilk parallel but no inherit code |
---|
75 | # 4 - build Abc cilk parallel and inherit code |
---|
76 | AC_ARG_ENABLE([aboca], |
---|
77 | [AC_HELP_STRING([--enable-aboca],[enables build of Aboca solver (set to 1,2,3,4)])], |
---|
78 | [use_aboca=$enableval], |
---|
79 | [use_aboca=no]) |
---|
80 | if test "$use_aboca" = yes ; then |
---|
81 | use_aboca=1 |
---|
82 | fi |
---|
83 | case "$use_aboca" in |
---|
84 | 1 | 2 | 3 | 4) |
---|
85 | AC_DEFINE_UNQUOTED([CLP_HAS_ABC], [$use_aboca], [Define to 1, 2, 3, or 4 if Aboca should be build.]) |
---|
86 | ;; |
---|
87 | no) ;; |
---|
88 | *) |
---|
89 | AC_MSG_ERROR([invalid argument for --enable-aboca: $use_aboca]) |
---|
90 | ;; |
---|
91 | esac |
---|
92 | AM_CONDITIONAL(COIN_HAS_ABC, test ! "$use_aboca" = no) |
---|
93 | |
---|
94 | ############################################################################# |
---|
95 | # Third party linear solvers # |
---|
96 | ############################################################################# |
---|
97 | |
---|
98 | # AMD from UFL |
---|
99 | AC_COIN_CHECK_USER_LIBRARY(AMD, AMD, [amd.h], [amd_defaults],,[ClpLib]) |
---|
100 | |
---|
101 | # CHOLMOD from UFL |
---|
102 | # CHOLMOD requires AMD, which can be given by AMD_LIBS |
---|
103 | # CHOLMOD requires Blas and Lapack? |
---|
104 | coin_save_LIBS="$LIBS" |
---|
105 | LIBS="$LIBS $AMD_LIBS" |
---|
106 | AC_COIN_CHECK_USER_LIBRARY(CHOLMOD, CHOLMOD, [cholmod.h], [cholmod_start],,[ClpLib]) |
---|
107 | LIBS="$coin_save_LIBS" |
---|
108 | |
---|
109 | # Glpk also brings AMD |
---|
110 | if test $coin_has_cholmod = false -a $coin_has_amd = false ; then |
---|
111 | AC_COIN_CHECK_PACKAGE(Glpk, [coinglpk], [ClpLib]) |
---|
112 | if test $coin_has_glpk = yes ; then |
---|
113 | AC_MSG_NOTICE([using AMD from GLPK package]) |
---|
114 | AC_DEFINE(COIN_HAS_AMD,[1],[Define to 1 if the AMD package is available]) |
---|
115 | fi |
---|
116 | else |
---|
117 | # for configure |
---|
118 | AM_CONDITIONAL(COIN_HAS_GLPK, [test 0 = 1]) |
---|
119 | fi |
---|
120 | |
---|
121 | # MUMPS |
---|
122 | AC_COIN_CHECK_PACKAGE(Mumps, [coinmumps], [ClpLib]) |
---|
123 | |
---|
124 | # WSMP |
---|
125 | AC_ARG_WITH([wsmp], |
---|
126 | AC_HELP_STRING([--with-wsmp], |
---|
127 | [specify WSMP library]), |
---|
128 | [use_wsmp=$withval], [use_wsmp=no]) |
---|
129 | |
---|
130 | if test "$use_wsmp" != "no"; then |
---|
131 | # Check how to link against Fortran libraries from C |
---|
132 | AC_COIN_PROG_F77 |
---|
133 | AC_COIN_F77_WRAPPERS |
---|
134 | |
---|
135 | # WSMP requires Blas |
---|
136 | AC_COIN_CHECK_PACKAGE_BLAS(ClpLib) |
---|
137 | |
---|
138 | coin_save_LIBS="$LIBS" |
---|
139 | LIBS="$LIBS $use_wsmp $BLAS_LIBS" |
---|
140 | AC_LANG_PUSH([Fortran 77]) |
---|
141 | AC_MSG_CHECKING([whether user-supplied WSMP library \"$use_wsmp\" works]) |
---|
142 | AC_TRY_LINK([],[ call WSSMP()], |
---|
143 | [AC_MSG_RESULT(yes)], |
---|
144 | [AC_MSG_RESULT(no) |
---|
145 | AC_MSG_ERROR([WSMP library $use_wsmp does not seem to work])]) |
---|
146 | AC_LANG_POP([Fortran 77]) |
---|
147 | LIBS="$coin_save_LIBS" |
---|
148 | |
---|
149 | AC_DEFINE_UNQUOTED([COIN_HAS_WSMP], [1], [Define to 1 if the WSMP package is available]) |
---|
150 | |
---|
151 | CLPLIB_LIBS="$use_wsmp $CLPLIB_LIBS" |
---|
152 | CLPLIB_LIBS_INSTALLED="$use_wsmp $CLPLIB_LIBS_INSTALLED" |
---|
153 | CLPLIB_PCLIBS="$use_wsmp $CLPLIB_PCLIBS" |
---|
154 | else |
---|
155 | # to please configure |
---|
156 | AM_CONDITIONAL(COIN_HAS_BLAS, [test 0 = 1]) |
---|
157 | fi |
---|
158 | AM_CONDITIONAL(COIN_HAS_WSMP, [test "$use_wsmp" != no]) |
---|
159 | |
---|
160 | ############################################################################# |
---|
161 | # Other dependencies # |
---|
162 | ############################################################################# |
---|
163 | # Ampl Solver library |
---|
164 | AC_COIN_CHECK_PACKAGE(ASL, [coinasl], [ClpLib]) |
---|
165 | |
---|
166 | AC_COIN_CHECK_GNU_READLINE(ClpLib) |
---|
167 | |
---|
168 | AC_COIN_CHECK_CXX_CHEADER(math) |
---|
169 | AC_COIN_CHECK_CXX_CHEADER(float) |
---|
170 | AC_COIN_CHECK_CXX_CHEADER(ieeefp) |
---|
171 | |
---|
172 | ############################################################################## |
---|
173 | # VPATH links for example input files # |
---|
174 | ############################################################################## |
---|
175 | |
---|
176 | # In case this is a VPATH configuration we need to make sure that the |
---|
177 | # input files for the examples are available in the VPATH directory. |
---|
178 | |
---|
179 | AC_COIN_VPATH_LINK(examples/hello.mps) |
---|
180 | AC_COIN_VPATH_LINK(examples/input.130) |
---|
181 | AC_COIN_VPATH_LINK(examples/g.tiny) |
---|
182 | AC_COIN_VPATH_LINK(examples/gparm.tiny) |
---|
183 | |
---|
184 | ############################################################################# |
---|
185 | # Check for doxygen # |
---|
186 | ############################################################################# |
---|
187 | |
---|
188 | AC_COIN_DOXYGEN(CoinUtils Osi) |
---|
189 | |
---|
190 | ############################################################################## |
---|
191 | # Finishing up by writing all the output # |
---|
192 | ############################################################################## |
---|
193 | |
---|
194 | # Here list all the files that configure should create (except for the |
---|
195 | # configuration header file) |
---|
196 | AC_CONFIG_FILES([Makefile |
---|
197 | examples/Makefile |
---|
198 | src/Makefile |
---|
199 | src/OsiClp/Makefile |
---|
200 | test/Makefile |
---|
201 | clp.pc |
---|
202 | clp-uninstalled.pc]) |
---|
203 | |
---|
204 | if test $coin_has_osi = yes ; then |
---|
205 | AC_CONFIG_FILES([osi-clp.pc:src/OsiClp/osi-clp.pc.in |
---|
206 | osi-clp-uninstalled.pc:src/OsiClp/osi-clp-uninstalled.pc.in]) |
---|
207 | fi |
---|
208 | |
---|
209 | AC_CONFIG_FILES([doxydoc/doxygen.conf]) |
---|
210 | |
---|
211 | # Here put the location and name of the configuration header file |
---|
212 | AC_CONFIG_HEADER([src/config.h src/config_clp.h]) |
---|
213 | |
---|
214 | # Finally, we let configure write all the output... |
---|
215 | AC_COIN_FINALIZE |
---|