there was an #include directive missing
[openmpi-llc.git] / config / ompi_check_icc.m4
blob7ac229ca553fc8a98b25f6a39df7e3a3b2c41eac
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
20 AC_DEFUN([OMPI_CHECK_ICC_VARARGS],[
21 dnl
22 dnl On EM64T, icc-8.1 before version 8.1.027 segfaulted, since 
23 dnl va_start was miscompiled...
24 dnl
25 AC_MSG_CHECKING([whether icc-8.1 for EM64T works with variable arguments])
26 AC_TRY_RUN([
27 #include <stdarg.h>
28 #include <stdio.h>
29 #include <stdlib.h>
31 void func (int c, char * f, ...)
33   va_list arglist;
34   va_start (arglist, f);
35   /* vprintf (f, arglist); */
36   va_end (arglist);
39 int main (int argc, char * argv[])
41   FILE *f;
42   func (4711, "Help %d [%s]\n", 10, "ten");
43   f=fopen ("conftestval", "w");
44   if (!f) exit (1);
45   return 0;
48 ],[ompi_ac_icc_varargs=`test -f conftestval`],[ompi_ac_icc_varargs=1],[ompi_ac_icc_varargs=1])
50 if test "$ompi_ac_icc_varargs" = "1"; then
51     AC_MSG_WARN([*** Problem running configure test!])
52     AC_MSG_WARN([*** Your icc-8.1 compiler seems to miscompile va_start!])
53     AC_MSG_WARN([*** Please upgrade compiler to at least version 8.1.027])
54     AC_MSG_ERROR([*** Cannot continue.])
57 AC_MSG_RESULT([yes])
59 /bin/rm -f conftest*])dnl