Public bug reported:

The following CMakeLists.txt demonstrate the problem:

```
cmake_minimum_required(VERSION 3.16)
project(capnproto-test CXX)
find_package(CapnProto REQUIRED)
```

When simply running `cmake`, the following error is printed:

```
-- Looking for __atomic_load_8 in atomic
-- Looking for __atomic_load_8 in atomic - not found
CMake Error at 
/usr/lib/x86_64-linux-gnu/cmake/CapnProto/CapnProtoConfig.cmake:108 (message):
  libatomic not found
Call Stack (most recent call first):
  CMakeLists.txt:3 (find_package)
```

If, instead, `CXX` is removed from `project()` call, `cmake` succeeds.

Ryan Ofsky from libmultiprocess project has an analysis available at
[1]. Basically, it's due to CMake's `check_library_exists()` checking
for symbol in C++ namespace instead of C namespace. So I'm not sure if
this is ultimately CMake's or CapnProto's fault. But since
`check_library_exists()` is added by a Debian-specific patch, I file
this issue against CapnProto.

This is CapnProto 1.0.1-4 on Ubuntu 24.04.

[1]:
https://github.com/chaincodelabs/libmultiprocess/issues/68#issuecomment-1135150171

ProblemType: Bug
DistroRelease: Ubuntu 24.04
Package: libcapnp-dev 1.0.1-4
ProcVersionSignature: Ubuntu 6.5.0-35.35~22.04.1-generic 6.5.13
Uname: Linux 6.5.0-35-generic x86_64
ApportVersion: 2.28.1-0ubuntu3
Architecture: amd64
CasperMD5CheckResult: unknown
CloudArchitecture: x86_64
CloudBuildName: server
CloudID: lxd
CloudName: lxd
CloudPlatform: lxd
CloudSerial: 20240608
CloudSubPlatform: LXD socket API v. 1.0 (/dev/lxd/sock)
Date: Fri Jun 14 20:28:34 2024
ProcEnviron:
 LANG=C.UTF-8
 PATH=(custom, no user)
 SHELL=/bin/bash
 TERM=xterm-256color
 XDG_RUNTIME_DIR=<set>
SourcePackage: capnproto
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: capnproto (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug cloud-image noble

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2069474

Title:
  CMake project with C++ part & use CapnProto fails to configure with
  "libatomic not found"

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/capnproto/+bug/2069474/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to