Skip to content
Snippets Groups Projects
Commit 884486c9 authored by Markus Blatt's avatar Markus Blatt
Browse files

[dunecontrol,bugfix] Treat MPICC and MPICXX as variables needed by cmake.

Unfortunately environment variables with these names are not honored by CMake's
FindMPI. Therefore this commit translates them to MPI_{C,CXX}_COMPILER and
adds them to CMAKE_FLAGS before calling cmake.
parent 71489adc
No related branches found
No related tags found
No related merge requests found
......@@ -686,6 +686,19 @@ run_default_configure () {
fi
fi
done
# MPI flags are special. find_package(MPI) does not honor MPICC, MPICXX
# Therefore we translate them to CMake variables and add them to CMAKE_FLAGS. Fortran is omitted.
for i in CC CXX; do
comp=`echo "$PARAMS" | $GREP MPI$i= | $SED -e "s/.*[$BLANK^]MPI$i=\(\"[^\"]*\"\).*/\1/" -e "s/.*[$BLANK^]MPI$i=\('[^']*'\).*/\1/"`
if test -n "$comp" && test "$PARAMS" != "$comp" ; then
CMAKE_FLAGS="-DMPI_$(echo $i| $SED 's/^CC$/C/')""_COMPILER:FILEPATH=`which $comp` $CMAKE_FLAGS"
else
comp=`echo "$PARAMS" | $GREP MPI$i= | $SED -e "s/.*[$BLANK^]MPI$i=\([^$BLANK]*\).*/\1/"`
if test -n "$comp" && test "$PARAMS" != "$comp" ; then
CMAKE_FLAGS="-DMPI_$(echo $i| $SED 's/^CC$/C/')""_COMPILER:FILEPATH=`which $comp` $CMAKE_FLAGS"
fi
fi
done
# create build directory if requested
test -d "$ABS_BUILDDIR" || mkdir -p "$ABS_BUILDDIR"
SRCDIR="$PWD"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment