Skip to content

Commit 2de2f79

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. The feature is necessary when building for compiler suites that do not support C11 (Ex: icc). 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 2de2f79

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

config/opal_setup_cc.m4

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ AC_DEFUN([OPAL_SETUP_CC],[
3838

3939
# AC_PROG_CC_C99 changes CC (instead of CFLAGS) so save CC (without c99
4040
# flags) for use in our wrappers.
41-
WRAPPER_CC="$CC"
42-
AC_SUBST([WRAPPER_CC])
41+
# WRAPPER_CC="$CC"
4342

4443
# From Open MPI 1.7 on we require a C99 compiant compiler
4544
AC_PROG_CC_C99

config/opal_setup_wrappers.m4

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,20 @@ AC_DEFUN([OPAL_WRAPPER_FLAGS_ADD], [
7575
# <flag>_prefix, configure is not. There's no known use case for
7676
# doing so, and we'd like to force the issue.
7777
AC_DEFUN([OPAL_SETUP_WRAPPER_INIT],[
78+
AC_ARG_WITH([wrapper-cc],
79+
[AC_HELP_STRING([--with-wrapper-cc],
80+
[C compiler to use when using mpicc])])
81+
82+
AS_IF([test "$with_wrapper_cc" = "yes" || test "$with_wrapper_cc" = "no"],
83+
[AC_MSG_ERROR([--with-wrapper-cc must have an argument.])])
84+
if test -n "$with_wrapper_cc" ; then
85+
WRAPPER_CC="$with_wrapper_cc"
86+
else
87+
WRAPPER_CC=$(echo "$CC" | cut -d' ' -f1)
88+
fi
89+
90+
AC_SUBST([WRAPPER_CC])
91+
7892
AC_ARG_WITH([wrapper-cflags],
7993
[AC_HELP_STRING([--with-wrapper-cflags],
8094
[Extra flags to add to CFLAGS when using mpicc])])

0 commit comments

Comments
 (0)