-D DEAL_II_WITH_ZLIB:BOOL=ON \
${DEAL_CONFOPTS}"
+
+################################################################################
+# Check if we hit cmake-3.10+ and deal.II v8.5.1 configure error (MPI / FindMPI)
+# cf. https://github.com/dealii/dealii/issues/5510
+
+if [ ${DEAL_II_VERSION} = "v8.5.1" ]; then
+ # check for cmake version 3.10 and above
+ CMAKE_VER_MAJOR=$(cmake --version | perl -pe '($_)=/([0-9]+([.][0-9]+)+)/' | cut -d '.' -f1)
+ CMAKE_VER_MINOR=$(cmake --version | perl -pe '($_)=/([0-9]+([.][0-9]+)+)/' | cut -d '.' -f2)
+ if [ ${CMAKE_VER_MAJOR}=="3" ] && [ ${CMAKE_VER_MINOR} -gt 9 ]; then
+ cecho ${BAD} "Error: deal.II v8.5.1 can not be configured with your cmake version."
+ cecho ${BAD} "Your cmake version is ${CMAKE_VER_MAJOR}.${CMAKE_VER_MINOR}, which is above 3.9."
+ cecho ${BAD} "Please switch the cmake package in candi.cfg on and run candi again!"
+ exit 1
+ fi
+fi
+
+
################################################################################
# Add additional packages, if present