File: configure.in

package info (click to toggle)
xmpi 2.2.3b8-8
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,668 kB
  • ctags: 1,373
  • sloc: cpp: 13,083; sh: 8,293; makefile: 303; csh: 63
file content (307 lines) | stat: -rw-r--r-- 7,408 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
# -*- shell-script -*-
#
# Copyright (c) 2001-2003 The Trustees of Indiana University.  
#                         All rights reserved.
# Copyright (c) 1998-2001 University of Notre Dame. 
#                         All rights reserved.
# Copyright (c) 1994-1998 The Ohio State University.  
#                         All rights reserved.
# 
# This file is part of the XMPI software package.  For license
# information, see the LICENSE file in the top level directory of the
# XMPI source distribution.
#
# $Id: configure.in,v 1.34 2003/08/23 13:30:46 jsquyres Exp $
#

#
# Init autoconf
#

AC_INIT(src/xmpi/xmpi.cc)
AC_CONFIG_AUX_DIR(config)

#
# Init automake
#

XMPI_VERSION=`cat $srcdir/VERSION`
AC_SUBST(XMPI_VERSION)
echo "Configuring XMPI version $XMPI_VERSION"

# The third argument to AM_INIT_AUTOMAKE surpresses the PACKAGE and
# VERSION macors
AM_INIT_AUTOMAKE(xmpi, $XMPI_VERSION, 'no')

AH_TOP([/* -*- c -*-
 *
 * Copyright (c) 2001-2003 The Trustees of Indiana University.  
 *                         All rights reserved.
 * Copyright (c) 1998-2001 University of Notre Dame. 
 *                         All rights reserved.
 * Copyright (c) 1994-1998 The Ohio State University.  
 *                         All rights reserved.
 * 
 * This file is part of the XMPI software package.  For license
 * information, see the LICENSE file in the top level directory of the
 * XMPI source distribution.
 *
 * Function: - OS, CPU and compiler dependent configuration 
 */

#ifndef XMPI_CONFIG_H
#define XMPI_CONFIG_H
])

AH_BOTTOM([#endif /* XMPI_CONFIG_H */])

AC_DEFINE_UNQUOTED(XMPI_VERSION, "$XMPI_VERSION", [Version of XMPI])

# Get our host type...
AC_CANONICAL_HOST
AC_DEFINE_UNQUOTED(XMPI_ARCH, "$host", [Architecture])

AC_PREFIX_DEFAULT(/usr/local)

# check for specification of C++ compiler
# overrules default mpiCC with lam

CXX=mpic++
CC=mpicc

AC_ARG_WITH(cc,       
    AC_HELP_STRING([--with-cc=cc], [use C compiler cc]))
AC_ARG_WITH(cflags,
    AC_HELP_STRING([--with-cflags=CFLAGS], [use C compiler flags CFLAGS]))
AC_ARG_WITH(cxx,
    AC_HELP_STRING([--with-cxx=CC], [use C++ compiler CC]))
AC_ARG_WITH(cxxflags,
    AC_HELP_STRING([--with-cxxflags=CXXFLAGS], 
		   [use C++ compiler flags CXXFLAGS]))

if test -n "$with_cxx"; then
    if test $with_cxx = yes; then
	AC_MSG_ERROR(the --with-cxx option requires the compiler name)
    fi

    AC_MSG_WARN(*** You are not using the mpic++ compiler recommended)
    AC_MSG_WARN(*** for building the LAM libxmpi. Be sure to set)
    AC_MSG_WARN(*** the approprate include paths to the needed files)

    CXX="$with_cxx"
fi

if test -n "$with_cxxflags"; then
    if test $with_cxxflags = yes; then
	AC_MSG_ERROR(the --with-cxxflags option requires some option)
    fi

    CXXFLAGS="$with_cxxflags"
fi

if test -n "$with_cc"; then
    if test $with_cc = yes; then
	AC_MSG_ERROR(the --with-cc option requires the compiler name)
    fi

    AC_MSG_WARN(*** You are not using the mpicc compiler recommended)
    AC_MSG_WARN(*** for building the LAM libxmpi. Be sure to set)
    AC_MSG_WARN(*** the approprate include paths to the needed files)

    CC="$with_cc"
fi

if test -n "$with_cflags"; then
    if test $with_cflags = yes; then
	AC_MSG_ERROR(the --with-cflags option requires some option)
    fi

    CFLAGS="$with_cflags"
fi

#
# In theory, we have a working compiler set now.  
# Tell everyone C++ is our primary language and get our 
#  copmilers.  We need C++ 'cuz that's what our code is in
#  and C 'cuz that is what libtool wants...
#
AC_LANG_C
AC_PROG_CXX
AC_PROG_CC

if test -z "$CXXFLAGS"; then
    lam_cxxflags_save="$CXXFLAGS"
    if test "$GCC" = yes; then
	CXXFLAGS=-O
    else
	case "$host_os" in
	    solaris) CXXFLAGS=-fast;;
	    *) CXXFLAGS=-O;;
	esac
    fi
