1 dnl -*- shell-script -*-
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.
8 dnl Additional copyrights may follow
13 # OMPI_CHECK_COMPILER_WORKS(language, language_exit,
14 # [action-if-found], [action-if-not-found])
15 # ----------------------------------------------------
16 # Try to compile and run a simple "exit(0)" application in
17 # 'language'. A warning is always printed if the application
18 # fails to run. Action-if-found is evaluated if the application
19 # runs successfully (or compiles if cross-compiling), and
20 # action-if-not-found is evaluated if the application fails to
23 # language-exit should be how to exit cleanly in 'language'.
24 # You probably want exit(0) for C/C++ and empty for Fortran.
25 AC_DEFUN([OMPI_CHECK_COMPILER_WORKS],
26 [ AS_VAR_PUSHDEF([lang_var], [ompi_cv_$1_works])
28 AC_CACHE_CHECK([if $1 compiler works], lang_var,
30 AC_RUN_IFELSE([AC_LANG_PROGRAM([], [$2])],
31 [AS_VAR_SET(lang_var, ["yes"])],
32 [AS_VAR_SET(lang_var, ["no"])],
33 [AS_VAR_SET(lang_var, ["cross compiling"])])
35 AS_IF([test "AS_VAR_GET(lang_var)" = "no"],
37 **********************************************************************
38 * It appears that your $1 compiler is unable to produce working
39 * executables. A simple test application failed to properly
40 * execute. Note that this is likely not a problem with Open MPI,
41 * but a problem with the local compiler installation. More
42 * information (including exactly what command was given to the
43 * compiler and what error resulted when the command was executed) is
44 * available in the config.log file in this directory.
45 **********************************************************************
49 AS_VAR_POPDEF([lang_var])dnl