fix(packaging): bundle libgomp.so.1 with the engine, like libatomic.so.1

From PR #7189 by @rafal-prasal, applied unchanged.

The source Docker build (tools/docker/Dockerfile.src, BUILD_INKLING=1) stopped at
"strata-inkling needs libgomp.so.1": strata-inkling is linked against OpenMP,
binary_deps.py does not count libgomp as a base system library since 0.2.14, and
collect_libs.py left it to the OS.

- collect_libs.py: libgomp.so.1 joins BUNDLE_FROM_SYSTEM, so it is copied from the
  build machine with its notice, like libatomic.so.1.
- tools/packaging/notices/libgomp.txt: the notice (GPL-3.0-or-later WITH
  GCC-exception-3.1).
- Dockerfile.src: the inkling2 shape passes --include 'licenses/*', so the notice
  travels in the package.
This commit is contained in:
Niko1221 committed 2026-11-25 23:59:41 +01:00
1 parent b28ca95e3e
commit c234774038
3 files changed
+19 -3

No files matched your search

+1 -1
View File
@@ -98,7 +98,7 @@ RUN set -e; \
cp /stage/BUILD.json /stage-inkling/BUILD.json; \
python3 tools/packaging/collect_libs.py --binary "$ink_bin" --search /usr/local/cuda/lib64 --out /stage-inkling --also 'libcublasLt.so*'; \
python3 tools/packaging/package_engine.py --src /stage-inkling --backend cuda --shape inkling2 --version "$ver" --out /shapes/inkling2/engine $archs --arch "compute_$last" \
--min-driver nvidia=$mindriver --variant cuda$cudamajor --platform linux-x86_64 --build-id "docker-source-${ver}-cuda${cudafull}" --include SYSTEM-LIBS.txt; \
--min-driver nvidia=$mindriver --variant cuda$cudamajor --platform linux-x86_64 --build-id "docker-source-${ver}-cuda${cudafull}" --include SYSTEM-LIBS.txt --include 'licenses/*'; \
fi; \
for d in /engine/*/ /shapes/*/engine/*/; do \
[ -d "$d" ] || continue; \
+4 -2
View File
@@ -16,7 +16,9 @@ Distribution libraries (libc, libm, libstdc++, ...) are not copied: they are lis
(libcuda.so.1, libnvidia-*, libze_intel_gpu, libOpenCL ICDs) are never bundled: they belong to the driver.
A distribution library that is not on every system is copied from the build machine all the same (BUNDLE_FROM_SYSTEM, more
with --bundle-system): libatomic.so.1, which TheRock's librocm_sysdeps_numa.so.1 needs; a container with no libatomic1 package
could not start the AMD engine (boxia, 2026-11-15). Its notice goes into licenses/ (packaging/notices/).
could not start the AMD engine (boxia, 2026-11-15). libgomp.so.1 likewise: the Inkling-2 runner strata-inkling is linked against
OpenMP and binary_deps.py no longer counts libgomp as a base system library, so a container with no libgomp1 package could not
start it (the source Docker build stopped at "strata-inkling needs libgomp.so.1", 2026-11-25). Its notice goes into licenses/ (packaging/notices/).
Nothing is downloaded; this only reads files on the build machine.
"""
@@ -48,7 +50,7 @@ DRIVER_PATTERNS = ("libcuda.so*", "libnvidia-*", "libnvcuvid*", "libze_intel_gpu
LDD_LINE = re.compile(r"^\s*(\S+)\s+=>\s+(\S+)\s+\(0x")
#: Distribution libraries that are bundled anyway (by soname glob): not on packaging/binary_deps.py's base list, so a PC without them
#: could not start the engine. Each one has its notice in packaging/notices/<name>.txt, which is copied to <out>/licenses/.
BUNDLE_FROM_SYSTEM = ("libatomic.so.1",)
BUNDLE_FROM_SYSTEM = ("libatomic.so.1", "libgomp.so.1")
NOTICES = Path(__file__).resolve().parent / "notices"
+14
View File
@@ -0,0 +1,14 @@
libgomp.so.1: the GNU OpenMP runtime library, part of the GCC runtime
This engine package carries an unmodified copy of libgomp.so.1 from the build machine. The Inkling-2 runner strata-inkling in this
package needs it (its CPU expert kernels run in OpenMP parallel loops), and some Linux systems (containers, minimal installs) do
not have it.
License: the GNU General Public License, version 3 or later, with the GCC Runtime Library Exception, version 3.1
(SPDX: GPL-3.0-or-later WITH GCC-exception-3.1).
GPL-3.0: https://www.gnu.org/licenses/gpl-3.0.html (GPL-3.txt in this folder when the build machine had it)
GCC Runtime Exception: https://www.gnu.org/licenses/gcc-exception-3.1.html
Copyright: Free Software Foundation, Inc.
Source code: libgomp is in the GCC source tree (https://gcc.gnu.org/, directory libgomp). The exact source of this copy is the
source package of the distribution package named below (for Debian and Ubuntu: `apt-get source` of the gcc package that built it).