Skip to content
Snippets Groups Projects
Forked from Core Modules / dune-common
Source project has a limited visibility.
  • Dominic Kempf's avatar
    b57a46c0
    [Bugfix][CMake] Fix problem with compatibility layer and parallel builds. · b57a46c0
    Dominic Kempf authored
    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.
    b57a46c0
    History
    [Bugfix][CMake] Fix problem with compatibility layer and parallel builds.
    Dominic Kempf authored
    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.