Skip to content

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

Closed

Description

@ryanofsky

Originally posted by @fanquake in bitcoin/bitcoin#30975 (comment)

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

<libmultiprocess compiled & installed following instructions>
cmake -B build -DWITH_MULTIPROCESS=ON
-- The CXX compiler identification is GNU 13.3.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found SQLite3: /usr/include (found suitable version "3.45.1", minimum required is "3.7.17") 
-- Looking for __atomic_load_8 in atomic
-- Looking for __atomic_load_8 in atomic - not found
CMake Error at /usr/lib/aarch64-linux-gnu/cmake/CapnProto/CapnProtoConfig.cmake:108 (message):
  libatomic not found
Call Stack (most recent call first):
  /usr/share/cmake-3.28/Modules/CMakeFindDependencyMacro.cmake:76 (find_package)
  /usr/local/lib/cmake/Libmultiprocess/LibmultiprocessConfig.cmake:38 (find_dependency)
  CMakeLists.txt:146 (find_package)

-- Configuring incomplete, errors occurred!

Having to work around this was also mentioned here: bitcoin/bitcoin#10102 (comment).
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.

Activity

  1. ryanofsky commented on Jan 23, 2025

    @ryanofsky
    CollaboratorAuthor

    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 #119 could be added to cmake/Config.cmake.in to prevent this

  2. ryanofsky commented on Jan 23, 2025

    @ryanofsky
    CollaboratorAuthor

    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 3b2617b
    bitcoin commit is d5a2ba44ba4f23fcf3b3408d28438b7c7013ba36

    lxc launch ubuntu:jammy ubu
    lxc image list images:  | grep -i ubuntu
    lxc exec ubu -- /bin/bash
    lxc exec ubu -- adduser --shell /bin/bash --ingroup sudo ubu
    lxc exec ubu -- su - ubu
    
    git clone https://github.com/bitcoin/bitcoin
    git clone https://github.com/chaincodelabs/libmultiprocess
    sudo apt update
    sudo apt-get install build-essential cmake pkg-config python3 libevent-dev libboost-dev libsqlite3-dev libcapnp-dev capnproto cmake-curses-gui
    
    cd ~/libmultiprocess
    mkdir build
    cd build
    cmake ..
    make
    make check # Optionally build and run tests
    sudo make install
    
    cd ~/bitcoin
    cmake -B build
    ccmake build # toggle WITH_MULTIPROCESS
    make -j12 -C build bitcoin-node bitcoin-cli
    
    build/src/bitcoin-node -ipcbind=unix:cool -regtes
    build/src/bitcoin-cli -regtest echoipc hi
  3. added a commit that references this issue on Jan 23, 2025
    67afc23
  4. ryanofsky commented on Jan 23, 2025

    @ryanofsky
    CollaboratorAuthor

    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

  5. added a commit that references this issue on Jan 27, 2025
    3dc1d42
  6. locked and limited conversation to collaborators on Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions