1
1
openmpi/config/opal_check_compiler_version.m4
Rainer Keller 916eb1fb1e - As proposed in RFC and telcon, warn the user about deprecated
functionality (per MPI-2.1). This warning can be toggled using
   --enable-mpi-interface-warning (default OFF), but can be
   selectively turned on passing
       mpicc -DOMPI_WANT_MPI_INTERFACE_WARNING

   Using icc, gcc < 4.5, warnings (such as in mpi2basic_tests) show:
     type_vector.c:83: warning: ‘MPI_Type_hvector’ is deprecated
     (declared at /home/../usr/include/mpi.h:1379)

   Using gcc-4.5 (gcc-svn) these show up as:
     type_vector.c:83: warning: ‘MPI_Type_hvector’ is deprecated
     (declared at /home/../usr/include/mpi.h:1379):
     MPI_Type_hvector is superseded by MPI_Type_create_hvector in MPI-2.0


   Jeff and I propose to turn such warnings on with Open MPI-1.7 by default.


 - Detection of user-level compiler is handled using the preprocessor
   checks of GASnet's other/portable_platform.h (thanks to Paul Hargrove
   and Dan Bonachea) adapted into ompi/include/mpi_portable_platform.h
   (see comments).

   The OMPI-build time detection is output (Familyname and Version)
   with ompi_info.

   This functionality (actually any upcoming __attribute__) are turned
   off, if a different compiler (and version) is being detected.


 - Note, that any warnings regarding (user-compiler!=build-compiler)
   as discussed in the RFC are _not_ included for now.


 - Tested on Linux with --enable-mpi-interface-warning on
   Linux, gcc-4.5 (deprecated w/ specific msg)
   Linux, gcc-4.3 (deprecated w/o specific msg)
   Linux, pathscale 3.1 (deprecated w/o specific msg)
   Linux, icc-11.0 (deprecated w/o specific msg)

   Linux, PGI-8.0.6 accepts __deprecated__ but does not issue a warning,
   further investigation needed...

This commit was SVN r21262.
2009-05-22 04:39:43 +00:00

88 строки
2.4 KiB
Bash

dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
dnl
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# OPAL_CHECK_COMPILER_VERSION_ID()
# ----------------------------------------------------
# Try to figure out the compiler's name and version to detect cases,
# where users compile Open MPI with one version and compile the application
# with a different compiler.
#
AC_DEFUN([OPAL_CHECK_COMPILER_VERSION_ID],
[
_OPAL_CHECK_COMPILER(FAMILYID)
_OPAL_CHECK_COMPILER_STRINGIFY(FAMILYNAME)
_OPAL_CHECK_COMPILER(VERSION)
_OPAL_CHECK_COMPILER_STRINGIFY(VERSION_STR)
])dnl
AC_DEFUN([_OPAL_CHECK_COMPILER], [
lower=m4_tolower($1)
AC_CACHE_CHECK([for compiler $lower], opal_cv_compiler_[$1],
[
CPPFLAGS_orig=$CPPFLAGS
CPPFLAGS="-I${top_ompi_srcdir}/ompi/include $CPPFLAGS"
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include "mpi_portable_platform.h.in" /* Yes, it is supposed to be a .in-file */
int main (int argc, char * argv[])
{
FILE * f;
f=fopen("conftestval", "w");
if (!f) exit(1);
fprintf (f, "%d", PLATFORM_COMPILER_$1);
return 0;
}
], [
eval opal_cv_compiler_$1=`cat conftestval`;
], [
eval opal_cv_compiler_$1=0
])
CPPFLAGS=$CPPFLAGS_orig
])
AC_DEFINE_UNQUOTED([OPAL_BUILD_PLATFORM_COMPILER_$1], $opal_cv_compiler_[$1],
[The compiler $lower which OMPI was built with])
])dnl
AC_DEFUN([_OPAL_CHECK_COMPILER_STRINGIFY], [
lower=m4_tolower($1)
AC_CACHE_CHECK([for compiler $lower], opal_cv_compiler_[$1],
[
CPPFLAGS_orig=$CPPFLAGS
CPPFLAGS="-I${top_ompi_srcdir}/ompi/include $CPPFLAGS"
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include "mpi_portable_platform.h.in" /* Yes, it is supposed to be a .in-file */
int main (int argc, char * argv[])
{
FILE * f;
f=fopen("conftestval", "w");
if (!f) exit(1);
fprintf (f, "%s", _STRINGIFY(PLATFORM_COMPILER_$1));
return 0;
}
], [
eval opal_cv_compiler_$1=`cat conftestval`;
], [
eval opal_cv_compiler_$1=UNKNOWN
])
CPPFLAGS=$CPPFLAGS_orig
])
AC_DEFINE_UNQUOTED([OPAL_BUILD_PLATFORM_COMPILER_$1], $opal_cv_compiler_[$1],
[The compiler $lower which OMPI was built with])
])dnl