source: ThirdParty/HSL/trunk/configure.ac @ 2120

Last change on this file since 2120 was 2120, checked in by stefan, 11 years ago

no need for config_hsl.h; rerun autotools

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.2 KB
Line 
1# Copyright (C) 2006, 2009 International Business Machines.
2# All Rights Reserved.
3# This file is distributed under the Eclipse Public License.
4
5## $Id: configure.ac 2120 2011-03-12 20:12:24Z 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([ThirdPartyHSL],[trunk],[http://projects.coin-or.org/BuildTools/newticket])
16
17AC_COPYRIGHT([
18Copyright 2006, 2009 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
25# Here we don't know yet which files are actually provided...
26AC_CONFIG_SRCDIR(configure.ac)
27
28# Where should everything be installed by default?  Here, we want it
29# to be installed directly in 'bin', 'lib', 'include' subdirectories
30# of the directory where configure is run.  The default would be
31# /usr/local.
32AC_PREFIX_DEFAULT([`pwd`])
33
34AC_COIN_PROJECTDIR_INIT(HSL)
35
36#############################################################################
37#                         Standard build tool stuff                         #
38#############################################################################
39
40# Get the system type
41AC_CANONICAL_BUILD
42
43# turn off warnings and pedantic mode since they could make trouble on some platforms,
44# and we couldn't fix them anyway
45coin_skip_warn_fflags=yes
46
47# provide flag to allow compilation of a stand-alone shared library
48AC_ARG_ENABLE([loadable-library],
49[AC_HELP_STRING([--enable-loadable-library],
50                [compile stand-alone shared library for delayed loading])])
51
52# Check if user wants to produce debugging code
53AC_COIN_DEBUG_COMPILE(HSL)
54
55# Get the name of the C compiler (for a dummy program)
56AC_COIN_PROG_CC
57
58# Get the name of the Fortran compiler and appropriate compiler options
59AC_COIN_PROG_F77
60
61# Check if pkg-config is available (to setup addlibs file)
62AC_COIN_HAS_PKGCONFIG
63
64# Get the linker flags (FLIBS) that are required for linking against this blas library
65AC_COIN_F77_WRAPPERS
66
67# Add FLIBS to HSL_PCLIBS, so that they get into the .pc files
68HSL_PCLIBS="$HSL_PCLIBS $FLIBS"
69
70# Need egrep later on
71AC_PROG_EGREP
72
73# Also set up the FC compiler variable, required to compile .f90
74# files.  We use the same compile and flags as F77 and FFLAGS, unless
75# the user has set FC and FCFLAGS explicitly.
76if test "$FC" = ""; then
77  FC="$F77"
78fi
79if test "$FCFLAGS" = ""; then
80  FCFLAGS="$FFLAGS"
81fi
82AC_PROG_FC
83
84# Initialize autotools
85
86if test x$enable_loadable_library = xyes; then
87  flag=force_shared
88fi
89AC_COIN_INIT_AUTO_TOOLS([$flag])
90
91#############################################################################
92#                    Find out which files are available                     #
93#############################################################################
94
95AC_MSG_CHECKING([whether we can compile Fortran 90 code])
96AC_LANG_PUSH(Fortran 77)
97AC_COMPILE_IFELSE([        MODULE BLA
98      DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: BLUBB
99      END MODULE BLA],[have_f90=yes ; rm -f bla.mod],[have_f90=no])
100AC_MSG_RESULT([$have_f90])
101AC_LANG_POP(Fortran 77)
102
103AC_DEFUN([MY_CHECK_HSLFILE],
104[AC_COIN_CHECK_FILE([$srcdir/$1.f],
105                    [hsl_files="$hsl_files $1.f"
106                     coin_has_$1=yes],
107                    [coin_has_$1=no])
108AM_CONDITIONAL([COIN_HAS_$2],[test $coin_has_$1 = yes])])
109
110AC_DEFUN([MY_CHECK_HSLFILE_F90],
111[if test $have_f90 = yes; then
112   AC_COIN_CHECK_FILE([$srcdir/$1.f90],
113                      [hsl_files="$hsl_files $1.f"
114                       coin_has_$1=yes],
115                      [coin_has_$1=no])
116else
117  coin_has_$1=no
118fi
119AM_CONDITIONAL([COIN_HAS_$2],[test $coin_has_$1 = yes])])
120
121MY_CHECK_HSLFILE(ma27ad,MA27)
122if test $coin_has_ma27ad = yes; then
123  AC_MSG_CHECKING([whether MA27 is threadsafe])
124  if $EGREP MA27UD $srcdir/ma27ad.f >/dev/null 2>&1; then
125    AC_MSG_RESULT(yes)
126  else
127    AC_MSG_RESULT(no)
128    AC_MSG_ERROR([Please obtain the threadsafe (newer) version of MA27])
129  fi
130fi
131MY_CHECK_HSLFILE(mc19ad,MC19)
132MY_CHECK_HSLFILE(ma57ad,MA57)
133MY_CHECK_HSLFILE(ma28ad,MA28)
134MY_CHECK_HSLFILE_F90(hsl_ma77d,MA77)
135
136HAVE_MXXX_CFLAGS=
137if test $coin_has_ma27ad = yes; then
138  HAVE_MXXX_CFLAGS="-DHAVE_MA27 $HAVE_MXXX_CFLAGS"
139fi
140if test $coin_has_mc19ad = yes; then
141  HAVE_MXXX_CFLAGS="-DHAVE_MC19 $HAVE_MXXX_CFLAGS"
142fi
143if test $coin_has_ma57ad = yes; then
144  HAVE_MXXX_CFLAGS="-DHAVE_MA57 $HAVE_MXXX_CFLAGS"
145  AC_COIN_CHECK_PACKAGE(Metis, [coinmetis], HSL)
146  if test $coin_has_metis != yes ; then
147    AC_MSG_ERROR([MA57 requires METIS, which is not found.])
148  fi
149else
150  AM_CONDITIONAL(COIN_HAS_METIS, [test 0 = 1])
151fi
152if test $coin_has_ma28ad = yes; then
153  HAVE_MXXX_CFLAGS="-DHAVE_MA28 $HAVE_MXXX_CFLAGS"
154fi
155if test $coin_has_hsl_ma77d = yes; then
156  HAVE_MXXX_CFLAGS="-DHAVE_MA77 $HAVE_MXXX_CFLAGS"
157fi
158AC_SUBST(HAVE_MXXX_CFLAGS)
159
160if test x$enable_loadable_library = xyes; then
161  case $build in
162    *-cygwin* | *-mingw*)
163      HSL_SHARED_LIB=libhsl.dll
164      F77_SHARED_CMD='$(F77) -shared $(FFLAGS)'
165      case $F77 in
166        compile_f2c*)
167          EXPORT_SYMBOLS=
168          if test $coin_has_ma27ad = yes; then
169            EXPORT_SYMBOLS="$EXPORT_SYMBOLS ma27id_ ma27ad_ ma27bd_ ma27cd_"
170          fi
171          if test $coin_has_ma28ad = yes; then
172            EXPORT_SYMBOLS="$EXPORT_SYMBOLS ma28ad_"
173          fi
174          if test $coin_has_ma57ad = yes; then
175            EXPORT_SYMBOLS="$EXPORT_SYMBOLS ma57id_ ma57ad_ ma57bd_ ma57cd_ ma57ed_"
176          fi
177          if test $coin_has_mc19ad = yes; then
178            EXPORT_SYMBOLS="$EXPORT_SYMBOLS mc19ad_"
179          fi
180          F77_SHARED_CMD='$(F77) -shared $(FFLAGS) -def:$(DEFFILE)'
181          DEFFILE='Export.def'
182          ;;
183        ifort* | IFORT*)
184          EXPORT_SYMBOLS=
185          if test $coin_has_ma27ad = yes; then
186            EXPORT_SYMBOLS="$EXPORT_SYMBOLS MA27ID MA27AD MA27BD MA27CD"
187          fi
188          if test $coin_has_ma28ad = yes; then
189            EXPORT_SYMBOLS="$EXPORT_SYMBOLS MA28AD"
190          fi
191          if test $coin_has_ma57ad = yes; then
192            EXPORT_SYMBOLS="$EXPORT_SYMBOLS MA57ID MA57AD MA57BD MA57CD MA57ED"
193          fi
194          if test $coin_has_mc19ad = yes; then
195            EXPORT_SYMBOLS="$EXPORT_SYMBOLS MC19AD"
196          fi
197          DEFFILE='Export.def'
198          F77_SHARED_CMD='$(F77) $(FFLAGS)'
199          F77_DLL_LINKFLAGS='-link -dll -def:$(DEFFILE)'
200          ;;
201        *)
202          F77_SHARED_CMD='$(F77) -shared $(FFLAGS)'
203          ;;
204      esac
205      ;;
206  esac
207fi
208AC_SUBST(F77_SHARED_CMD)
209AC_SUBST(F77_DLL_LINKFLAGS)
210AC_SUBST(HSL_SHARED_LIB)
211AC_SUBST(EXPORT_SYMBOLS)
212AC_SUBST(DEFFILE)
213AM_CONDITIONAL([INSTALL_LOADABLE_LIBRARY],[test x$flag = xforce_shared])
214AM_CONDITIONAL([NEED_DEFFILE], [test ! x"$DEFFILE" = x])
215
216AM_CONDITIONAL([EXTRA_SHARED_COMMAND],[test ! x"$F77_SHARED_CMD" = x])
217#AM_CONDITIONAL([EXTRA_SHARED_COMMAND],[test "$F77_SHARED_CMD" = x])
218
219#############################################################################
220#                              Write the output                             #
221#############################################################################
222
223AC_CONFIG_FILES([Makefile coinhsl.pc coinhsl-uninstalled.pc])
224
225AC_COIN_FINALIZE
Note: See TracBrowser for help on using the repository browser.