[repartition] fix problems when using libscotchparmetis
(cherry picked from commit 2b1abd0f432c433f840174afd7e1e70209d16848)

Signed-off-by: Markus Blatt <markus@dr-blatt.de>
[bugfix] Fixes usage of scotch (parmetis/metis)

There were problems with repartition.hh when using the original parmetis. The cause was
that for scotch we need to require both parmetis.h and metis.h, which broke backwards
compatibility for the original parmetis (which worked without metis, too). With the patch
we check whether parmetis.h is from scotch and if that is the case also require metis. If not,
metis suffices.

(cherry picked from commit ba0f24fae420a74d778f4ddadf54e3cb02711129)
Signed-off-by: Markus Blatt <markus@dr-blatt.de>
[cmake] Also check for Metis (needed for scotch's parmetis) as with autotools.

(cherry picked from commit 4c68085c440c4370424a12c9cf849ce43153dfdf)
Signed-off-by: Markus Blatt <markus@dr-blatt.de>
[bugfix] Fix macros for the case that HAVE_METIS is not defined.

For HAVE_METIS we do not use the ENABLE trick. It is therefore either defined or
not. Therfore using "#if HAVE_METIS" is a bug. This patch fixes this.

(cherry picked from commit 5b8a375bd998eaebcb68991b02fa0fecea7f38b7)
Signed-off-by: Markus Blatt <markus@dr-blatt.de>
[cmake] Activate test for METIS and use it where appropriate.

Just like for the autotools.

(cherry picked from commit 901b595479c2086f1bb3ff97b2bcfdcb72b2bb1c)
Signed-off-by: Markus Blatt <markus@dr-blatt.de>
[autotools] Use METIS flags where appropriate.

(cherry picked from commit 6132d0df82c635597f464ca28be64a8e01c1051e)
Signed-off-by: Markus Blatt <markus@dr-blatt.de>
[bugfix] Use exter "C" to fix linker errors wit scotch.

Unlike the original METIS/ParMETIS scotch does not use extern "C"
in its headers. This lead to linker errors as descibed in
http://lists.dune-project.org/pipermail/dune/2014-March/012745.html.
This patch fixes this by guarding the includes with an extra extern "C"
directive.

(cherry picked from commit 7f0bcfd1078c2f1105ccafdda0b44e648caee84f)
Signed-off-by: Markus Blatt <markus@dr-blatt.de>
Manually reverted unneeded include of metis.h

(cherry picked from commit eb57e1c1006052654fad4fb5b0c27543963c4c34)
Signed-off-by: Markus Blatt <markus@dr-blatt.de>
Revert "[autotools] Use METIS flags where appropriate."

This reverts commit 6132d0df82c635597f464ca28be64a8e01c1051e.
It (METIS) does not seem needed for compilation and the patch
forced the user and downstream modules to add additional compile
 and linker flags.

(cherry picked from commit 1b7c8926f34e360a4509f4b8f4c65131181482e8)
Signed-off-by: Markus Blatt <markus@dr-blatt.de>
Revert "[cmake] Activate test for METIS and use it where appropriate."

This reverts commit 901b595479c2086f1bb3ff97b2bcfdcb72b2bb1c.
It (METIS) does not seem needed for compilation and the patch
forced the user and downstream modules to add additional compile
 and linker flags.

(cherry picked from commit 9e031534f0c5ba05690d501841ba25f682fbf210)
Signed-off-by: Markus Blatt <markus@dr-blatt.de>
[bugfix,parmetis] Remove erroneous undef of HAVE_MPI

This was introduced for debugging only and could have side effects
onto other headers. Removes the accidentally committed line.

(cherry picked from commit 15615c2baf83e1c37c4e8b0aa129600d2e177c8f)
Signed-off-by: Markus Blatt <markus@dr-blatt.de>
[bugfix,parmetis] Always typedef idxtype.

The type idxtype is used by header repartition even if parmetis is not
used. Therefore it has to be typedefed meaningful in this case,
too. This was not the case before and is accomplished by this commit.

(cherry picked from commit f8a19fb0b9e03a719fa21c21177a878cc5d0fb7a)
Signed-off-by: Markus Blatt <markus@dr-blatt.de>