Build error “libatomic not found” on Ubuntu LTS release (24.04) #132

issue ryanofsky openend this issue on January 23, 2025
  1. ryanofsky commented at 5:33 pm on January 23, 2025: collaborator

    Originally posted by @fanquake in https://github.com/bitcoin/bitcoin/issues/30975#issuecomment-2610191420

    Basic usage of building libmultiprocess yourself, on the current Ubuntu LTS release (24.04), for use with Core, doesn’t currently work:

     0<libmultiprocess compiled & installed following instructions>
     1cmake -B build -DWITH_MULTIPROCESS=ON
     2-- The CXX compiler identification is GNU 13.3.0
     3-- Detecting CXX compiler ABI info
     4-- Detecting CXX compiler ABI info - done
     5-- Check for working CXX compiler: /usr/bin/c++ - skipped
     6-- Detecting CXX compile features
     7-- Detecting CXX compile features - done
     8-- Found SQLite3: /usr/include (found suitable version "3.45.1", minimum required is "3.7.17") 
     9-- Looking for __atomic_load_8 in atomic
    10-- Looking for __atomic_load_8 in atomic - not found
    11CMake Error at /usr/lib/aarch64-linux-gnu/cmake/CapnProto/CapnProtoConfig.cmake:108 (message):
    12  libatomic not found
    13Call Stack (most recent call first):
    14  /usr/share/cmake-3.28/Modules/CMakeFindDependencyMacro.cmake:76 (find_package)
    15  /usr/local/lib/cmake/Libmultiprocess/LibmultiprocessConfig.cmake:38 (find_dependency)
    16  CMakeLists.txt:146 (find_package)
    17
    18-- Configuring incomplete, errors occurred!
    

    Having to work around this was also mentioned here: https://github.com/bitcoin/bitcoin/pull/10102#issuecomment-2515554249. We can likely work around this ourselves, but something this basic should be fixed before requiring developers to use this library. Along with reporting & upstreaming fixes to what are now new (hard) dependencies for us.

  2. ryanofsky commented at 5:47 pm on January 23, 2025: collaborator
    To clarify, this error does not happen when running libmultiprocess cmake configuration, but when running another cmake configuration that that calls find_package(Libmultiprocess REQUIRED COMPONENTS Lib). Probably the workaround from https://github.com/chaincodelabs/libmultiprocess/pull/119 could be added to cmake/Config.cmake.in to prevent this
  3. ryanofsky commented at 9:07 pm on January 23, 2025: collaborator

    I tried to reproduce this and couldn’t. Then I realized I accidentally downloaded ubuntu 22.04 not 24.04. Good to know that this issue does not seem to happen with 22.04 though!

    /etc/os-release is VERSION=“22.04.5 LTS (Jammy Jellyfish)” libmultiprocess is 3b2617b3e59f55ae3501c82a62c87f393077779f bitcoin commit is d5a2ba44ba4f23fcf3b3408d28438b7c7013ba36

     0lxc launch ubuntu:jammy ubu
     1lxc image list images:  | grep -i ubuntu
     2lxc exec ubu -- /bin/bash
     3lxc exec ubu -- adduser --shell /bin/bash --ingroup sudo ubu
     4lxc exec ubu -- su - ubu
     5
     6git clone https://github.com/bitcoin/bitcoin
     7git clone https://github.com/chaincodelabs/libmultiprocess
     8sudo apt update
     9sudo apt-get install build-essential cmake pkg-config python3 libevent-dev libboost-dev libsqlite3-dev libcapnp-dev capnproto cmake-curses-gui
    10
    11cd ~/libmultiprocess
    12mkdir build
    13cd build
    14cmake ..
    15make
    16make check # Optionally build and run tests
    17sudo make install
    18
    19cd ~/bitcoin
    20cmake -B build
    21ccmake build # toggle WITH_MULTIPROCESS
    22make -j12 -C build bitcoin-node bitcoin-cli
    23
    24build/src/bitcoin-node -ipcbind=unix:cool -regtes
    25build/src/bitcoin-cli -regtest echoipc hi
    
  4. ryanofsky referenced this in commit 67afc23069 on Jan 23, 2025
  5. ryanofsky commented at 9:31 pm on January 23, 2025: collaborator

    Was able to reproduce this problem with steps above just replacing jammy with noble and using ubuntu VERSION=“24.04.1 LTS (Noble Numbat)”

    Confirmed that applying #133 fixes it

  6. ryanofsky closed this on Jan 27, 2025

  7. ryanofsky referenced this in commit 3dc1d42a7a on Jan 27, 2025


ryanofsky


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/libmultiprocess. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-12-07 10:30 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me