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

Last change on this file since 2364 was 2364, checked in by lou, 6 months ago

Remove COIN_INIT_LIBVARS.

  • Property svn:keywords set to Id
File size: 7.6 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 2364 2018-11-03 00:50:27Z lou $
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
74AC_COIN_CHK_PKG(CoinUtils,[ClpLib])
75if test $coin_has_coinutils != yes ; then
76  AC_MSG_ERROR([Required package CoinUtils not available.])
77fi
78AC_COIN_CHK_PKG(Osi,[OsiClpLib])
79AC_COIN_CHK_PKG(OsiTests,[OsiClpUnitTest],[osi-unittests])
80AC_COIN_CHK_PKG(Sample,,[coindatasample],[],dataonly)
81AC_COIN_CHK_PKG(Netlib,,[coindatanetlib],[],dataonly)
82
83#############################################################################
84#                                    Aboca                                  #
85#############################################################################
86
87AC_CLP_ABOCA(1)
88
89#############################################################################
90#                        Third party linear solvers                         #
91#############################################################################
92
93# AMD and CHOLMOD from UFL. Glpk is an alternative source for amd. CHOLMOD
94# doc'n claims it requires METIS, but apparently that's not necessary for the
95# version distributed with Fedora.
96
97# amd.h
98AC_COIN_CHK_LIB(AMD,[ClpLib],[-lamd],[-I/usr/include/suitesparse],[],
99                [amd_defaults])
100
101# CHOLMOD from UFL
102# Requires AMD, but apparently not for a link check with dynamic libraries.
103# cholmod.h
104
105AC_COIN_CHK_LIB(CHOLMOD,[ClpLib],[-lcholmod],[-I/usr/include/suitesparse],[],
106                [cholmod_start])
107
108# ThirdParty/Glpk also brings AMD and will install amd.h. Note that a standard
109# package for glpk does not install amd.h.
110
111if test $coin_has_cholmod = no -a $coin_has_amd = no ; then
112  AC_COIN_CHK_PKG(Glpk,[ClpLib],[coinglpk])
113  if test $coin_has_glpk = yes ; then
114    AC_MSG_NOTICE([using AMD from ThirdParty/GLPK package])
115    AC_DEFINE(COIN_HAS_AMD,[1],[Define to 1 if the AMD package is available])
116  fi
117else
118  # for configure
119  AM_CONDITIONAL(COIN_HAS_GLPK, [test 0 = 1])
120fi
121
122# MUMPS. Check first for ThirdParty/MUMPS, on the assumption that if the user
123# bothered to build it, we should use it. If it's not present, try for a
124# system installation. If we find it, define CLP_HAS_MUMPS for export to code
125# using clp.
126
127AC_COIN_CHK_PKG(MUMPS,[ClpLib],[coinmumps])
128if test $coin_has_mumps = no ; then
129  AC_COIN_CHK_LIB(MUMPS,[ClpLib],[-ldmumps],[-I/usr/include/MUMPS],[],
130                  [dmumps_c])
131fi
132if test $coin_has_mumps = yes ; then
133  AC_DEFINE(CLP_HAS_MUMPS,[1],
134            [Define to 1 if the MUMPS package is available.])
135fi
136
137# WSMP (Watson Sparse Matrix Package from IBM T.J. Watson)
138
139AC_COIN_CHK_LIB(WSMP,[ClpLib],[],[],[],no)
140
141if test "$use_wsmp" = yes ; then
142  AC_COIN_CHK_BLAS(ClpLib)
143  use_wsmp=
144  AC_COIN_CHK_PKG_FLINK([use_wsmp],wssmp,[$wsmp_libs])
145  if test -n "$use_wsmp" ; then
146    wsmp_libs=$use_wsmp
147    AC_DEFINE_UNQUOTED([COIN_HAS_WSMP],[1],
148        [Define to 1 if the WSMP package is available])
149    CLPLIB_LIBS="$use_wsmp $CLPLIB_LIBS"
150  else
151    AC_MSG_WARN([WSMP failed to link with $wsmp_libs])
152  fi
153else
154  # to please configure
155  AM_CONDITIONAL(COIN_HAS_BLAS, [test 0 = 1])
156  :
157fi
158AM_CONDITIONAL(COIN_HAS_WSMP, [test "$use_wsmp" = yes])
159
160#############################################################################
161#                             Other dependencies                            #
162#############################################################################
163
164# AMPL solver library
165
166AC_COIN_CHK_PKG(ASL,[ClpLib],[coinasl])
167
168AC_COIN_CHK_GNU_READLINE([ClpLib])
169
170##############################################################################
171#                   VPATH links for example input files                      #
172##############################################################################
173
174# In case this is a VPATH configuration we need to make sure that the
175# input files for the examples are available in the VPATH directory.
176
177AC_COIN_EXAMPLE_FILES([examples/hello.mps examples/input.130])
178AC_COIN_EXAMPLE_FILES([examples/g.tiny examples/gparm.tiny])
179
180#############################################################################
181#                  Check for doxygen                                        #
182#############################################################################
183
184AC_COIN_DOXYGEN([CoinUtils Osi])
185
186##############################################################################
187#                   Finishing up by writing all the output                   #
188##############################################################################
189
190# Temporary hacks to shut down these two. This needs to be fixed.
191
192AM_CONDITIONAL(COIN_CXX_IS_CL,[test 0 = 1])
193
194# Finalize libs and cflags.
195AC_COIN_FINALIZE_FLAGS([ClpLib OsiClpLib OsiClpUnitTest])
196AC_COIN_CHK_HERE([ClpLib],[OsiClpLib],[clp])
197
198# Here list all the files that configure should create (except for the
199# configuration header file)
200AC_CONFIG_FILES([Makefile
201                 examples/Makefile
202                 src/Makefile
203                 src/OsiClp/Makefile
204                 test/Makefile
205                 clp.pc])
206
207if test $coin_has_osi = yes ; then
208  AC_CONFIG_FILES([osi-clp.pc:src/OsiClp/osi-clp.pc.in])
209fi
210
211AC_CONFIG_FILES([doxydoc/doxygen.conf])
212
213# Here put the location and name of the configuration header file
214AC_CONFIG_HEADER([src/config.h src/config_clp.h])
215
216# Finally, we let configure write all the output...
217AC_COIN_FINALIZE
218
Note: See TracBrowser for help on using the repository browser.