Skip to content

Commit 7121789

Browse files
authored
Merge pull request #8488 from awlauria/configury_fixes_and_cleanup
Configury fixes and cleanup
2 parents 73b4b7e + 8ea760c commit 7121789

File tree

8 files changed

+207
-293
lines changed

8 files changed

+207
-293
lines changed

config/opal_check_cflags.m4

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
dnl -*- shell-script -*-
2+
dnl
3+
dnl Copyright (c) 2021 IBM Corporation. All rights reserved.
4+
dnl
5+
dnl $COPYRIGHT$
6+
dnl
7+
dnl Additional copyrights may follow
8+
dnl
9+
dnl $HEADER$
10+
dnl
11+
12+
AC_DEFUN([_OPAL_CFLAGS_FAIL_SEARCH],[
13+
AC_REQUIRE([AC_PROG_GREP])
14+
if test -s conftest.err ; then
15+
$GREP -iq $1 conftest.err
16+
if test "$?" = "0" ; then
17+
opal_cv_cc_[$2]=0
18+
fi
19+
fi
20+
])
21+
22+
AC_DEFUN([_OPAL_CHECK_SPECIFIC_CFLAGS], [
23+
AC_MSG_CHECKING(if $CC supports ([$1]))
24+
CFLAGS_orig=$CFLAGS
25+
CFLAGS="$CFLAGS $1"
26+
AC_CACHE_VAL(opal_cv_cc_[$2], [
27+
AC_TRY_COMPILE([], [$3],
28+
[
29+
opal_cv_cc_[$2]=1
30+
_OPAL_CFLAGS_FAIL_SEARCH("ignored\|not recognized\|not supported\|not compatible\|unrecognized\|unknown", [$2])
31+
],
32+
opal_cv_cc_[$2]=1
33+
_OPAL_CFLAGS_FAIL_SEARCH("ignored\|not recognized\|not supported\|not compatible\|unrecognized\|unknown\|error", [$2])
34+
)])
35+
if test "$opal_cv_cc_[$2]" = "0" ; then
36+
CFLAGS="$CFLAGS_orig"
37+
AC_MSG_RESULT([no])
38+
else
39+
AC_MSG_RESULT([yes])
40+
fi
41+
])
42+
43+
AC_DEFUN([_OPAL_CXXFLAGS_FAIL_SEARCH],[
44+
AC_REQUIRE([AC_PROG_GREP])
45+
if test -s conftest.err ; then
46+
$GREP -iq $1 conftest.err
47+
if test "$?" = "0" ; then
48+
opal_cv_cxx_[$2]=0
49+
fi
50+
fi
51+
])
52+
53+
AC_DEFUN([_OPAL_CHECK_SPECIFIC_CXXFLAGS], [
54+
AC_MSG_CHECKING(if $CXX supports ([$1]))
55+
CXXFLAGS_orig=$CXXFLAGS
56+
CXXFLAGS="$CXXFLAGS $1"
57+
AC_CACHE_VAL(opal_cv_cxx_[$2], [
58+
AC_TRY_COMPILE([], [$3],
59+
[
60+
opal_cv_cxx_[$2]=1
61+
_OPAL_CXXFLAGS_FAIL_SEARCH("ignored\|not recognized\|not supported\|not compatible\|unrecognized\|unknown", [$2])
62+
],
63+
opal_cv_cxx_[$2]=1
64+
_OPAL_CXXFLAGS_FAIL_SEARCH("ignored\|not recognized\|not supported\|not compatible\|unrecognized\|unknown\|error", [$2])
65+
)])
66+
if test "$opal_cv_cxx_[$2]" = "0" ; then
67+
CXXFLAGS="$CXXFLAGS_orig"
68+
AC_MSG_RESULT([no])
69+
else
70+
AC_MSG_RESULT([yes])
71+
fi
72+
])

