1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283
|
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
dnl Copyright (c) 2014 Intel, Inc. All rights reserved
dnl Copyright (c) 2017-2021 IBM Corporation. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# OPAL_C_COMPILER_VENDOR(VENDOR_VARIABLE)
# ---------------------------------------
# Set shell variable VENDOR_VARIABLE to the name of the compiler
# vendor for the current C compiler.
#
# See comment for _OPAL_CHECK_COMPILER_VENDOR for a complete
# list of currently detected compilers.
AC_DEFUN([OPAL_C_COMPILER_VENDOR], [
AC_REQUIRE([AC_PROG_CC])
AC_CACHE_CHECK([for the C compiler vendor],
[opal_cv_c_compiler_vendor],
[AC_LANG_PUSH(C)
_OPAL_CHECK_COMPILER_VENDOR([opal_cv_c_compiler_vendor])
AC_LANG_POP(C)])
$1="$opal_cv_c_compiler_vendor"
])
# OPAL_CXX_COMPILER_VENDOR(VENDOR_VARIABLE)
# ---------------------------------------
# Set shell variable VENDOR_VARIABLE to the name of the compiler
# vendor for the current C++ compiler.
#
# See comment for _OPAL_CHECK_COMPILER_VENDOR for a complete
# list of currently detected compilers.
AC_DEFUN([OPAL_CXX_COMPILER_VENDOR], [
AC_REQUIRE([AC_PROG_CXX])
AC_CACHE_CHECK([for the C++ compiler vendor],
[opal_cv_cxx_compiler_vendor],
[AC_LANG_PUSH(C++)
_OPAL_CHECK_COMPILER_VENDOR([opal_cv_cxx_compiler_vendor])
AC_LANG_POP(C++)])
$1="$opal_cv_c_compiler_vendor"
])
# workaround to avoid syntax error with Autoconf < 2.68:
m4_ifndef([AC_LANG_DEFINES_PROVIDED],
[m4_define([AC_LANG_DEFINES_PROVIDED])])
# OPAL_IFDEF_IFELSE(symbol, [action-if-defined],
# [action-if-not-defined])
# ----------------------------------------------
# Run compiler to determine if preprocessor symbol "symbol" is
# defined by the compiler.
AC_DEFUN([OPAL_IFDEF_IFELSE], [
AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED
#ifndef $1
#error "symbol $1 not defined"
choke me
#endif], [$2], [$3])])
# OPAL_IF_IFELSE(symbol, [action-if-defined],
# [action-if-not-defined])
# ----------------------------------------------
# Run compiler to determine if preprocessor symbol "symbol" is
# defined by the compiler.
AC_DEFUN([OPAL_IF_IFELSE], [
AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED
#if !( $1 )
#error "condition $1 not met"
choke me
#endif], [$2], [$3])])
# _OPAL_CHECK_COMPILER_VENDOR(VENDOR_VARIABLE)
# --------------------------------------------
# Set shell variable VENDOR_VARIABLE to the name of the compiler
# vendor for the compiler for the current language. Language must be
# one of C, OBJC, or C++.
#
# thanks to http://predef.sourceforge.net/precomp.html for the list
# of defines to check.
AC_DEFUN([_OPAL_CHECK_COMPILER_VENDOR], [
opal_check_compiler_vendor_result="unknown"
# GNU is probably the most common, so check that one as soon as
# possible. Intel and PGI18 pretends to be GNU, so need to check Intel
# and PGI before checking for GNU.
# Intel
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
[OPAL_IF_IFELSE([defined(__INTEL_COMPILER) || defined(__ICC)],
[opal_check_compiler_vendor_result="intel"])])
# Portland Group
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
[OPAL_IFDEF_IFELSE([__PGI],
[opal_check_compiler_vendor_result="portland group"])])
# Fujitsu
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
[OPAL_IF_IFELSE([defined(__FUJITSU)],
[opal_check_compiler_vendor_result="fujitsu"])])
# IBM XL C/C++
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
[OPAL_IF_IFELSE([defined(__xlC__) || defined(__IBMC__) || defined(__IBMCPP__) || defined(__ibmxl__)],
[opal_check_compiler_vendor_result="ibm"
xlc_major_version=`$CC -qversion 2>&1 | tail -n 1 | cut -d ' ' -f 2 | cut -d '.' -f 1`
xlc_minor_version=`$CC -qversion 2>&1 | tail -n 1 | cut -d ' ' -f 2 | cut -d '.' -f 2`
AS_IF([ (test "$xlc_major_version" -lt "13" ) || (test "$xlc_major_version" -eq "13" && test "$xlc_minor_version" -lt "1" )],
[AC_MSG_ERROR(["XL Compiler versions less than 13.1 not supported. Detected $xlc_major_version.$xlc_minor_version"])])
],
[OPAL_IF_IFELSE([defined(_AIX) && !defined(__GNUC__)],
[opal_check_compiler_vendor_result="ibm"])])])
# Borland Turbo C
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
[OPAL_IFDEF_IFELSE([__TURBOC__],
[opal_check_compiler_vendor_result="borland"])])
# Borland C++
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
[OPAL_IFDEF_IFELSE([__BORLANDC__],
[opal_check_compiler_vendor_result="borland"])])
# Comeau C++
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
[OPAL_IFDEF_IFELSE([__COMO__],
[opal_check_compiler_vendor_result="comeau"])])
# Compaq C/C++
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
[OPAL_IF_IFELSE([defined(__DECC) || defined(VAXC) || defined(__VAXC)],
[opal_check_compiler_vendor_result="compaq"],
[OPAL_IF_IFELSE([defined(__osf__) && defined(__LANGUAGE_C__)],
[opal_check_compiler_vendor_result="compaq"],
[OPAL_IFDEF_IFELSE([__DECCXX],
[opal_check_compiler_vendor_result="compaq"])])])])
# Cray C/C++
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
[OPAL_IFDEF_IFELSE([_CRAYC],
[opal_check_compiler_vendor_result="cray"])])
# Diab C/C++
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
[OPAL_IFDEF_IFELSE([__DCC__],
[opal_check_compiler_vendor_result="diab"])])
# Digital Mars
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
[OPAL_IF_IFELSE([defined(__DMC__) || defined(__SC__) || defined(__ZTC__)],
[opal_check_compiler_vendor_result="digital mars"])])
# HP ANSI C / aC++
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
[OPAL_IF_IFELSE([defined(__HP_cc) || defined(__HP_aCC)],
[opal_check_compiler_vendor_result="hp"])])
# KAI C++ (rest in peace)
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
[OPAL_IFDEF_IFELSE([__KCC],
[opal_check_compiler_vendor_result="kai"])])
# LCC
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
[OPAL_IFDEF_IFELSE([__LCC__],
[opal_check_compiler_vendor_result="lcc"])])
# MetaWare High C/C++
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
[OPAL_IFDEF_IFELSE([__HIGHC__],
[opal_check_compiler_vendor_result="metaware high"])])
# Metrowerks Codewarrior
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
[OPAL_IFDEF_IFELSE([__MWERKS__],
[opal_check_compiler_vendor_result="metrowerks"])])
# MIPSpro (SGI)
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
[OPAL_IF_IFELSE([defined(sgi) || defined(__sgi)],
[opal_check_compiler_vendor_result="sgi"])])
# MPW C++
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
[OPAL_IF_IFELSE([defined(__MRC__) || defined(MPW_C) || defined(MPW_CPLUS)],
[opal_check_compiler_vendor_result="mpw"])])
# Microsoft
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
[# Always use C compiler when checking for Microsoft, as
# Visual C++ doesn't recognize .cc as a C++ file.
AC_LANG_PUSH(C)
OPAL_IF_IFELSE([defined(_MSC_VER) || defined(__MSC_VER)],
[opal_check_compiler_vendor_result="microsoft"])
AC_LANG_POP(C)])
# Norcroft C
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
[OPAL_IFDEF_IFELSE([__CC_NORCROFT],
[opal_check_compiler_vendor_result="norcroft"])])
# Pelles C
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
[OPAL_IFDEF_IFELSE([__POCC__],
[opal_check_compiler_vendor_result="pelles"])])
# SAS/C
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
[OPAL_IF_IFELSE([defined(SASC) || defined(__SASC) || defined(__SASC__)],
[opal_check_compiler_vendor_result="sas"])])
# Sun Workshop C/C++
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
[OPAL_IF_IFELSE([defined(__SUNPRO_C) || defined(__SUNPRO_CC)],
[opal_check_compiler_vendor_result="sun"])])
# TenDRA C/C++
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
[OPAL_IFDEF_IFELSE([__TenDRA__],
[opal_check_compiler_vendor_result="tendra"])])
# Tiny C
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
[OPAL_IFDEF_IFELSE([__TINYC__],
[opal_check_compiler_vendor_result="tiny"])])
# USL C
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
[OPAL_IFDEF_IFELSE([__USLC__],
[opal_check_compiler_vendor_result="usl"])])
# Watcom C++
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
[OPAL_IFDEF_IFELSE([__WATCOMC__],
[opal_check_compiler_vendor_result="watcom"])])
# GNU
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
[OPAL_IFDEF_IFELSE([__GNUC__],
[opal_check_compiler_vendor_result="gnu"
# We do not support gccfss as a compiler so die if
# someone tries to use said compiler. gccfss (gcc
# for SPARC Systems) is a compiler that is no longer
# supported by Oracle and it has some major flaws
# that prevents it from actually compiling OMPI code.
# So if we detect it we automatically bail.
if ($CC --version | grep gccfss) >/dev/null 2>&1; then
AC_MSG_RESULT([gccfss])
AC_MSG_WARN([Detected gccfss being used to compile Open MPI.])
AC_MSG_WARN([Because of several issues Open MPI does not support])
AC_MSG_WARN([the gccfss compiler. Please use a different compiler.])
AC_MSG_WARN([If you did not think you used gccfss you may want to])
AC_MSG_WARN([check to see if the compiler you think you used is])
AC_MSG_WARN([actually a link to gccfss.])
AC_MSG_ERROR([Cannot continue])
fi])])
$1="$opal_check_compiler_vendor_result"
unset opal_check_compiler_vendor_result
])
|