source: branches/autotools-update/Clp/configure.ac @ 2347

Last change on this file since 2347 was 2347, checked in by stefan, 6 months ago

add a CLP_HAS_MUMPS define and export it in config_clp.h, too

  • Property svn:keywords set to Id
File size: 7.3 KB
Line 
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 2347 2018-10-15 22:50:01Z stefan $
6
7# Author:  Andreas Waechter            IBM    2006-04-13
8
9#############################################################################
10#                       Names and other basic things                        #
11#############################################################################
12
13AC_INIT([Clp],[trunk],[clp@list.coin-or.org],[coin-or-clp],
14        [https://projects.coin-or.org/Clp])
15
16AC_COPYRIGHT([
17Copyright 2006 International Business Machines and others.
18All Rights Reserved.
19This file is part of the open source package Clp which is distributed
20under the Eclipse Public License.])
21
22# List one file in the package so that the configure script can test
23# whether the package is actually there.
24
25AC_CONFIG_SRCDIR(src/ClpSimplex.cpp)
26
27# Do some initialization work (version numbers, change prefix default, ...)
28
29AC_COIN_INITIALIZE(Clp)
30
31#############################################################################
32#                         Standard build tool stuff                         #
33#############################################################################
34
35# Get the name of the C++ compiler and appropriate compiler options.
36
37AC_COIN_PROG_CXX
38
39# This is a C++ package, set the language accordingly.
40
41AC_LANG_PUSH(C++)
42
43# Sort out what we need to do to link to Fortran libraries. Check if there's a
44# Fortran compiler and call the appropriate macro based on the result. If
45# there's no Fortran compiler, it's necessary to specify a library and
46# function to use when attempting a link. For Clp, libblas (-lblas) and
47# DAXPY are appropriate choices.
48# Yes, we should be able to leverage this and avoid the check for BLAS below,
49# but I haven't quite figured it out yet.
50
51AC_COIN_PROG_F77
52if test "$F77" != "unavailable" ; then
53  AC_COIN_F77_SETUP
54else
55  AC_COIN_F77_WRAPPERS(blas,DAXPY)
56fi
57
58# Initialize libtool
59
60AC_COIN_PROG_LIBTOOL
61
62#############################################################################
63#                   Math headers                                            #
64#############################################################################
65
66# Check for cmath/math.h, cfloat/float.h, cieeefp/ieeefp.h
67
68AC_COIN_CHECK_MATH_HDRS
69
70#############################################################################
71#                              COIN-OR components                           #
72#############################################################################
73
74# Initialise variables for ClpLib and OsiClpLib
75
76AC_COIN_INIT_LIBVARS([ClpLib],[-L\${libdir} -lClp],[-I\${includedir}])
77AC_COIN_INIT_LIBVARS([OsiClpLib],[-L\${libdir} -lOsiClp],[-I\${includedir}])
78
79AC_COIN_CHK_PKG(CoinUtils,[ClpLib])
80if test $coin_has_coinutils != yes ; then
81  AC_MSG_ERROR([Required package CoinUtils not available.])
82fi
83AC_COIN_CHK_PKG(Osi,[OsiClpLib])
84AC_COIN_CHK_PKG(OsiTests,[OsiClpUnitTest],[osi-unittests])
85AC_COIN_CHK_PKG(Sample,,[coindatasample],[],dataonly)
86AC_COIN_CHK_PKG(Netlib,,[coindatanetlib],[],dataonly)
87
88#############################################################################
89#                                    Aboca                                  #
90#############################################################################
91
92AC_CLP_ABOCA(1)
93
94#############################################################################
95#                        Third party linear solvers                         #
96#############################################################################
97
98# AMD and CHOLMOD from UFL. Glpk is an alternative source for amd. CHOLMOD
99# doc'n claims it requires METIS, but apparently that's not necessary for the
100# version distributed with Fedora.
101
102# amd.h
103AC_COIN_CHK_LIB(AMD,[ClpLib],[-lamd],[-I/usr/include/suitesparse],[],
104                [amd_defaults])
105
106# CHOLMOD from UFL
107# Requires AMD, but apparently not for a link check with dynamic libraries.
108# cholmod.h
109
110AC_COIN_CHK_LIB(CHOLMOD,[ClpLib],[-lcholmod],[-I/usr/include/suitesparse],[],
111                [cholmod_start])
112
113# Glpk also brings AMD
114
115if test $coin_has_cholmod = no -a $coin_has_amd = no ; then
116  AC_COIN_CHK_PKG(Glpk,[ClpLib],[coinglpk])
117  if test $coin_has_glpk = yes ; then
118    AC_MSG_NOTICE([using AMD from GLPK package])
119    AC_DEFINE(COIN_HAS_AMD,[1],[Define to 1 if the AMD package is available])
120  fi
121else
122  # for configure
123  AM_CONDITIONAL(COIN_HAS_GLPK, [test 0 = 1])
124fi
125
126# MUMPS
127AC_COIN_CHK_PKG(Mumps,[ClpLib],[coinmumps])
128if test $coin_has_mumps = yes ; then
129  AC_DEFINE(CLP_HAS_MUMPS, [1], [Define to 1 if MUMPS package is available])
130fi
131
132# WSMP (Watson Sparse Matrix Package from IBM T.J. Watson)
133
134AC_COIN_CHK_LIB(WSMP,[ClpLib],[],[],[],no)
135
136if test "$use_wsmp" = yes ; then
137  AC_COIN_CHK_BLAS(ClpLib)
138  use_wsmp=
139  AC_COIN_CHK_PKG_FLINK([use_wsmp],wssmp,[$wsmp_libs])
140  if test -n "$use_wsmp" ; then
141    wsmp_libs=$use_wsmp
142    AC_DEFINE_UNQUOTED([COIN_HAS_WSMP],[1],
143        [Define to 1 if the WSMP package is available])
144    CLPLIB_LIBS="$use_wsmp $CLPLIB_LIBS"
145  else
146    AC_MSG_WARN([WSMP failed to link with $wsmp_libs])
147  fi
148else
149  # to please configure
150  AM_CONDITIONAL(COIN_HAS_BLAS, [test 0 = 1])
151  :
152fi
153AM_CONDITIONAL(COIN_HAS_WSMP, [test "$use_wsmp" = yes])
154
155#############################################################################
156#                             Other dependencies                            #
157#############################################################################
158
159# AMPL solver library
160
161AC_COIN_CHK_PKG(ASL,[ClpLib],[coinasl])
162
163AC_COIN_CHK_GNU_READLINE([ClpLib])
164
165##############################################################################
166#                   VPATH links for example input files                      #
167##############################################################################
168
169# In case this is a VPATH configuration we need to make sure that the
170# input files for the examples are available in the VPATH directory.
171
172AC_COIN_EXAMPLE_FILES([examples/hello.mps examples/input.130])
173AC_COIN_EXAMPLE_FILES([examples/g.tiny examples/gparm.tiny])
174
175#############################################################################
176#                  Check for doxygen                                        #
177#############################################################################
178
179AC_COIN_DOXYGEN([CoinUtils Osi])
180
181##############################################################################
182#                   Finishing up by writing all the output                   #
183##############################################################################
184
185# Temporary hacks to shut down these two. This needs to be fixed.
186
187AM_CONDITIONAL(COIN_CXX_IS_CL,[test 0 = 1])
188
189# Finalize libs and cflags.
190AC_COIN_FINALIZE_FLAGS([ClpLib OsiClpLib OsiClpUnitTest])
191AC_COIN_CHK_HERE([ClpLib],[OsiClpLib],[clp])
192
193# Here list all the files that configure should create (except for the
194# configuration header file)
195AC_CONFIG_FILES([Makefile
196                 examples/Makefile
197                 src/Makefile
198                 src/OsiClp/Makefile
199                 test/Makefile
200                 clp.pc])
201
202if test $coin_has_osi = yes ; then
203  AC_CONFIG_FILES([osi-clp.pc:src/OsiClp/osi-clp.pc.in])
204fi
205
206AC_CONFIG_FILES([doxydoc/doxygen.conf])
207
208# Here put the location and name of the configuration header file
209AC_CONFIG_HEADER([src/config.h src/config_clp.h])
210
211# Finally, we let configure write all the output...
212AC_COIN_FINALIZE
213
Note: See TracBrowser for help on using the repository browser.