Skip to content

Building leap for OS X #2413

@bensig

Description

@bensig

Here is a little script that might help anyone trying to build cleos, keosd, and nodeos for OS X on an M* chip.

Requires pyenv and brew

Once you have brew - you can use that to install pyenv

#!/bin/bash

# Script to build and install cleos and keosd from the Antelope Leap repository on macOS

# Function to print messages
echo_message() {
    echo -e "\n==== $1 ====\n"
}

# Step 1: Install prerequisites using Homebrew
echo_message "Installing prerequisites..."
brew install cmake gcc@10 wget gmp automake libtool boost doxygen pyenv

# Ensure Python 3 is set up via pyenv, then install numpy
echo_message "Setting up Python environment..."
pyenv shell 3
pip install numpy

# Step 2: Clone the Leap repository
echo_message "Cloning Antelope Leap repository..."
git clone https://github.com/antelopeio/leap.git
cd leap || exit 1

# Fetch tags and check out the latest release tag
echo_message "Checking out the latest Leap release tag..."
git fetch --all --tags
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
git checkout "$LATEST_TAG"
git pull
git submodule update --init --recursive

# Step 3: Build the project
echo_message "Building the project..."
mkdir build
cd build || exit 1
cmake ..

# Compile using the number of physical cores available
make -j"$(sysctl -n hw.physicalcpu)"

# Step 4: Install cleos and keosd
echo_message "Installing cleos and keosd..."
sudo make install

# Confirmation message
echo_message "Installation complete! cleos and keosd have been installed."
echo "Installed version:"
cleos --version
keosd --version

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions