Skip to content

Commit 83a6be2

Browse files
committed
Handle different combinations of METIS/ParMETIS in PETSc.
The basic idea is that we don't want to mix building our own METIS and using PETSc's ParMETIS. The different possibilities are: | Parmetis in PETSc? | yes | no ---------------------- yes | A | B METIS in PETSc? ---------------------- no | C | D A: PETSc was built with both METIS and ParMETIS support. In this case, we use both from PETSc. B: PETSc is built with METIS support but no ParMETIS support. In this case, we use the METIS support and disable ParMETIS. C: PETSc is built with no METIS support, but does have ParMETIS. I'm not sure this is really possible, but in this case, we would build our own METIS and disable ParMETIS support just to avoid mixing them. D: PETSc is built with neither METIS nor ParMETIS support. In this case, we build both on our own. Refs #2029.
1 parent b77ae84 commit 83a6be2

File tree

1 file changed

+38
-5
lines changed

1 file changed

+38
-5
lines changed

m4/parmetis.m4

+38-5
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,48 @@ AC_DEFUN([CONFIGURE_PARMETIS],
1919
dnl where it might be installed...
2020
AS_IF([test "x$enableparmetis" = "xyes"],
2121
[
22-
dnl We always configure for Metis before ParMetis, and we will respect the value of $build_metis
23-
dnl determined there -- if we are using PETSc's Metis, we'll assume we are also using PETSc's ParMetis.
24-
AS_IF([test "x$build_metis" = "xyes"],
22+
dnl We consider 4 different combinations of METIS/ParMETIS support in PETSc.
23+
24+
dnl Case A: PETSc is built with both METIS and ParMETIS support. In this case we use both.
25+
AS_IF([test "x$build_metis" = "xno" && test $petsc_have_parmetis -gt 0],
26+
[
27+
AC_DEFINE(HAVE_PARMETIS, 1,
28+
[Flag indicating whether the library will be compiled with Parmetis support])
29+
AC_MSG_RESULT([<<< Configuring library with PETSc Parmetis support >>>])
30+
])
31+
32+
dnl Case B: PETSc is built with Metis support but no
33+
dnl ParMETIS. We use their METIS and disable ParMETIS support to
34+
dnl avoid mixing.
35+
AS_IF([test "x$build_metis" = "xno" && test $petsc_have_parmetis -eq 0],
36+
[
37+
PARMETIS_INCLUDE=""
38+
PARMETIS_LIB=""
39+
enableparmetis=no
40+
AC_MSG_RESULT([<<< PETSc has METIS but no ParMETIS, configuring library without Parmetis support >>>])
41+
])
42+
43+
dnl Case C: PETSc was not built with METIS, but it was built
44+
dnl with ParMETIS. I'm not sure this is actually possible, but
45+
dnl if it is we will just build our own METIS and disable
46+
dnl ParMETIS support to avoid mixing.
47+
AS_IF([test "x$build_metis" = "xyes" && test $petsc_have_parmetis -gt 0],
48+
[
49+
PARMETIS_INCLUDE=""
50+
PARMETIS_LIB=""
51+
enableparmetis=no
52+
AC_MSG_RESULT([<<< PETSc has no METIS but it does have ParMETIS, configuring library without Parmetis support >>>])
53+
])
54+
55+
dnl Case D: PETSc was not built with METIS or ParMETIS support. We build both on our own.
56+
AS_IF([test "x$build_metis" = "xyes" && test $petsc_have_parmetis -eq 0],
2557
[
2658
PARMETIS_INCLUDE="-I\$(top_srcdir)/contrib/parmetis/include"
2759
PARMETIS_LIB="\$(EXTERNAL_LIBDIR)/libparmetis\$(libext)"
60+
AC_DEFINE(HAVE_PARMETIS, 1,
61+
[Flag indicating whether the library will be compiled with Parmetis support])
62+
AC_MSG_RESULT([<<< Configuring library with internal Parmetis support >>>])
2863
])
29-
AC_DEFINE(HAVE_PARMETIS, 1, [Flag indicating whether the library will be compiled with Parmetis support])
30-
AC_MSG_RESULT(<<< Configuring library with Parmetis support >>>)
3164
],
3265
[
3366
PARMETIS_INCLUDE=""

0 commit comments

Comments
 (0)