0

CMake complains about "No package 'systemd' found" though I have installed systemd on docker container of Ubuntu 20.04. Why cmake is not able to detect the installed pkg

root@e8208b70072e:/opt/dev/sysrepo/build# cmake ..
-- ietf-yang-library revision: 2019-01-04
-- Sysrepo repository: /etc/sysrepo
-- Startup data path:  /etc/sysrepo/data
-- Notification path:  /etc/sysrepo/data/notif
-- YANG module path:   /etc/sysrepo/yang
-- SR plugins path:    /usr/local/lib/sysrepo/plugins
-- SRPD plugins path:  /usr/local/lib/sysrepo-plugind/plugins
Package systemd was not found in the pkg-config search path.
Perhaps you should add the directory containing `systemd.pc'
to the PKG_CONFIG_PATH environment variable
No package 'systemd' found
-- Could NOT find LibSystemd (missing: SYSTEMD_UNIT_DIR)
CMake Warning at CMakeLists.txt:349 (message):
  Disabling sysrepo-plugind systemd support because libsystemd was not found.


-- Configuring done
-- Generating done
-- Build files have been written to: /opt/dev/sysrepo/build

Installed files can be seen below

root@e8208b70072e:/opt/dev# find / -name *libsystemd*
/var/lib/dpkg/info/libsystemd0:amd64.md5sums
/var/lib/dpkg/info/libsystemd0:amd64.shlibs
/var/lib/dpkg/info/libsystemd0:amd64.symbols
/var/lib/dpkg/info/libsystemd0:amd64.list
/var/lib/dpkg/info/libsystemd0:amd64.triggers
/var/lib/dpkg/info/libsystemd-dev:amd64.md5sums
/var/lib/dpkg/info/libsystemd-dev:amd64.list
/usr/share/doc/libsystemd0
/usr/share/doc/libsystemd-dev
/usr/lib/x86_64-linux-gnu/libsystemd.so.0
/usr/lib/x86_64-linux-gnu/libsystemd.so.0.28.0
/usr/lib/x86_64-linux-gnu/libsystemd.so
/usr/lib/x86_64-linux-gnu/pkgconfig/libsystemd.pc
myquest4 sh
  • 371
  • 4
  • 16
  • The error message is about `systemd.pc` file, but you are looking for one prefixed with `lib`. You could easily search for `systemd.pc` file among Ubuntu packages: https://packages.ubuntu.com/search?suite=focal&arch=any&mode=exactfilename&searchon=contents&keywords=systemd.pc. As you can see, that file is provided by `systemd` package. – Tsyvarev Aug 18 '22 at 20:08
  • Did you try to follow the cmake's hint printed *Perhaps you should add the directory containing `systemd.pc' to the PKG_CONFIG_PATH environment variable.*? – Petr Gotthard Sep 27 '22 at 15:24

0 Answers0