diff mbox series

[RFC] rpm: add PACKAGECONFIG for openmp and disable it by default for native builds

Message ID 20240226142855.2687016-1-martin.jansa@gmail.com
State New
Headers show
Series [RFC] rpm: add PACKAGECONFIG for openmp and disable it by default for native builds | expand

Commit Message

Martin Jansa Feb. 26, 2024, 2:28 p.m. UTC
* and keep it enabled in target builds unless libc-musl where it was
  disabled since upgrade to 4.15.1 in:
  https://git.openembedded.org/openembedded-core/commit/?id=67257ca87c6fa8e6050a20ecea50daf834c7e869
  and disable it for native builds to be able to reuse rpm-native
  between hosts with libomp and without to avoid do_package failures like:
  recipe-sysroot-native/usr/lib/rpm/rpmdeps: error while loading shared libraries: libgomp.so.1: cannot open shared object file: No such file or directory

* and on hosts without libomp it fails in do_configure:
  | CMake Error at /OE/build/tmp-glibc/work/x86_64-linux/rpm-native/4.19.1/recipe-sysroot-native/usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  |   Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)
  |   (Required is at least version "4.5")

* I've noticed this in new experimental gentoo profiles which don't
  enable openmp by default for gcc-13 and newer, see:
  https://bugs.gentoo.org/890999
  https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8189b4b48c25dbd7b330b51b53f9023cdbbb29ec
  https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=94d882482714698d6d9b765920cd26bbe849336d

  I'm not sure what other distributions plan with openmp support in future
  (and this profile is just experimental and the decision not to enable
  openmp by default might still change), but having the PACKAGECONFIG
  at least gives easy way to explicitly enable/disable this in bbappend

  openmp is also explicitly disabled in gettext since 2011:
  https://git.openembedded.org/openembedded-core/commit/?id=e897103a58ad672cc87d2bab3ec45501ef09f8f1

Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
---
 meta/recipes-devtools/rpm/rpm_4.19.1.bb | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Alexander Kanavin Feb. 26, 2024, 2:39 p.m. UTC | #1
This needs to be handled with care. We rely heavily on openmp support in
rpm to speed up rpm operations; adding an option to turn it off is okay,
but actually turning it off is not.


Alex

On Mon 26. Feb 2024 at 15.29, Martin Jansa <martin.jansa@gmail.com> wrote:

> * and keep it enabled in target builds unless libc-musl where it was
>   disabled since upgrade to 4.15.1 in:
>
> https://git.openembedded.org/openembedded-core/commit/?id=67257ca87c6fa8e6050a20ecea50daf834c7e869
>   and disable it for native builds to be able to reuse rpm-native
>   between hosts with libomp and without to avoid do_package failures like:
>   recipe-sysroot-native/usr/lib/rpm/rpmdeps: error while loading shared
> libraries: libgomp.so.1: cannot open shared object file: No such file or
> directory
>
> * and on hosts without libomp it fails in do_configure:
>   | CMake Error at
> /OE/build/tmp-glibc/work/x86_64-linux/rpm-native/4.19.1/recipe-sysroot-native/usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230
> (message):
>   |   Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)
>   |   (Required is at least version "4.5")
>
> * I've noticed this in new experimental gentoo profiles which don't
>   enable openmp by default for gcc-13 and newer, see:
>   https://bugs.gentoo.org/890999
>
> https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8189b4b48c25dbd7b330b51b53f9023cdbbb29ec
>
> https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=94d882482714698d6d9b765920cd26bbe849336d
>
>   I'm not sure what other distributions plan with openmp support in future
>   (and this profile is just experimental and the decision not to enable
>   openmp by default might still change), but having the PACKAGECONFIG
>   at least gives easy way to explicitly enable/disable this in bbappend
>
>   openmp is also explicitly disabled in gettext since 2011:
>
> https://git.openembedded.org/openembedded-core/commit/?id=e897103a58ad672cc87d2bab3ec45501ef09f8f1
>
> Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
> ---
>  meta/recipes-devtools/rpm/rpm_4.19.1.bb | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-devtools/rpm/rpm_4.19.1.bb
> b/meta/recipes-devtools/rpm/rpm_4.19.1.bb
> index 1f8611a29c..477e1c2d62 100644
> --- a/meta/recipes-devtools/rpm/rpm_4.19.1.bb
> +++ b/meta/recipes-devtools/rpm/rpm_4.19.1.bb
> @@ -52,7 +52,7 @@ DEPENDS = "lua libgcrypt file popt xz bzip2 elfutils
> python3 sqlite3 zstd"
>  DEPENDS:append:class-native = " file-replacement-native
> bzip2-replacement-native"
>
>  EXTRA_OECMAKE:append = " -D__CURL:FILEPATH=curl"
> -EXTRA_OECMAKE:append:libc-musl = " -DENABLE_NLS=OFF -DENABLE_OPENMP=OFF"
> +EXTRA_OECMAKE:append:libc-musl = " -DENABLE_NLS=OFF"
>
>  # --sysconfdir prevents rpm from attempting to access machine-specific
> configuration in sysroot/etc; we need to have it in rootfs
>  # --localstatedir prevents rpm from writing its database to native
> sysroot when building images
> @@ -64,10 +64,15 @@ OECMAKE_GENERATOR = "Unix Makefiles"
>
>  BBCLASSEXTEND = "native nativesdk"
>
> -PACKAGECONFIG ??= "internal-openpgp"
> +PACKAGECONFIG_OPENMP = "openmp"
> +PACKAGECONFIG_OPENMP:libc-musl = ""
> +PACKAGECONFIG_OPENMP:class-native = ""
> +
> +PACKAGECONFIG ??= "internal-openpgp ${PACKAGECONFIG_OPENMP}"
>
>  PACKAGECONFIG[plugins] = "-DENABLE_PLUGINS=ON,-DENABLE_PLUGINS=OFF"
>  PACKAGECONFIG[testsuite] = "-DENABLE_TESTSUITE=ON,-DENABLE_TESTSUITE=OFF"
> +PACKAGECONFIG[openmp] = "-DENABLE_OPENMP=ON,-DENABLE_OPENMP=OFF"
>
>  # Deprecated! https://fedoraproject.org/wiki/Changes/RpmSequoia
>  PACKAGECONFIG[internal-openpgp] =
> "-DWITH_INTERNAL_OPENPGP=ON,-DWITH_INTERNAL_OPENPGP=OFF"
> --
> 2.44.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#196205):
> https://lists.openembedded.org/g/openembedded-core/message/196205
> Mute This Topic: https://lists.openembedded.org/mt/104582694/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
Martin Jansa Feb. 26, 2024, 2:47 p.m. UTC | #2
On Mon, Feb 26, 2024 at 3:39 PM Alexander Kanavin
<alex.kanavin@gmail.com> wrote:
>
> This needs to be handled with care. We rely heavily on openmp support in rpm to speed up rpm operations; adding an option to turn it off is okay, but actually turning it off is not.

