there was an #include directive missing
[openmpi-llc.git] / config / ompi_setup_f77.m4
blobf685f3f19cbe1a24bba465fa0f0d81177548ed21
1 dnl -*- shell-script -*-
2 dnl
3 dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
4 dnl                         University Research and Technology
5 dnl                         Corporation.  All rights reserved.
6 dnl Copyright (c) 2004-2005 The University of Tennessee and The University
7 dnl                         of Tennessee Research Foundation.  All rights
8 dnl                         reserved.
9 dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, 
10 dnl                         University of Stuttgart.  All rights reserved.
11 dnl Copyright (c) 2004-2005 The Regents of the University of California.
12 dnl                         All rights reserved.
13 dnl $COPYRIGHT$
14 dnl 
15 dnl Additional copyrights may follow
16 dnl 
17 dnl $HEADER$
18 dnl
19 dnl sets:
20 dnl  F77                   : full pathname to compiler
21 dnl  BASEF77               : compiler name (no path)
22 dnl  OMPI_WANT_F77_BINDINGS : (actually set by ompi_configure_options, may be
23 dnl                          redefined here)
24 dnl  FC                    : Same as F77.  Side effect of AC_PROG_FC.  Should
25 dnl                          not be used
26 dnl defines:
27 dnl  OMPI_F77               : same as F77
28 dnl  OMPI_WANT_F77_BINDINGS :
29 dnl am_conditional:
30 dnl  OMPI_WANT_F77_BINDINGS :
32 AC_DEFUN([OMPI_SETUP_F77],[
34 # Modularize this setup so that sub-configure.in scripts can use this
35 # same setup code.
37 ompi_show_subtitle "Fortran 77 compiler" 
40 # Check for the compiler
42 # Note that we don't actually *use* the fortran compiler to build
43 # anything in OMPI; it's only used here in configure to find out
44 # symbol conventions, type sizes, etc.  We also pass it down to
45 # the wrapper compiler mpif77.
47 # Always run this test, even if fortran isn't wanted so that F77 has
48 # value for the Fint tests
50 ompi_fflags_save="$FFLAGS"
51 AC_PROG_F77([gfortran g77 f77 xlf frt ifort pgf77 fort77 fl32 af77])
52 FFLAGS="$ompi_fflags_save"
53 if test -z "$F77"; then
54     AC_MSG_WARN([*** Fortran 77 bindings disabled (could not find compiler)])
55     OMPI_WANT_F77_BINDINGS=0
56     OMPI_F77="none"
57     BASEF77="none"
58     OMPI_F77_ABSOLUTE="none"
59 else
60     OMPI_F77="$F77"
61     BASEF77="`basename $OMPI_F77`"
62     OMPI_F77_ABSOLUTE="`which $F77`"
63     
64     if test "$OMPI_WANT_F77_BINDINGS" = "0" ; then
65         AC_MSG_WARN([*** Fortran 77 bindings disabled by user])
66         OMPI_WANT_F77_BINDINGS=0
67     else
68         OMPI_WANT_F77_BINDINGS=1
69     fi
72 # make sure the compiler actually works, if not cross-compiling
73 # Don't just use the AC macro so that we can have a pretty
74 # message.
75 AS_IF([test $OMPI_WANT_F77_BINDINGS -eq 1],
76        [OMPI_CHECK_COMPILER_WORKS([Fortran 77], [], [], 
77            [AC_MSG_ERROR([Could not run a simple Fortran 77 program.  Aborting.])])])
79 AC_DEFINE_UNQUOTED(OMPI_WANT_F77_BINDINGS, $OMPI_WANT_F77_BINDINGS,
80     [Whether we want the MPI f77 bindings or not])
81 AC_DEFINE_UNQUOTED(OMPI_F77, "$OMPI_F77", [OMPI underlying F77 compiler])
82 AM_CONDITIONAL(OMPI_WANT_F77_BINDINGS, test "$OMPI_WANT_F77_BINDINGS" = "1")
83 AC_SUBST(OMPI_F77_ABSOLUTE)