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

[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.
parent 6132d0df
No related branches found
No related tags found
No related merge requests found
...@@ -8,12 +8,24 @@ ...@@ -8,12 +8,24 @@
#include <utility> #include <utility>
#if HAVE_PARMETIS #if HAVE_PARMETIS
// Explicitly use C linkage as scotch does not extern "C" in its headers.
// Works because ParMETIS/METIS checks whether compiler is C++ and otherwise
// does not use extern "C". Therfore no nested extern "C" will be created
extern "C"
{
#include <parmetis.h> #include <parmetis.h>
}
#endif #endif
#if defined(METISNAMEL) && defined(HAVE_METIS) #if defined(METISNAMEL) && defined(HAVE_METIS)
// METISNAMEL is defined when scotch is used and according to christian // METISNAMEL is defined when scotch is used and according to christian
// we have to include the metis header in this case. // we have to include the metis header in this case.
// Explicitly use C linkage as scotch does not extern "C" in its headers.
// Works because ParMETIS/METIS checks whether compiler is C++ and otherwise
// does not use extern "C". Therfore no nested extern "C" will be created
extern "C"
{
#include <metis.h> #include <metis.h>
}
#endif #endif
#include <dune/common/timer.hh> #include <dune/common/timer.hh>
......
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