-
Notifications
You must be signed in to change notification settings - Fork 962
docs: Split Mac install instructions #8648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ddustin
wants to merge
1
commit into
ElementsProject:master
Choose a base branch
from
ddustin:ddustin/mac_install_intel
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -324,30 +324,49 @@ poetry install | |
| make | ||
| ``` | ||
|
|
||
| ## To Build on macOS | ||
| ## To Build on macOS Apple Silicon | ||
|
|
||
| Assuming you have Xcode and Homebrew installed. Install dependencies: | ||
| Assuming you have Xcode and Homebrew installed. | ||
|
|
||
| First confirm which architecture of Mac you are running | ||
| ```shell | ||
| brew install autoconf automake libtool python3 gnu-sed gettext libsodium protobuf lowdown | ||
| export PATH="/usr/local/opt:$PATH" | ||
| arch | ||
| ``` | ||
| If you see this result: `arm64` | ||
| Continue with these instructions. If you see any other result switch to Build on macOS Intel instructions. | ||
|
|
||
| If you need SQLite (or get a SQLite mismatch build error): | ||
|
|
||
| Confirm you are using Apple Silicon Homebrew | ||
| ```shell | ||
| brew install sqlite | ||
| export LDFLAGS="-L/usr/local/opt/sqlite/lib" | ||
| export CPPFLAGS="-I/usr/local/opt/sqlite/include" | ||
| which brew | ||
| which pkg-config | ||
| ``` | ||
| If you see this result: | ||
| ``` | ||
| /opt/homebrew/bin/brew | ||
| /opt/homebrew/bin/pkg-config | ||
| ``` | ||
| You are using Apple Silicon Homebrew and can continue with the instructions, skip to "Install dependencies" | ||
|
|
||
| If you see this in the result: `/usr/local/bin/brew` | ||
| You are using brew in Intel compatibility mode. The simplest solution is to remove brew entirely, reinstall it, and start these instructions over. | ||
|
|
||
| Some library paths are different when using `homebrew` on Macs with Apple silicon, therefore the following two variables need to be set for Macs with Apple silicon: | ||
| Install dependencies: | ||
|
|
||
| ```shell | ||
| brew install autoconf automake libtool python3 gnu-sed gettext libsodium protobuf lowdown pkgconf | ||
| export PATH="/opt/homebrew/opt/:$PATH" | ||
| export CPATH=/opt/homebrew/include | ||
| export LIBRARY_PATH=/opt/homebrew/lib | ||
| ``` | ||
|
|
||
| If you need SQLite (or get a SQLite mismatch build error): | ||
|
|
||
| ```shell | ||
| brew install sqlite | ||
| export LDFLAGS="-L/opt/homebrew/opt/sqlite/lib" | ||
| export CPPFLAGS="-I/opt/homebrew/opt/sqlite/include" | ||
| ``` | ||
|
|
||
| Install uv for Python dependency management: | ||
|
|
||
| ```shell | ||
|
|
@@ -385,6 +404,11 @@ Build lightning: | |
| ```shell | ||
| uv sync --all-extras --all-groups --frozen | ||
| ./configure | ||
| ``` | ||
|
|
||
| If you see `/usr/local` in the log, an Intel compatability dependency has been picked up. The simplest solution is to remove brew entirely, reinstall it, and start these instructions over. | ||
|
|
||
| ```shell | ||
| uv run make | ||
| ``` | ||
|
|
||
|
|
@@ -406,10 +430,88 @@ To install the built binaries into your system, you'll need to run `make install | |
| make install | ||
| ``` | ||
|
|
||
| On a Mac with Apple silicon, you may need to use this command instead: | ||
| You may need to use this command instead. Confirm the exported PATH, CPATH, and LIBRARY_PATH environment varaibles set earlier are still present. | ||
| ```shell | ||
| sudo make install | ||
| ``` | ||
|
|
||
| ## To Build on macOS Intel | ||
|
|
||
| Assuming you have Xcode and Homebrew installed. | ||
|
|
||
| Install dependencies: | ||
|
|
||
| ```shell | ||
| brew install autoconf automake libtool python3 gnu-sed gettext libsodium protobuf lowdown pkgconf | ||
| export PATH="/usr/local/opt/:$PATH" | ||
| export CPATH=/usr/local/include | ||
| export LIBRARY_PATH=/usr/local/lib | ||
| ``` | ||
|
|
||
| If you need SQLite (or get a SQLite mismatch build error): | ||
|
|
||
| ```shell | ||
| brew install sqlite | ||
| export LDFLAGS="-L/usr/local/opt/sqlite/lib" | ||
| export CPPFLAGS="-I/usr/local/opt/sqlite/include" | ||
| ``` | ||
|
Comment on lines
+452
to
+457
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For now, they will also need the openssl library. These lines can go away once #8647 gets merged in. |
||
|
|
||
| Install uv for Python dependency management: | ||
|
|
||
| ```shell | ||
| curl -LsSf https://astral.sh/uv/install.sh | sh | ||
| ``` | ||
|
|
||
| After installing uv, restart your shell or run `source ~/.zshrc` to ensure `uv` is in your PATH. | ||
|
|
||
| If you don't have bitcoind installed locally you'll need to install that as well: | ||
|
|
||
| ```shell | ||
| brew install boost cmake pkg-config libevent | ||
| git clone https://github.com/bitcoin/bitcoin | ||
| cd bitcoin | ||
| cmake -B build | ||
| cmake --build build --target bitcoind bitcoin-cli | ||
| cmake --install build --component bitcoind && cmake --install build --component bitcoin-cli | ||
| ``` | ||
|
|
||
| Clone lightning: | ||
|
|
||
| ```shell | ||
| git clone https://github.com/ElementsProject/lightning.git | ||
| cd lightning | ||
| ``` | ||
|
|
||
| Checkout a release tag: | ||
|
|
||
| ```shell | ||
| git checkout v24.05 | ||
| ``` | ||
|
|
||
| Build lightning: | ||
|
|
||
| ```shell | ||
| sudo PATH="/usr/local/opt:$PATH" LIBRARY_PATH=/opt/homebrew/lib CPATH=/opt/homebrew/include make install | ||
| uv sync --all-extras --all-groups --frozen | ||
| ./configure | ||
| uv run make | ||
| ``` | ||
|
|
||
| Running lightning: | ||
|
|
||
| > 📘 | ||
| > | ||
| > Edit your `~/Library/Application\ Support/Bitcoin/bitcoin.conf`to include `rpcuser=<foo>` and `rpcpassword=<bar>` first, you may also need to include `testnet=1`. | ||
|
|
||
| ```shell | ||
| bitcoind & | ||
| ./lightningd/lightningd & | ||
| ./cli/lightning-cli help | ||
| ``` | ||
|
|
||
| To install the built binaries into your system, you'll need to run `make install`: | ||
|
|
||
| ```shell | ||
| make install | ||
| ``` | ||
|
|
||
| ## To Build on Arch Linux | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we have a version of this in our makefile for Apple Darwin already, so it may just work already? But builds work on my machine...so I'm scared to also take this out of the instruction set for macOS incase this somehow breaks the build for other people lol 👀
Perhaps we should be bold and take it out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Makefile feels like a better place to put this for sure 🤔