That's why it was sent only as RFC, do you want me to re-send v2 RFC
with keeping it enabled for native builds or should I wait for more
(unlikely) feedback from others? When explicitly enabled for native it
might start failing on hosts without openmp (where it was autodetected
as disabled until now).

I use package_ipk, so from rpm-native I'm using only the rpmdeps.

This can surely wait for styhead release (as I'm probably the only one
seeing this issue and only with experimental profile).
Alexander Kanavin Feb. 26, 2024, 2:56 p.m. UTC | #3
Just the option, preserving existing behavior please.

Alex

On Mon 26. Feb 2024 at 15.47, Martin Jansa <martin.jansa@gmail.com> wrote:

> On Mon, Feb 26, 2024 at 3:39 PM Alexander Kanavin
> <alex.kanavin@gmail.com> wrote:
> >
> > This needs to be handled with care. We rely heavily on openmp support in
> rpm to speed up rpm operations; adding an option to turn it off is okay,
> but actually turning it off is not.
>
> That's why it was sent only as RFC, do you want me to re-send v2 RFC
> with keeping it enabled for native builds or should I wait for more
> (unlikely) feedback from others? When explicitly enabled for native it
> might start failing on hosts without openmp (where it was autodetected
> as disabled until now).
>
> I use package_ipk, so from rpm-native I'm using only the rpmdeps.
>
> This can surely wait for styhead release (as I'm probably the only one
> seeing this issue and only with experimental profile).
>
diff mbox series

Patch

diff --git a/meta/recipes-devtools/rpm/rpm_4.19.1.bb b/meta/recipes-devtools/rpm/rpm_4.19.1.bb
index 1f8611a29c..477e1c2d62 100644
--- a/meta/recipes-devtools/rpm/rpm_4.19.1.bb
+++ b/meta/recipes-devtools/rpm/rpm_4.19.1.bb
@@ -52,7 +52,7 @@  DEPENDS = "lua libgcrypt file popt xz bzip2 elfutils python3 sqlite3 zstd"
 DEPENDS:append:class-native = " file-replacement-native bzip2-replacement-native"
 
 EXTRA_OECMAKE:append = " -D__CURL:FILEPATH=curl"
-EXTRA_OECMAKE:append:libc-musl = " -DENABLE_NLS=OFF -DENABLE_OPENMP=OFF"
+EXTRA_OECMAKE:append:libc-musl = " -DENABLE_NLS=OFF"
 
 # --sysconfdir prevents rpm from attempting to access machine-specific configuration in sysroot/etc; we need to have it in rootfs
 # --localstatedir prevents rpm from writing its database to native sysroot when building images
@@ -64,10 +64,15 @@  OECMAKE_GENERATOR = "Unix Makefiles"
 
 BBCLASSEXTEND = "native nativesdk"
 
-PACKAGECONFIG ??= "internal-openpgp"
+PACKAGECONFIG_OPENMP = "openmp"
+PACKAGECONFIG_OPENMP:libc-musl = ""
+PACKAGECONFIG_OPENMP:class-native = ""
+
+PACKAGECONFIG ??= "internal-openpgp ${PACKAGECONFIG_OPENMP}"
 
 PACKAGECONFIG[plugins] = "-DENABLE_PLUGINS=ON,-DENABLE_PLUGINS=OFF"
 PACKAGECONFIG[testsuite] = "-DENABLE_TESTSUITE=ON,-DENABLE_TESTSUITE=OFF"
+PACKAGECONFIG[openmp] = "-DENABLE_OPENMP=ON,-DENABLE_OPENMP=OFF"
 
 # Deprecated! https://fedoraproject.org/wiki/Changes/RpmSequoia
 PACKAGECONFIG[internal-openpgp] = "-DWITH_INTERNAL_OPENPGP=ON,-DWITH_INTERNAL_OPENPGP=OFF"