fi

# BWB: There was a time when XMPI worked with MPI implementations
# other than LAM.  This is no longer the case.  Since most of the code
# to make that work (build wise) bit-rotted into uselessness long ago,
# it has been removed.  It is believed (although not tested) that to
# make it work again, all you have to do is set LIBXMPI to the vendor
# name and set LDFLAGS to the right place so that it can find -lxmpi
#
# The AM_CONDITIONAL is so that we can decide whether to buld the
# included libxmpi that works with LAM.  So don't set LIBXMPI to
# lib-lam unless you want to buld the LAM libxmpi

LIBXMPI=lib-lam
AM_CONDITIONAL(WANT_LAM_XMPI,test "$LIBXMPI"="lib-lam")
AC_SUBST(LIBXMPI)

# Take care of some specific compiler options. 
# Force use of ANSI C under HP-UX.

if test "$ac_cv_prog_gcc" = no; then
    us=`(uname -s) 2>/dev/null` || us=unknown
    case "$us" in
        HP-UX) CXXFLAGS="$CXXFLAGS -Ae" ;;
	*)	;;
    esac
fi

AC_SUBST(CXXFLAGS)

#
# Check for X11 and Motif libraries..
#

AC_LANG_SAVE
AC_LANG_C
AC_PATH_XTRA

if test "$no_x" = yes; then
    AC_MSG_ERROR([Could not find X includes or libs.  Cannot continue.])
fi

LSC_FIND_MOTIF
if test "$motif_libraries_result" = "(none)" -o \
    "$motif_includes_result" = "(none)"; then
    AC_MSG_ERROR([Could not find Motif includes or libs.  Cannot continue.])
fi

X_CXXFLAGS="$X_CFLAGS"

AC_SUBST(X_CXXFLAGS)
AC_SUBST(X_LIBS)

AC_LANG_RESTORE

#
# Make sure that we have the LAM header files.
# Only do this if compiling for use with LAM
#

LSC_MPI_CHECK_TRILLIUM

#
# Some constants changed in the LAM header files
# Run this test to figure out which ones we should use
#

#LAM_CHECK_CONSTANTS

# Check for programs.
# Abort if we cannot find one of them

AC_PROG_CXXCPP
if test "$CXXCPP" = ""; then
    AC_MSG_ERROR([Could not find C preprocessor.  Cannot continue.])
fi

AC_PATH_PROG(RM,rm)
if test "$RM" = ""; then
    AC_MSG_ERROR([Could not find rm.  Cannot continue.])
fi

AC_PATH_PROG(SHELL_CMD, sh)
if test "$SHELL_CMD" = ""; then
    AC_MSG_ERROR([Could not find Bourne shell.  Cannot continue.])
fi

# Used to Check for typedefs, structures, and compiler characteristics.

AC_C_BIGENDIAN

# Check for library functions.

AC_CHECK_FUNCS(atexit getcwd)

AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>], [fd_set s; FD_ZERO(&s);],
lam_cv_need_sys_select_h=no, lam_cv_need_sys_select_h=yes)]
if test $lam_cv_need_sys_select_h = yes; then
    value=1
else
    value=0
fi
AC_DEFINE_UNQUOTED(NEED_SYS_SELECT, $value,
    [Whether we need <sys/select.h> or not])

AC_CHECK_SIZEOF(short, 2)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long, 4)
AC_CHECK_SIZEOF(float, 4)
AC_CHECK_SIZEOF(double, 4)

# Checks for header files

AC_HEADER_STDC
LSC_MPI_CHECK_MPI_H

#
# Find the template repository for our C++ compiler. 
# This is used for make clean
#

LSC_CXX_FIND_TEMPLATE_REPOSITORY(XMPI)

#
# Make automake clean emacs ~ files for "make clean"
#

CLEANFILES="-r *~ $XMPI_CXX_TEMPLATE_REPOSITORY"
AC_SUBST(CLEANFILES)

#
# ARGH! Some Sun Solaris Workshop 5.0 compilers appear to have a
# broken version of getline.  I hate Sun.  I hate Sun.  I hate Sun.
# But they do make bcheck...
#

LSC_CXX_HAVE_BROKEN_GETLINE(XMPI)

#
# Libtool magic
# Disable the shared build default (users can override this, though)
#

AM_DISABLE_SHARED
AM_PROG_LIBTOOL

#
# All done.  Party on.
#

AM_CONFIG_HEADER([src/xmpi/xmpi_config.h])
AC_CONFIG_FILES([
    Makefile
    app-defaults/Makefile
    config/Makefile
    man/Makefile
    man/man1/Makefile
    src/Makefile
    src/Bitmaps/Makefile
    src/Pixmaps/Makefile
    src/libxmpi/Makefile
    src/xmpi/Makefile
])
AC_OUTPUT