From f83d6a9368d663cd69309f290d41ee9c7146d2bc Mon Sep 17 00:00:00 2001 From: Alex Lindsay Date: Thu, 2 Jan 2025 11:45:11 -0800 Subject: [PATCH] Add configure support for mfem refs #29632 --- conf_vars.mk.in | 2 ++ configure.ac | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/conf_vars.mk.in b/conf_vars.mk.in index c34b89f41759..4a68aa9f4fc2 100644 --- a/conf_vars.mk.in +++ b/conf_vars.mk.in @@ -3,3 +3,5 @@ libPNG_INCLUDE := @LIBPNG_INCLUDES@ PREFIX := @prefix@ ENABLE_LIBTORCH := @libtorch_support@ LIBTORCH_DIR := @libtorch_library@ +ENABLE_MFEM := @mfem_support@ +MFEM_DIR := @mfem_library@ diff --git a/configure.ac b/configure.ac index 107f1789fe0f..3623c8fdbaa7 100644 --- a/configure.ac +++ b/configure.ac @@ -58,6 +58,28 @@ AS_IF([test "$libtorch_support" = yes], AC_MSG_RESULT([Libtorch library path: $libtorch_library]) ]) +AC_ARG_WITH(mfem, + AS_HELP_STRING([--with-mfem@<:@=ARG@:>@],[Specify if mfem support should be enabled @<:@ARG=yes or mfem directory@:>@]), + [mfem_support=yes mfem_library="$withval"], + [mfem_support=no]) + +AC_MSG_RESULT([configuring with mfem support: $mfem_support]) + +AS_IF([test "$mfem_support" = yes], + [ + AC_DEFINE(MFEM_ENABLED, 1, [Whether to use mfem-related code or not]) + AC_SUBST([mfem_support],[true]) + AS_IF([test "$mfem_library" = yes], + [ + AS_IF([test "${MFEM_DIR+set}" = set], + [mfem_library="${MFEM_DIR}"], + [mfem_library="$ac_pwd/framework/contrib/mfem"]) + ]) + AC_DEFINE_UNQUOTED(MFEM_DIR, [$mfem_library], [The directory where mfem is installed]) + AC_SUBST([mfem_library]) + AC_MSG_RESULT([MFEM library path: $mfem_library]) + ]) + AC_PATH_TOOL(PKG_CONFIG,pkg-config) if test x$PKG_CONFIG != x; then AC_SUBST(LIBPNG)