From 19770fd10e4278c2b6732dfe03388141d95b1b27 Mon Sep 17 00:00:00 2001 From: Mohsin Shaikh Date: Fri, 9 Oct 2020 17:20:20 +0300 Subject: [PATCH] adding fix to let Cray C compiler wrapper discover the comiple and link options in Cray programming environment --- m4/lx_find_mpi.m4 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/m4/lx_find_mpi.m4 b/m4/lx_find_mpi.m4 index 9d45cb7..7193fc4 100644 --- a/m4/lx_find_mpi.m4 +++ b/m4/lx_find_mpi.m4 @@ -123,10 +123,18 @@ AC_DEFUN([LX_QUERY_MPI_COMPILER], # and link lines. After this part of the macro, we'll have a valid # lx_mpi_command_line echo -n "Checking whether $$1 responds to '-showme:compile'... " - lx_mpi_compile_line=`$$1 -showme:compile 2>/dev/null` + if [[ "$(echo $MPICC | grep -o cc)" = "cc" ]]; then + lx_mpi_compile_line=`$$1 --cray-print-opts=cflags 2>/dev/null` + else + lx_mpi_compile_line=`$$1 -showme:compile 2>/dev/null` + fi if [[ "$?" -eq 0 ]]; then echo yes - lx_mpi_link_line=`$$1 -showme:link 2>/dev/null` + if [[ "$(echo $MPICC | grep -o cc)" = "cc" ]]; then + lx_mpi_link_line=`$$1 --cray-print-opts=libs 2>/dev/null` + else + lx_mpi_link_line=`$$1 -showme:link 2>/dev/null` + fi else echo no echo -n "Checking whether $$1 responds to '-showme'... "