BeamMW / beam

Beam: Scalable Confidential Cryptocurrency. Leading the way to Confidential DeFi
https://beam.mw
Apache License 2.0
700 stars 205 forks source link

Raspberry Pi running Debian 11 with kernel 5.10.0-23-arm64 - 3rdparty/asio-ipfs - Unsupported host architecture aarch64 #1951

Closed blackmennewstyle closed 8 months ago

blackmennewstyle commented 1 year ago

I'm trying to build beam on a Raspberry Pi 4 running Debian 11 with kernel 5.10.0-23-arm64. But a 3rd party library seems to have issue with aarch64

cmake -DCMAKE_BUILD_TYPE=Release . && make -j2
On branch testnet
Your branch is up to date with 'origin/testnet'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
  (commit or discard the untracked or modified content in submodules)
    modified:   3rdparty/re2 (untracked content)
    modified:   CMakeLists.txt

no changes added to commit (use "git add" and/or "git commit -a")
BRANCH_NAME: testnet
BEAM_VERSION: 7.2.13564
BEAM_ATOMIC_SWAP_SUPPORT is ON
BEAM_LELANTUS_SUPPORT is ON
BEAM_LASER_SUPPORT is ON
BEAM_CONFIDENTIAL_ASSETS_SUPPORT is ON
BEAM_IPFS_SUPPORT is ON
BEAM_ASSET_SWAP_SUPPORT is ON
BEAM_HW_WALLET is OFF
-- Found Boost: /usr/lib/aarch64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found suitable version "1.74.0", minimum required is "1.66") found components: system filesystem program_options thread regex log locale date_time coroutine 
start libuv
Linux
GNU
-fvisibility=hidden;--std=gnu89;-Wall;-Wextra;-Wstrict-prototypes;-Wno-unused-parameter
-- Found Boost: /usr/lib/aarch64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found suitable version "1.74.0", minimum required is "1.62") found components: coroutine system 
CMake Error at 3rdparty/asio-ipfs/CMakeLists.txt:31 (message):
  Unsupported host architecture aarch64

-- Configuring incomplete, errors occurred!
blackmennewstyle commented 1 year ago

OK. I got it to work. I needed to modify these files: vim ~/beam/CMakeCache.txt

//Build wallet with IPFS support
BEAM_IPFS_SUPPORT:BOOL=OFF

vim ~/beam/CMakeLists.txt

        if(APPLE_M1)
            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=apple-m1")
        else()
            if(ARCH_NATIVE)
                set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
            else()
                set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")

vim ~/beam/3rdparty/re2/CMakeLists.txt

    if(APPLE_M1)
      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=apple-m1")
    else()
      if(ARCH_NATIVE)
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
      else()
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")

The you can proceed with a complete build: cmake -DCMAKE_BUILD_TYPE=Release . && make -j2

It will take a while but at the end you will get beam-node, beam-wallet, wallet-api and explorer-node all built :fire: :rocket:

anatolse commented 1 year ago

Hi, Recently, I also experimented with aarch64 https://github.com/BeamMW/beam/tree/linux_arm64_build and here are builds on github https://github.com/BeamMW/beam/actions/runs/5797278196

blackmennewstyle commented 1 year ago

Hi, Recently, I also experimented with aarch64 https://github.com/BeamMW/beam/tree/linux_arm64_build and here are builds on github https://github.com/BeamMW/beam/actions/runs/5797278196

Thank you for your answer, i actually managed to build everything using the steps i described previously lol It's interesting to know that there is also a branch for arm64 lol