Closed james-smith-za closed 1 year ago
meson-python is the glue that lets Meson be used as a PEP 517 backend. When used in that manner, it will detect whether ninja is already installed, and if not, try installing a ninja from pip (which is just a packaged binary uploaded to pip, since ninja is not Python at all). The recommendation from one of the Meson developers is to install ninja from the OS.
So to bump spead2, I would add ninja to the list of packets to apt-get install
in the Dockerfile.
Incidentally, you can remove libboost-system-dev from the installation list, and I think you'll be able to remove libboost-program-options-dev too (it'll mean the binary tools like mcdump
and spead2-bench
don't get installed, but I don't think they go into the final image anyway).
Interesting. That makes a bit more sense.
Incidentally, when I do remove the boost things as you suggest, I get this:
2.777 The Meson build system
2.777 Version: 1.2.1
2.777 Source dir: /tmp/spead2-4.0.0
2.777 Build dir: /tmp/spead2-4.0.0/build
2.777 Build type: native build
2.777 Project name: spead2
2.777 Project version: 4.0.0
2.777 C++ compiler for the host machine: c++ (gcc 11.4.0 "c++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0")
2.777 C++ linker for the host machine: c++ ld.bfd 2.38
2.777 Host machine cpu family: x86_64
2.777 Host machine cpu: x86_64
2.777 Program python3 (jinja2, pycparser, packaging) found: YES (/venv/bin/python) modules: jinja2, pycparser, packaging
2.777 Found pkg-config: /usr/bin/pkg-config (0.29.2)
2.777 Run-time dependency Boost found: YES 1.74.0 (/usr/include)
2.777 Run-time dependency dl found: YES
2.777 Run-time dependency threads found: YES
2.777 Check usable header "libdivide.h" : YES
2.777 Run-time dependency Boost (missing: program_options) found: NO (tried system)
2.777
2.777 meson.build:45:28: ERROR: Dependency "boost" not found, tried system
2.777
2.777 A full log can be found at /tmp/spead2-4.0.0/build/meson-logs/meson-log.txt
------
ERROR: failed to solve: executor failed running [/bin/sh -c SPEAD2_VERSION=$(grep ^spead2== katgpucbf/requirements.txt | cut -d= -f3) && wget "https://github.com/ska-sa/spead2/releases/download/v$SPEAD2_VERSION/spead2-$SPEAD2_VERSION.tar.gz" && tar -zxf "spead2-$SPEAD2_VERSION.tar.gz" && cd "spead2-$SPEAD2_VERSION" && meson setup build && cd build && meson compile && meson install]: exit code: 1
I put back program-options-dev and it seems to have worked now.
Incidentally, when I do remove the boost things as you suggest, I get this:
Ok, that'll be because spead2 defaults to requiring to build the tools (so that people don't get confused about why they're missing if they aren't installed), but if you pass -Dtools=disabled
to meson setup
then it'll skip building them and should be fine without libboost-program-options-dev (build times will also be slightly shorter).
I see here: https://github.com/ska-sa/spead2/pull/246#discussion_r1308085640 and here: https://github.com/ska-sa/spead2/commit/231c3b5fdd5f3e871f03cf34ccd65e548f54c409 that ninja was specifically removed from the requirements.
I'm running into an issue: https://github.com/ska-sa/katgpucbf/blob/1c50f97f977b74206dc1f3c26642e18de35bcf46/Dockerfile#L79
The output from docker build ends up giving me (among other things)
Earlier up I get this:
So ... it didn't look as though ninja got installed?
If I add
meson-python
andninja
to the line in question, then the container image builds. (meson-python
by itself doesn't solve the issue.) I'm not quite clear on the difference betweenmeson
andmeson-python
but neither of them appear to have pulled in ninja.Unless I misunderstood the instructions completely.