Skip to content
Snippets Groups Projects
Commit b57a46c0 authored by Dominic Kempf's avatar Dominic Kempf
Browse files

[Bugfix][CMake] Fix problem with compatibility layer and parallel builds.

The compatibility layer disabled MPI whenever it did not find
the --enable-parallel flag. This is overeager and harmful if users
are gradually switching to replacing the configure flags with real
cmake flags.

Consider an opts file, with the following content:
CMAKE_FLAGS="-DUSE_MPI=ON"

The compatibility layer would now parse the non-existent CONFIGURE_FLAGS
variable for an --enable-parallel option and disable MPI because it was
not found. The -DCMAKE_DISABLE_FIND_PACKAGE_MPI=TRUE supersedes the USE_MPI=ON
and we get a sequential build.

The fix applied in this patch removes the else clause and only adds
cmake flags when the --enable-parallel flag was found. To still explicitly
allow to force sequential builds, the --disable-parallel flag is parsed
in the same manner.
parent 2b1a0a03
No related branches found
No related tags found
No related merge requests found
......@@ -21,13 +21,18 @@ dune_common_options_am2cmake()
default_am2cmake_options $CMAKE_PACKAGES
# Check for --enable-parallel and otherwise deactivate MPI
# Check for --enable-parallel and activate MPI
echo $PARAMS | grep \\-\\-enable-parallel > /dev/null
if test "$?" -ne 0 ; then
CMAKE_PARAMS="$CMAKE_PARAMS -DCMAKE_DISABLE_FIND_PACKAGE_MPI=TRUE"
else
CMAKE_PARAMS="$CMAKE_PARAMS -DUSE_MPI=ON"
if test "$?" -eq 0 ; then
CMAKE_PARAMS="$CMAKE_PARAMS -DUSE_MPI=ON"
fi
# Check for --disable-parallel and deactivate MPI if given
echo $PARAMS | grep \\-\\-disable-parallel > /dev/null
if test "$?" -eq 0 ; then
CMAKE_PARAMS="$CMAKE_PARAMS -DCMAKE_DISABLE_FIND_PACKAGE_MPI=TRUE"
fi
# Check for --disable-cxx11check
echo $PARAMS | grep \\-\\-disable-cxx11check > /dev/null
if test "$?" -eq 0 ; then
......
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