1
1
openmpi/opal/config/opal_check_compiler_version.m4
Ralph Castain 40a2bfa238 WARNING: Work on the temp branch being merged here encountered problems with bugs in subversion. Considerable effort has gone into validating the branch. However, not all conditions can be checked, so users are cautioned that it may be advisable to not update from the trunk for a few days to allow MTT to identify platform-specific issues.
This merges the branch containing the revamped build system based around converting autogen from a bash script to a Perl program. Jeff has provided emails explaining the features contained in the change.

Please note that configure requirements on components HAVE CHANGED. For example. a configure.params file is no longer required in each component directory. See Jeff's emails for an explanation.

This commit was SVN r23764.
2010-09-17 23:04:06 +00:00

92 строки
2.5 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"
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
], [
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"
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
], [
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