there was an #include directive missing
[openmpi-llc.git] / config / ompi_configure_options.m4
blob7ce3114876c9eebb637507285536305efb238b48
1 dnl -*- shell-script -*-
2 dnl
3 dnl Copyright (c) 2004-2006 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 (c) 2006      Cisco Systems, Inc.  All rights reserved.
14 dnl $COPYRIGHT$
15 dnl 
16 dnl Additional copyrights may follow
17 dnl 
18 dnl $HEADER$
19 dnl
21 AC_DEFUN([OMPI_CONFIGURE_OPTIONS],[
22 ompi_show_subtitle "Configuration options"
25 # Code coverage options
27 AC_MSG_CHECKING([Whether to run code coverage])
28 AC_ARG_ENABLE(coverage,
29               AC_HELP_STRING([--enable-coverage],
30                              [enable code coverage files to be generated]))
31 if test "$enable_coverage" = "yes"; then
32     if test "$enable_shared" = "yes"; then 
33         AC_MSG_WARN([Code coverage can run only with static libraries. Please 
34 run configure with --enable-static --disable-shared if 
35 you want code coverage. Also ensure that you execute 
36 make clean too ensure removal of all leftover shared 
37 mpi libraries])
38         AC_MSG_ERROR([Cannot continue processing])
39     fi
40     AC_MSG_RESULT([yes])
41     WANT_COVERAGE=1
42 else 
43     AC_MSG_RESULT([no])
44     WANT_COVERAGE=0
49 # Memory debugging
52 AC_MSG_CHECKING([whether to debug memory usage])
53 AC_ARG_ENABLE(mem-debug, 
54     AC_HELP_STRING([--enable-mem-debug],
55                    [enable memory debugging (debugging only) (default: disabled)]))
56 if test "$enable_mem_debug" = "yes"; then
57     AC_MSG_RESULT([yes])
58     WANT_MEM_DEBUG=1
59 else
60     AC_MSG_RESULT([no])
61     WANT_MEM_DEBUG=0
63 #################### Early development override ####################
64 if test "$WANT_MEM_DEBUG" = "0" -a -z "$enable_mem_debug" -a -d .svn; then
65     WANT_MEM_DEBUG=1
66     echo "--> developer override: enable mem profiling by default"
68 #################### Early development override ####################
69 AC_DEFINE_UNQUOTED(OMPI_ENABLE_MEM_DEBUG, $WANT_MEM_DEBUG,
70     [Whether we want the memory profiling or not])
73 # Memory profiling
76 AC_MSG_CHECKING([whether to profile memory usage])
77 AC_ARG_ENABLE(mem-profile, 
78     AC_HELP_STRING([--enable-mem-profile],
79                    [enable memory profiling (debugging only) (default: disabled)]))
80 if test "$enable_mem_profile" = "yes"; then
81     AC_MSG_RESULT([yes])
82     WANT_MEM_PROFILE=1
83 else
84     AC_MSG_RESULT([no])
85     WANT_MEM_PROFILE=0
87 #################### Early development override ####################
88 if test "$WANT_MEM_PROFILE" = "0" -a -z "$enable_mem_profile" -a -d .svn; then
89     WANT_MEM_PROFILE=1
90     echo "--> developer override: enable mem profiling by default"
92 #################### Early development override ####################
93 AC_DEFINE_UNQUOTED(OMPI_ENABLE_MEM_PROFILE, $WANT_MEM_PROFILE,
94     [Whether we want the memory profiling or not])
97 # Developer picky compiler options
100 AC_MSG_CHECKING([if want developer-level compiler pickyness])
101 AC_ARG_ENABLE(picky, 
102     AC_HELP_STRING([--enable-picky],
103                    [enable developer-level compiler pickyness when building Open MPI (default: disabled)]))
104 if test "$enable_picky" = "yes"; then
105     AC_MSG_RESULT([yes])
106     WANT_PICKY_COMPILER=1
107 else
108     AC_MSG_RESULT([no])
109     WANT_PICKY_COMPILER=0
111 #################### Early development override ####################
112 if test "$WANT_PICKY_COMPILER" = "0" -a -z "$enable_picky" -a -d .svn; then
113     WANT_PICKY_COMPILER=1
114     echo "--> developer override: enable picky compiler by default"
116 #################### Early development override ####################
119 # Developer debugging
122 AC_MSG_CHECKING([if want developer-level debugging code])
123 AC_ARG_ENABLE(debug, 
124     AC_HELP_STRING([--enable-debug],
125                    [enable developer-level debugging code (not for general MPI users!) (default: disabled)]))
126 if test "$enable_debug" = "yes"; then
127     AC_MSG_RESULT([yes])
128     WANT_DEBUG=1
129 else
130     AC_MSG_RESULT([no])
131     WANT_DEBUG=0
133 #################### Early development override ####################
134 if test "$WANT_DEBUG" = "0" -a -z "$enable_debug" -a -d .svn; then
135     WANT_DEBUG=1
136     echo "--> developer override: enable debugging code by default"
138 #################### Early development override ####################
139 if test "$WANT_DEBUG" = "0"; then
140     CFLAGS="-DNDEBUG $CFLAGS"
141     CXXFLAGS="-DNDEBUG $CXXFLAGS"
143 AC_DEFINE_UNQUOTED(OMPI_ENABLE_DEBUG, $WANT_DEBUG,
144     [Whether we want developer-level debugging code or not])
148 # Fortran 77
151 AC_MSG_CHECKING([if want Fortran 77 bindings])
152 AC_ARG_ENABLE(mpi-f77, 
153     AC_HELP_STRING([--enable-mpi-f77],
154                    [enable f77 MPI bindings (default: enabled)]))
155 if test "$enable_mpi_f77" != "no"; then
156     AC_MSG_RESULT([yes])
157     OMPI_WANT_F77_BINDINGS=1
158 else
159     AC_MSG_RESULT([no])
160     OMPI_WANT_F77_BINDINGS=0
165 # Fortran 90
168 AC_MSG_CHECKING([if want Fortran 90 bindings])
169 AC_ARG_ENABLE(mpi-f90, 
170     AC_HELP_STRING([--enable-mpi-f90],
171                    [enable f90 MPI bindings (default: enabled)]))
172 if test "$enable_mpi_f90" != "no"; then
173     AC_MSG_RESULT([yes])
174     OMPI_WANT_F90_BINDINGS=1
175 else
176     AC_MSG_RESULT([no])
177     OMPI_WANT_F90_BINDINGS=0
180 AC_MSG_CHECKING([desired Fortran 90 bindings "size"])
181 AC_ARG_WITH(mpi-f90-size,
182     AC_HELP_STRING([--with-mpi-f90-size=SIZE],
183                    [specify the types of functions in the Fortran 90 MPI module, where size is one of: trivial (MPI-2 F90-specific functions only), small (trivial + all MPI functions without choice buffers), medium (small + all MPI functions with one choice buffer)]))
185 if test "$OMPI_WANT_F90_BINDINGS" = "0"; then
186     AC_MSG_RESULT([disabled (Fortran 90 bindings disabled)])
187 elif test "$with_mpi_f90_size" = "no"; then
188     OMPI_WANT_F90_BINDINGS=0
189     AC_MSG_RESULT([disabling F90 MPI module (used specified)])
190 else
191     # Default value
192     if test "$with_mpi_f90_size" = ""; then
193         with_mpi_f90_size=small
194     fi
196     # Check for each of the sizes
197     if test "$with_mpi_f90_size" = "trivial"; then
198         OMPI_F90_BUILD_SIZE=trivial
199     elif test "$with_mpi_f90_size" = "small"; then
200         OMPI_F90_BUILD_SIZE=small
201     elif test "$with_mpi_f90_size" = "medium"; then
202         OMPI_F90_BUILD_SIZE=medium
203     else
204         AC_MSG_RESULT([Unrecognized size: $with_mpi_f90_size])
205         AC_MSG_ERROR([Cannot continue])
206     fi
209 AM_CONDITIONAL([OMPI_WANT_BUILD_F90_TRIVIAL], 
210                [test "$OMPI_F90_BUILD_SIZE" = "trivial"])
211 AM_CONDITIONAL([OMPI_WANT_BUILD_F90_SMALL], 
212                [test "$OMPI_F90_BUILD_SIZE" = "small"])
213 AM_CONDITIONAL([OMPI_WANT_BUILD_F90_MEDIUM], 
214                [test "$OMPI_F90_BUILD_SIZE" = "medium"])
215 # This is effectively ignored in v1.1 because the "large" bindings are
216 # not ready for prime time
217 AM_CONDITIONAL([OMPI_WANT_BUILD_F90_LARGE], 
218                [test "$OMPI_F90_BUILD_SIZE" = "large"])
220 AC_SUBST(OMPI_F90_BUILD_SIZE)
221 AC_MSG_RESULT([$OMPI_F90_BUILD_SIZE])
224 # MPI profiling
227 AC_MSG_CHECKING([whether to enable PMPI])
228 AC_ARG_ENABLE(mpi-profile, 
229     AC_HELP_STRING([--enable-mpi-profile],
230                    [enable MPI profiling (default: enabled)]))
231 if test "$enable_mpi_profile" != "no"; then
232     AC_MSG_RESULT([yes])
233     WANT_MPI_PROFILING=1
234     MPIF_H_PMPI_W_FUNCS=", PMPI_WTICK, PMPI_WTIME"
235 else
236     AC_MSG_RESULT([no])
237     WANT_MPI_PROFILING=0
238     MPIF_H_PMPI_W_FUNCS=
240 AC_SUBST(MPIF_H_PMPI_W_FUNCS)
243 #                                                                              
244 # C++                                                                          
245 #                                                                              
247 AC_MSG_CHECKING([if want C++ bindings])
248 AC_ARG_ENABLE(mpi-cxx,
249     AC_HELP_STRING([--enable-mpi-cxx],
250                    [enable C++ MPI bindings (default: enabled)]))
251 if test "$enable_mpi_cxx" != "no"; then
252     AC_MSG_RESULT([yes])
253     WANT_MPI_CXX_SUPPORT=1
254 else
255     AC_MSG_RESULT([no])
256     WANT_MPI_CXX_SUPPORT=0
261 # Do we want to disable weak symbols for some reason?
264 AC_MSG_CHECKING([if want to enable weak symbol support])
265 AC_ARG_ENABLE(weak-symbols,
266     AC_HELP_STRING([--enable-weak-symbols],
267                    [use weak symbols, if available (default: enabled)]))
268 if test "$enable_weak_symbols" != "no"; then
269     AC_MSG_RESULT([yes])
270     WANT_WEAK_SYMBOLS=1
271 else
272     AC_MSG_RESULT([no])
273     WANT_WEAK_SYMBOLS=0
277 # Do we want to disable MPI parameter checking at run-time?
280 AC_MSG_CHECKING([if want run-time MPI parameter checking])
281 AC_ARG_WITH(mpi-param-check,
282     AC_HELP_STRING([--with-mpi-param-check(=VALUE)],
283                    [behavior of MPI function parameter checking.  Valid values are: always, never, runtime.  If --with-mpi-param-check is specified with no VALUE argument, it is equivalent to a VALUE of "always"; --without-mpi-param-check is equivalent to "never" (default: runtime).]))
284 mpi_param_check=ompi_mpi_param_check
285 if test "$with_mpi_param_check" = "no" -o \
286     "$with_mpi_param_check" = "never"; then
287     mpi_param_check=0
288     AC_MSG_RESULT([never])
289 elif test "$with_mpi_param_check" = "yes" -o \
290     "$with_mpi_param_check" = "always"; then
291     mpi_param_check=1
292     AC_MSG_RESULT([always])
293 elif test "$with_mpi_param_check" = "runtime" -o \
294     -z "$with_mpi_params_check"; then
295     AC_MSG_RESULT([runtime])
296 else
297     AC_MSG_RESULT([unknown])
298     AC_MSG_WARN([*** Unrecognized --with-mpi-param-check value])
299     AC_MSG_WARN([*** See "configure --help" output])
300     AC_MSG_WARN([*** Defaulting to "runtime"])
302 AC_DEFINE_UNQUOTED(MPI_PARAM_CHECK, $mpi_param_check,
303     [Whether we want to check MPI parameters always, never, or decide at run-time])
307 # Do we want to install all of OMPI's header files?
310 AC_MSG_CHECKING([if want to install OMPI header files])
311 AC_ARG_WITH(devel-headers,
312     AC_HELP_STRING([--with-devel-headers],
313                    [normal MPI users/applications do not need this (mpi.h and mpif.h are ALWAYS installed).  Developer headers are only necessary for MCA module authors (default: disabled).]))
314 if test "$with_devel_headers" = "yes"; then
315     AC_MSG_RESULT([yes])
316     WANT_INSTALL_HEADERS=1
317 else
318     AC_MSG_RESULT([no])
319     WANT_INSTALL_HEADERS=0
321 AM_CONDITIONAL(WANT_INSTALL_HEADERS, test "$WANT_INSTALL_HEADERS" = 1)
324 # Do we want the pretty-print stack trace feature?
326 AC_MSG_CHECKING([if want pretty-print stacktrace])
327 AC_ARG_ENABLE([pretty-print-stacktrace],
328     [AC_HELP_STRING([--enable-pretty-print-stacktrace],
329                     [Pretty print stacktrace on process signal])])
330 if test "$enable_pretty_print_stacktrace" = "no" ; then
331     AC_MSG_RESULT([no])
332     WANT_PRETTY_PRINT_STACKTRACE=0
333 else
334     AC_MSG_RESULT([yes])
335     WANT_PRETTY_PRINT_STACKTRACE=1
337 AC_DEFINE_UNQUOTED([OMPI_WANT_PRETTY_PRINT_STACKTRACE],
338                    [$WANT_PRETTY_PRINT_STACKTRACE],
339                    [if want pretty-print stack trace feature])
342 # Do we want deprecated executable names ?
344 AC_MSG_CHECKING(if want deprecated executable names)
345 AC_ARG_ENABLE(deprecated-executable-names,
346     AC_HELP_STRING([--enable-deprecated-executable-names], [make sym links to deprecated OMPI executables (e.g., hcc, hcp, hf77, wipe) (default: disabled)]))
347 if test "$enable_deprecated_executable_names" = "yes"; then
348     AC_MSG_RESULT([yes])
349     WANT_DEN=1
350 else
351     AC_MSG_RESULT([no])
352     WANT_DEN=0
355 AM_CONDITIONAL(WANT_DEPRECATED_EXECUTABLE_NAMES, test "$WANT_DEN" = "1")
358 # Do we want to enable peruse interface?
361 AC_MSG_CHECKING([if peruse support is required])
362 AC_ARG_ENABLE(peruse,
363     AC_HELP_STRING([--enable-peruse],
364                    [Support PERUSE interface (default: disabled)]))
365 if test "$enable_peruse" == "yes"; then
366     AC_MSG_RESULT([yes])
367     WANT_PERUSE=1
368 else
369     AC_MSG_RESULT([no])
370     WANT_PERUSE=0
372 AC_DEFINE_UNQUOTED([OMPI_WANT_PERUSE],
373                    [$WANT_PERUSE],
374                    [if the peruse interface should be enabled])
375 AM_CONDITIONAL(WANT_PERUSE, test "$WANT_PERUSE" = "1")
378 # What is the max array rank that we want to support in the f90 bindings?
381 OMPI_FORTRAN_MAX_ARRAY_RANK=4
382 AC_MSG_CHECKING([max supported array dimension in F90 MPI bindings])
383 AC_ARG_WITH(f90-max-array-dim,
384     AC_HELP_STRING([--with-f90-max-array-dim=<DIM>],
385                    [The maximum array dimension supported in the F90 MPI bindings (default: $OMPI_FORTRAN_MAX_ARRAY_RANK).]))
386 if test ! -z "$with_f90_max_array_dim" -a "$with_f90_max_array_dim" != "no"; then
387     # Ensure it's a number; hopefully a integer...
388     expr $with_f90_max_array_dim + 1 > /dev/null 2> /dev/null
389     if test "$?" = "0"; then
390         OMPI_FORTRAN_MAX_ARRAY_RANK="$with_f90_max_array_dim"
391     fi
393 AC_MSG_RESULT([$OMPI_FORTRAN_MAX_ARRAY_RANK])
394 AC_SUBST(OMPI_FORTRAN_MAX_ARRAY_RANK)
396 # do we want PTY support?
397 AC_MSG_CHECKING([if pty support should be enabled])
398 AC_ARG_ENABLE(pty-support,
399     AC_HELP_STRING([--enable-pty-support],
400                    [Enable/disable PTY support for STDIO forwarding.  default: enabled]))
401 if test "$enable_pty_support" = "no" ; then
402     AC_MSG_RESULT([no])
403     OMPI_ENABLE_PTY_SUPPORT=0
404 else
405     AC_MSG_RESULT([yes])
406     OMPI_ENABLE_PTY_SUPPORT=1
408 AC_DEFINE_UNQUOTED([OMPI_ENABLE_PTY_SUPPORT], [$OMPI_ENABLE_PTY_SUPPORT],
409                    [Whether user wants PTY support or not])
412 # Do we want to allow DLOPEN?
414 AC_MSG_CHECKING([if user wants dlopen support])
415 AC_ARG_ENABLE([dlopen],
416     [AC_HELP_STRING([--enable-dlopen],
417                     [Whether build should attempt to use dlopen (or
418                      similar) to dynamically load components.
419                      Disabling dlopen implies --disable-mca-dso.
420                      (default: enabled)])])
421 if test "$enable_dlopen" = "no" ; then
422     enable_mca_dso="no"
423     enable_mca_static="yes"
424     OMPI_ENABLE_DLOPEN_SUPPORT=0
425     AC_MSG_RESULT([no])
426 else
427     OMPI_ENABLE_DLOPEN_SUPPORT=1
428     AC_MSG_RESULT([yes])
432 # Heterogeneous support
435 AC_MSG_CHECKING([if heterogeneous support should be enabled])
436 AC_ARG_ENABLE([heterogeneous],
437     [AC_HELP_STRING([--enable-heterogeneous],
438                     [Enable features required for heterogeneous
439                      platform support (default: enabled)])])
440 if test "$enable_heterogeneous" = "no" ; then
441      AC_MSG_RESULT([no])
442      ompi_want_heterogeneous=0
443 else
444      AC_MSG_RESULT([yes])
445      ompi_want_heterogeneous=1
447 AC_DEFINE_UNQUOTED([OMPI_ENABLE_HETEROGENEOUS_SUPPORT], 
448                    [$ompi_want_heterogeneous], 
449                    [Enable features required for heterogeneous support])
452 # Internal trace file logging (debugging)
455 AC_MSG_CHECKING([if want trace file debugging])
456 AC_ARG_ENABLE([trace],
457     [AC_HELP_STRING([--enable-trace],
458                     [Enable internal tracing of OMPI/ORTE/OPAL calls -- used only for developer debugging, not tracing of MPI applications (default: disabled)])])
459 if test "$enable_trace" = "yes"; then
460     AC_MSG_RESULT([yes])
461     opal_want_trace=1
462 else
463     AC_MSG_RESULT([no])
464     opal_want_trace=0
466 AC_DEFINE_UNQUOTED([OPAL_ENABLE_TRACE], [$opal_want_trace],
467                    [Enable run-time tracing of internal functions])
471 # Cross-compile data
473 AC_ARG_WITH([cross],
474     [AC_HELP_STRING([--with-cross=FILE],
475         [Specify configure values that can not be determined in a cross-compilation environment.  See the Open MPI FAQ.])])
476 if test "$with_cross" = "yes" ; then
477     AC_MSG_ERROR([--with-cross argument must include FILE option])
478 elif test "$with_cross" = "no" ; then
479     AC_MSG_ERROR([--without-cross is not a valid argument])
480 elif test "$with_cross" != "" ; then
481     if test ! -r $with_cross ; then
482         AC_MSG_ERROR([could not find cross-compile data file $with_cross])
483     fi
485     # eval into environment
486     OMPI_LOG_MSG([Loading cross-compile file $with_cross, with contents below])
487     OMPI_LOG_FILE([$with_cross])
488     . "$with_cross"