source: ThirdParty/Mumps/trunk/configure.ac

Last change on this file was 4190, checked in by stefan, 10 months ago

fix check for metis.h

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.7 KB
Line 
1# Copyright (C) 2007-2009 International Business Machines.
2# All Rights Reserved.
3# This file is distributed under the Eclipse Public License.
4
5# Author:  Andreas Waechter            IBM    2006-04-13
6
7#############################################################################
8#                       Names and other basic things                        #
9#############################################################################
10
11AC_PREREQ(2.59)
12
13AC_INIT([ThirdPartyMumps],[trunk],[https://github.com/coin-or-tools/ThirdParty-Mumps/issues/new],,[https://github.com/coin-or-tools/ThirdParty-Mumps])
14
15AC_COPYRIGHT([
16Copyright 2007-2009 International Business Machines and others.
17All Rights Reserved.
18This file is part of the open source package Coin which is distributed
19under the Eclipse Public License.])
20
21# List one file in the package so that the configure script can test
22# whether the package is actually there
23AC_CONFIG_SRCDIR(MUMPS/src/dmumps_part1.F)
24
25AC_COIN_INITIALIZE
26
27#############################################################################
28#                         Standard build tool stuff                         #
29#############################################################################
30
31# Get the name of the C compiler and appropriate compiler options
32AC_COIN_PROG_CC
33
34# Get the name of the Fortran compiler and appropriate compiler options
35AC_COIN_PROG_FC
36
37# Initialize libtool
38AC_COIN_PROG_LIBTOOL
39
40# Add FLIBS to MUMPS_LFLAGS, so that they get into the .pc files section for static builds
41MUMPS_LFLAGS="$MUMPS_LFLAGS $FLIBS"
42
43# Figure out name mangling that Fortran objects will have and translate
44# them to what MUMPS wants
45AC_FC_WRAPPERS
46case "$ac_cv_fc_mangling" in
47  "lower case, no underscore, no extra underscore" ) ;;
48  "lower case, underscore, no extra underscore" )    MY_DEFS="-DAdd_" ;;
49  "lower case, no underscore, extra underscore" )    MY_DEFS="-DAdd_" ;;
50  "lower case, underscore, extra underscore" )       MY_DEFS="-DAdd__" ;;
51  "upper case, no underscore, no extra underscore" ) MY_DEFS="-DUPPER" ;;
52  "upper case, no underscore, extra underscore" )    MY_DEFS="-DUPPER" ;;
53  "upper case, underscore, no extra underscore" )    MY_DEFS="-DUPPER" ;;
54  "upper case, underscore, extra underscore" )       MY_DEFS="-DUPPER" ;;
55esac
56
57# Mumps can make use of pthreads
58# check for pthread.h header file and library
59AC_ARG_ENABLE([pthread-mumps],
60  [AC_HELP_STRING([--disable-pthread-mumps],[disable use of pthread library])],
61  [enable_pthread_mumps=$enableval],
62  [enable_pthread_mumps=yes])
63if test $enable_pthread_mumps = yes ; then
64  AC_CHECK_HEADER([pthread.h],[],[enable_pthread_mumps=no])
65fi
66if test $enable_pthread_mumps = yes ; then
67  AC_CHECK_LIB([pthread],[pthread_create],
68    [MUMPS_LFLAGS="$MUMPS_LFLAGS -lpthread"],
69    [enable_pthread_mumps=no])
70fi
71if test $enable_pthread_mumps = no ; then
72  MY_DEFS="$MY_DEFS -DWITHOUT_PTHREAD=1"
73fi
74
75MY_DEFS="$MY_DEFS -DALLOW_NON_INIT -DMUMPS_ARITH=MUMPS_ARITH_d"
76AC_SUBST(MY_DEFS)
77
78AC_COIN_CHK_LAPACK(MUMPS)
79if test $coin_has_lapack != yes; then
80  AC_MSG_ERROR([Required package LAPACK not found.])
81fi
82
83AC_COIN_CHK_LIBM(METISCHECK)
84AC_LANG_PUSH(Fortran)
85AC_COIN_CHK_LIB(Metis,[MUMPS],[-lmetis "$METISCHECK_LFLAGS"],[],[],[metis_nodend])
86AC_LANG_POP(Fortran)
87
88if test $coin_has_metis = yes ; then
89  AC_LANG_PUSH(C)
90  coin_CPPFLAGS="$CPPFLAGS"
91  CPPFLAGS="$CPPFLAGS $metis_cflags"
92  AC_CHECK_HEADER([metis.h],,[coin_has_metis=no])
93  CPPFLAGS="$coin_CPPFLAGS"
94  AC_LANG_POP(C)
95fi
96
97# check whether we can redefine metis_nodend to coinmetis_nodend from metis_adapter
98if test $coin_has_metis = yes ; then
99  AC_FC_PP_DEFINE([],[coin_has_metis=no])
100fi
101AM_CONDITIONAL(COIN_HAS_METIS, [test $coin_has_metis = yes])
102
103if test "$coin_has_metis" = yes; then
104  MY_DEFS="$MY_DEFS -Dmetis"
105  MY_FDEFS="$MY_FDEFS -Dmetis"
106fi
107
108# Fix Fortran preprocessor flags
109case $FC in
110  *xlf*)
111    fdefs=
112    if test -n "$MY_FDEFS"; then
113      for flag in $MY_FDEFS; do
114        fdefs="$fdefs -WF,$flag"
115      done
116    fi
117    MY_FDEFS="$fdefs"
118    ;;
119esac
120AC_SUBST(MY_FDEFS)
121
122AC_COIN_FINALIZE_FLAGS([MUMPS])
123
124# if libexport_attribute is set by COIN_FINALIZE_FLAGS to __declspec(dllimport)
125# then we want to use MUMPS_CALL=__declspec(dllexport) when building Mumps
126# and users should use __declspec(dllimport), but the parenthesis are difficult
127# to pass on via compiler flags
128# so also create and install our own version of mumps_compat.h instead
129if test "$libexport_attribute" = "__declspec(dllimport)" ; then
130  MY_DEFS="$MY_DEFS -DMUMPS_CALL=\"__declspec(dllexport)\""
131fi
132AC_DEFINE_UNQUOTED(MUMPS_CALL, [$libexport_attribute], [Library Visibility Attribute])
133
134AC_MSG_NOTICE([additional C preprocessor flags: $MY_DEFS])
135AC_MSG_NOTICE([additional Fortran preprocessor flags: $MY_FDEFS])
136
137AC_CONFIG_FILES([Makefile coinmumps.pc])
138AC_CONFIG_HEADER(config.h mumps_compat.h)
139
140AC_COIN_FINALIZE
Note: See TracBrowser for help on using the repository browser.