config/opal_check_vendor.m4

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dnl Copyright (c) 2004-2005 The Regents of the University of California.
1212
dnl All rights reserved.
1313
dnl Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
1414
dnl Copyright (c) 2014 Intel, Inc. All rights reserved
15-
dnl Copyright (c) 2017 IBM Corporation. All rights reserved.
15+
dnl Copyright (c) 2017-2021 IBM Corporation. All rights reserved.
1616
dnl $COPYRIGHT$
1717
dnl
1818
dnl Additional copyrights may follow
@@ -123,7 +123,7 @@ AC_DEFUN([_OPAL_CHECK_COMPILER_VENDOR], [
123123

124124
# IBM XL C/C++
125125
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
126-
[OPAL_IF_IFELSE([defined(__xlC__) || defined(__IBMC__) || defined(__IBMCPP__)],
126+
[OPAL_IF_IFELSE([defined(__xlC__) || defined(__IBMC__) || defined(__IBMCPP__) || defined(__ibmxl__)],
127127
[opal_check_compiler_vendor_result="ibm"
128128
xlc_major_version=`$CC -qversion 2>&1 | tail -n 1 | cut -d ' ' -f 2 | cut -d '.' -f 1`
129129
xlc_minor_version=`$CC -qversion 2>&1 | tail -n 1 | cut -d ' ' -f 2 | cut -d '.' -f 2`
@@ -132,30 +132,6 @@ AC_DEFUN([_OPAL_CHECK_COMPILER_VENDOR], [
132132
],
133133
[OPAL_IF_IFELSE([defined(_AIX) && !defined(__GNUC__)],
134134
[opal_check_compiler_vendor_result="ibm"])])])
135-
136-
# GNU
137-
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
138-
[OPAL_IFDEF_IFELSE([__GNUC__],
139-
[opal_check_compiler_vendor_result="gnu"
140-
141-
# We do not support gccfss as a compiler so die if
142-
# someone tries to use said compiler. gccfss (gcc
143-
# for SPARC Systems) is a compiler that is no longer
144-
# supported by Oracle and it has some major flaws
145-
# that prevents it from actually compiling OMPI code.
146-
# So if we detect it we automatically bail.
147-
148-
if ($CC --version | grep gccfss) >/dev/null 2>&1; then
149-
AC_MSG_RESULT([gccfss])
150-
AC_MSG_WARN([Detected gccfss being used to compile Open MPI.])
151-
AC_MSG_WARN([Because of several issues Open MPI does not support])
152-
AC_MSG_WARN([the gccfss compiler. Please use a different compiler.])
153-
AC_MSG_WARN([If you did not think you used gccfss you may want to])
154-
AC_MSG_WARN([check to see if the compiler you think you used is])
155-
AC_MSG_WARN([actually a link to gccfss.])
156-
AC_MSG_ERROR([Cannot continue])
157-
fi])])
158-
159135
# Borland Turbo C
160136
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
161137
[OPAL_IFDEF_IFELSE([__TURBOC__],
@@ -279,6 +255,29 @@ AC_DEFUN([_OPAL_CHECK_COMPILER_VENDOR], [
279255
[OPAL_IFDEF_IFELSE([__WATCOMC__],
280256
[opal_check_compiler_vendor_result="watcom"])])
281257

258+
# GNU
259+
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
260+
[OPAL_IFDEF_IFELSE([__GNUC__],
261+
[opal_check_compiler_vendor_result="gnu"
262+
263+
# We do not support gccfss as a compiler so die if
264+
# someone tries to use said compiler. gccfss (gcc
265+
# for SPARC Systems) is a compiler that is no longer
266+
# supported by Oracle and it has some major flaws
267+
# that prevents it from actually compiling OMPI code.
268+
# So if we detect it we automatically bail.
269+
270+
if ($CC --version | grep gccfss) >/dev/null 2>&1; then
271+
AC_MSG_RESULT([gccfss])
272+
AC_MSG_WARN([Detected gccfss being used to compile Open MPI.])
273+
AC_MSG_WARN([Because of several issues Open MPI does not support])
274+
AC_MSG_WARN([the gccfss compiler. Please use a different compiler.])
275+
AC_MSG_WARN([If you did not think you used gccfss you may want to])
276+
AC_MSG_WARN([check to see if the compiler you think you used is])
277+
AC_MSG_WARN([actually a link to gccfss.])
278+
AC_MSG_ERROR([Cannot continue])
279+
fi])])
280+
282281
$1="$opal_check_compiler_vendor_result"
283282
unset opal_check_compiler_vendor_result
284283
])

config/opal_config_asm.m4

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ dnl Copyright (c) 2017 Amazon.com, Inc. or its affiliates. All Rights
1919
dnl reserved.
2020
dnl Copyright (c) 2020 Google, LLC. All rights reserved.
2121
dnl Copyright (c) 2020 Intel, Inc. All rights reserved.
22+
dnl Copyright (c) 2021 IBM Corporation. All rights reserved.
2223
dnl $COPYRIGHT$
2324
dnl
2425
dnl Additional copyrights may follow
@@ -1086,6 +1087,7 @@ dnl
10861087
dnl #################################################################
10871088
AC_DEFUN([OPAL_CONFIG_ASM],[
10881089
AC_REQUIRE([OPAL_SETUP_CC])
1090+
AC_REQUIRE([OPAL_SETUP_CXX])
10891091
AC_REQUIRE([AM_PROG_AS])
10901092
10911093
AC_ARG_ENABLE([c11-atomics],[AC_HELP_STRING([--enable-c11-atomics],

0 commit comments

Comments
 (0)