Skip to content

Commit 9568b34

Browse files
committed
configure: add an option to set wrapper CC
This commit adds a new configure option: --with-wrapper-cc. This option can be used to set which C compiler is invoked by mpicc. This feature may necessary when building for compiler suites that do not support C11 (Ex: icc) if Open MPI chooses to require a C11 compiler. A version of Open MPI that is set up for these compilers can be built with: ./configure --with-wrapper-cc=icc CC=gcc FC=ifort CXX=icpc Signed-off-by: Nathan Hjelm <[email protected]>
1 parent 99c7482 commit 9568b34

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

config/opal_setup_cc.m4

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dnl Copyright (c) 2004-2006 The Regents of the University of California.
1212
dnl All rights reserved.
1313
dnl Copyright (c) 2007-2009 Sun Microsystems, Inc. All rights reserved.
1414
dnl Copyright (c) 2008-2015 Cisco Systems, Inc. All rights reserved.
15-
dnl Copyright (c) 2012 Los Alamos National Security, LLC. All rights
15+
dnl Copyright (c) 2012-2017 Los Alamos National Security, LLC. All rights
1616
dnl reserved.
1717
dnl Copyright (c) 2015 Research Organization for Information Science
1818
dnl and Technology (RIST). All rights reserved.
@@ -36,11 +36,6 @@ AC_DEFUN([OPAL_SETUP_CC],[
3636
AC_REQUIRE([_OPAL_PROG_CC])
3737
AC_REQUIRE([AM_PROG_CC_C_O])
3838

39-
# AC_PROG_CC_C99 changes CC (instead of CFLAGS) so save CC (without c99
40-
# flags) for use in our wrappers.
41-
WRAPPER_CC="$CC"
42-
AC_SUBST([WRAPPER_CC])
43-
4439
# From Open MPI 1.7 on we require a C99 compiant compiler
4540
AC_PROG_CC_C99
4641
# The result of AC_PROG_CC_C99 is stored in ac_cv_prog_cc_c99

config/opal_setup_wrappers.m4

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ dnl Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved.
1515
dnl Copyright (c) 2015-2016 Research Organization for Information Science
1616
dnl and Technology (RIST). All rights reserved.
1717
dnl Copyright (c) 2016 IBM Corporation. All rights reserved.
18+
dnl Copyright (c) 2017 Los Alamos National Security, LLC. All rights
19+
dnl reserved.
1820
dnl $COPYRIGHT$
1921
dnl
2022
dnl Additional copyrights may follow
@@ -75,6 +77,22 @@ AC_DEFUN([OPAL_WRAPPER_FLAGS_ADD], [
7577
# <flag>_prefix, configure is not. There's no known use case for
7678
# doing so, and we'd like to force the issue.
7779
AC_DEFUN([OPAL_SETUP_WRAPPER_INIT],[
80+
AC_ARG_WITH([wrapper-cc],
81+
[AC_HELP_STRING([--with-wrapper-cc],
82+
[C compiler to use when using mpicc])])
83+
84+
AS_IF([test "$with_wrapper_cc" = "yes" || test "$with_wrapper_cc" = "no"],
85+
[AC_MSG_ERROR([--with-wrapper-cc must have an argument.])])
86+
if test -n "$with_wrapper_cc" ; then
87+
WRAPPER_CC="$with_wrapper_cc"
88+
else
89+
# Just grab the compiler. If the user wants to also set CFLAGS there
90+
# is an option for that.
91+
WRAPPER_CC=$(echo "$CC" | cut -d' ' -f1)
92+
fi
93+
94+
AC_SUBST([WRAPPER_CC])
95+
7896
AC_ARG_WITH([wrapper-cflags],
7997
[AC_HELP_STRING([--with-wrapper-cflags],
8098
[Extra flags to add to CFLAGS when using mpicc])])

0 commit comments

Comments
 (0)