source: trunk/Clp/configure.ac @ 1693

Last change on this file since 1693 was 1693, checked in by stefan, 9 years ago

make WSMP recoginition and use similar to Ipopt's WSMP interface

  • Property svn:keywords set to Id
File size: 6.4 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 1693 2011-03-05 18:55:36Z stefan $
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([Clp],[trunk],[clp@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 Coin which is distributed
21under 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
25AC_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.
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(Clp)
45
46# Check if user wants to produce debugging code
47AC_COIN_DEBUG_COMPILE(Clp)
48
49# Get the name of the C++ compiler and appropriate compiler options
50AC_COIN_PROG_CXX
51
52# Initialize automake and libtool
53AC_COIN_INIT_AUTO_TOOLS
54
55#############################################################################
56#                              COIN-OR components                           #
57#############################################################################
58
59AC_COIN_CHECK_PACKAGE(CoinUtils, [coinutils], [ClpLib])
60if test $coin_has_coinutils != yes ; then
61  AC_MSG_ERROR([Required package CoinUtils not available.])
62fi
63AC_COIN_CHECK_PACKAGE(Osi,       [osi],       [OsiClpLib])
64AC_COIN_CHECK_PACKAGE(OsiTests,  [osi-unittests])
65AC_COIN_CHECK_PACKAGE(Sample,    [coindatasample])
66AC_COIN_CHECK_PACKAGE(Netlib,    [coindatanetlib])
67
68#############################################################################
69#                        Third party linear solvers                         #
70#############################################################################
71
72# AMD from UFL
73AC_COIN_CHECK_USER_LIBRARY(AMD, AMD, [amd.h], [amd_defaults],,[ClpLib])
74
75# CHOLMOD from UFL
76# CHOLMOD requires AMD, which can be given by AMD_LIBS
77# CHOLMOD requires Blas and Lapack, which should be in COINUTILS_LIBS, if available
78coin_save_LIBS="$LIBS"
79LIBS="$LIBS $AMD_LIBS $COINUTILS_LIBS"
80AC_COIN_CHECK_USER_LIBRARY(CHOLMOD, CHOLMOD, [cholmod.h], [cholmod_start],,[ClpLib])
81LIBS="$coin_save_LIBS"
82
83# Glpk also brings AMD
84if test $coin_has_cholmod = false -a $coin_has_amd = false ; then
85  AC_COIN_CHECK_PACKAGE(Glpk, [coinglpk >= 4.39], [ClpLib])
86  if test $coin_has_glpk = yes ; then
87    AC_MSG_NOTICE([using AMD from GLPK package])
88    AC_DEFINE(COIN_HAS_AMD,[1],[Define to 1 if the AMD package is available])
89  fi
90else
91  # for configure
92  AM_CONDITIONAL(COIN_HAS_GLPK, [test 0 = 1])
93fi
94
95# MUMPS
96AC_COIN_CHECK_PACKAGE(Mumps, [coinmumps], [ClpLib])
97
98# WSMP
99AC_ARG_WITH([wsmp],
100            AC_HELP_STRING([--with-wsmp],
101                           [specify WSMP library]),
102            [use_wsmp=$withval], [use_wsmp=no])
103
104if test "$use_wsmp" != "no"; then
105  # Check how to link against Fortran libraries from C
106  AC_COIN_F77_WRAPPERS
107
108  coin_save_LIBS="$LIBS"
109  # WSMP requires Blas, so provide CoinUtils libs, which may include Blas
110  LIBS="$LIBS $use_wsmp $COINUTILS_LIBS"
111  AC_LANG_PUSH([Fortran 77])
112  AC_MSG_CHECKING([whether user-supplied WSMP library \"$use_wsmp\" works])
113  AC_TRY_LINK([],[      call WSSMP()],
114              [AC_MSG_RESULT(yes)],   
115              [AC_MSG_ERROR([WSMP library $use_wsmp does not seem to work])])
116  AC_LANG_POP([Fortran 77])
117  LIBS="$coin_save_LIBS"
118
119  AC_DEFINE_UNQUOTED([COIN_HAS_WSMP], [1], [Define to 1 if the WSMP package is available])
120 
121  CLPLIB_LIBS="$use_wsmp $CLPLIB_LIBS"
122  CLPLIB_LIBS_INSTALLED="$use_wsmp $CLPLIB_LIBS_INSTALLED"
123  CLPLIB_PCLIBS="$use_wsmp $CLPLIB_PCLIBS"
124fi
125AM_CONDITIONAL(COIN_HAS_WSMP, [test "$use_wsmp" != no])
126
127#############################################################################
128#                             Other dependencies                            #
129#############################################################################
130
131AC_COIN_CHECK_GNU_READLINE(ClpLib)
132
133##############################################################################
134#                   VPATH links for example input files                      #
135##############################################################################
136
137# In case this is a VPATH configuration we need to make sure that the
138# input files for the examples are available in the VPATH directory.
139
140AC_COIN_VPATH_LINK(examples/hello.mps)
141AC_COIN_VPATH_LINK(examples/input.130)
142
143#############################################################################
144#                  Check for doxygen                                        #
145#############################################################################
146
147AC_COIN_DOXYGEN(CoinUtils Osi)
148
149##############################################################################
150#                   Finishing up by writing all the output                   #
151##############################################################################
152
153# Here list all the files that configure should create (except for the
154# configuration header file)
155AC_CONFIG_FILES([Makefile
156                 examples/Makefile
157                 src/Makefile
158                 src/OsiClp/Makefile
159                 test/Makefile
160                 clp.pc
161                 clp-uninstalled.pc])
162                 
163if test $coin_has_osi = yes ; then
164  AC_CONFIG_FILES([osi-clp.pc:src/OsiClp/osi-clp.pc.in
165                   osi-clp-uninstalled.pc:src/OsiClp/osi-clp-uninstalled.pc.in])
166fi
167
168AC_CONFIG_FILES([doxydoc/doxygen.conf])
169
170# Here put the location and name of the configuration header file
171AC_CONFIG_HEADER([inc/config_clp.h])
172
173# Finally, we let configure write all the output...
174AC_COIN_FINALIZE
Note: See TracBrowser for help on using the repository browser.