From fbb0da3bc8970954300a87322efd31c6d761262c7afc09c2bbfef0530e796cd4 Mon Sep 17 00:00:00 2001 From: Nicolas Morey Date: Sat, 7 Sep 2024 11:53:46 +0000 Subject: [PATCH] - Add autogen-only-deal-with-json-yaksa-if-enabled.patch to use system version of libjson-c. OBS-URL: https://build.opensuse.org/package/show/science:HPC/mvapich3?expand=0&rev=6 --- ...only-deal-with-json-yaksa-if-enabled.patch | 47 +++++++++++++++++++ mvapich3.changes | 6 +++ mvapich3.spec | 10 ++-- 3 files changed, 58 insertions(+), 5 deletions(-) create mode 100644 autogen-only-deal-with-json-yaksa-if-enabled.patch diff --git a/autogen-only-deal-with-json-yaksa-if-enabled.patch b/autogen-only-deal-with-json-yaksa-if-enabled.patch new file mode 100644 index 0000000..6142ee3 --- /dev/null +++ b/autogen-only-deal-with-json-yaksa-if-enabled.patch @@ -0,0 +1,47 @@ +commit f52bf4f26caeee6452aea2b38c6702543be19ba4 +Author: Nicolas Morey +Date: Sat Sep 7 13:09:18 2024 +0200 + + autogen: only deal with json/yaksa if enabled + + --without-(json|yaksa) is partially ignored as submodule is not + checked but still configured + + Signed-off-by: Nicolas Morey + +diff --git configure.ac configure.ac +index 51ddb3952c4b..163cb29bcee9 100644 +--- configure.ac ++++ configure.ac +@@ -1428,14 +1428,23 @@ AC_SUBST([jsonsrcdir]) + jsonlib="" + AC_SUBST([jsonlib]) + +-PAC_PUSH_ALL_FLAGS() +-PAC_RESET_ALL_FLAGS() +-PAC_CONFIG_SUBDIR_ARGS([modules/json-c],[--enable-embedded --disable-werror],[],[AC_MSG_ERROR(json-c configure failed)]) +-PAC_POP_ALL_FLAGS() +-jsonsrcdir="${main_top_builddir}/modules/json-c" +-jsonlib="${main_top_builddir}/modules/json-c/libjson-c.la" +-PAC_APPEND_FLAG([-I${use_top_srcdir}/modules/json-c],[CPPFLAGS]) +-PAC_APPEND_FLAG([-I${main_top_builddir}/modules/json-c],[CPPFLAGS]) ++PAC_CHECK_HEADER_LIB([json-c/json.h], [json-c], [json_object_get], [have_json=yes], [have_json=no]) ++if test "${have_json}" = "no" ; then ++ AC_MSG_NOTICE([Using an embedded libjson-c])PAC_PUSH_ALL_FLAGS() ++ PAC_RESET_ALL_FLAGS() ++ PAC_CONFIG_SUBDIR_ARGS([modules/json-c],[--enable-embedded --disable-werror],[], ++ [AC_MSG_ERROR(json-c configure failed)]) ++ PAC_POP_ALL_FLAGS() ++ jsonsrcdir="${main_top_builddir}/modules/json-c" ++ jsonlib="${main_top_builddir}/modules/json-c/libjson-c.la" ++ PAC_APPEND_FLAG([-I${use_top_srcdir}/modules/json-c],[CPPFLAGS]) ++ PAC_APPEND_FLAG([-I${main_top_builddir}/modules/json-c],[CPPFLAGS]) ++else ++ AC_MSG_NOTICE([Using an external libjson-c]) ++ PAC_APPEND_FLAG([-I/usr/include/json-c],[CPPFLAGS]) ++ PAC_APPEND_FLAG([-ljson-c],[WRAPPER_LIBS]) ++fi ++ + + # ---------------------------------------------------------------------------- + # HWLOC diff --git a/mvapich3.changes b/mvapich3.changes index 654429c..738db54 100644 --- a/mvapich3.changes +++ b/mvapich3.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat Sep 7 11:12:27 UTC 2024 - Nicolas Morey + +- Add autogen-only-deal-with-json-yaksa-if-enabled.patch to use + system version of libjson-c. + ------------------------------------------------------------------- Tue Feb 20 13:54:55 UTC 2024 - Nicolas Morey diff --git a/mvapich3.spec b/mvapich3.spec index 63f4577..8c4f594 100644 --- a/mvapich3.spec +++ b/mvapich3.spec @@ -1,7 +1,7 @@ # # spec file # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -191,6 +191,7 @@ Patch2: mpl-warnings-missing-return.patch Patch3: mpi-coll-missing-return.patch Patch4: autoconf-pull-dynamic-and-not-static-libs-from-pkg-config.patch Patch5: config-replace-AC_TRY_-COMPILE-LINK-RUN.patch +Patch6: autogen-only-deal-with-json-yaksa-if-enabled.patch URL: http://mvapich.cse.ohio-state.edu BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -211,10 +212,10 @@ BuildRequires: hwloc-devel >= 2.0 %ifnarch s390 s390x %{arm} BuildRequires: libnuma-devel %endif +BuildRequires: libjson-c-devel BuildRequires: libtool -BuildRequires: libtool -BuildRequires: sysfsutils BuildRequires: python3 +BuildRequires: sysfsutils %if %{without hpc} BuildRequires: gcc-c++ BuildRequires: gcc-fortran @@ -318,7 +319,6 @@ is based on MPICH2 and MVICH. This package contains the static libraries cp /usr/share/automake*/config.* . - %build %global _lto_cflags %{_lto_cflags} -ffat-lto-objects @@ -327,7 +327,7 @@ cp /usr/share/automake*/config.* . export FFLAGS="-fallow-argument-mismatch $FFLAGS" %endif -./autogen.sh --without-ucx --without-ofi +./autogen.sh --without-ucx --without-ofi --without-json %if %{with hpc} %{hpc_setup} %{hpc_configure} \