Skip to content

Commit bb2adaf

Browse files
doc: Port newer build documentation from Bitcoin
Co-authored-by: Cy Rossignol <[email protected]>
1 parent 9b378fe commit bb2adaf

File tree

5 files changed

+293
-225
lines changed

5 files changed

+293
-225
lines changed

doc/build-freebsd.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
Building on FreeBSD
2+
--------------------
3+
4+
**Updated for FreeBSD [12.2](https://www.freebsd.org/releases/12.2R/announce.html)**
5+
6+
This guide describes how to build gridcoinresearchd, command-line utilities, and GUI on FreeBSD.
7+
8+
Preparing the Build
9+
--------------------
10+
11+
Install the required dependencies the usual way you [install software on FreeBSD](https://www.freebsd.org/doc/en/books/handbook/ports.html) - either with `pkg` or via the Ports collection. The example commands below use `pkg` which is usually run as `root` or via `sudo`. If you want to use `sudo`, and you haven't set it up: [use this guide](http://www.freebsdwiki.net/index.php/Sudo%2C_configuring) to setup `sudo` access on FreeBSD.
12+
#### General Dependencies
13+
```bash
14+
pkg install autoconf automake boost-libs git gmake libevent libtool pkgconf db5 openssl libzip
15+
16+
```
17+
---
18+
#### GUI Dependencies
19+
```bash
20+
pkg install qt5 libqrencode
21+
```
22+
23+
---
24+
#### Test Suite Dependencies
25+
There is an included test suite that is useful for testing code changes when developing.
26+
To run the test suite (recommended), you will need to have Python 3 installed:
27+
28+
```bash
29+
pkg install python3
30+
```
31+
32+
Clone the repository and cd into it:
33+
34+
``` bash
35+
git clone https://github.com/gridcoin-community/Gridcoin-Research
36+
cd Gridcoin-Research
37+
git checkout master
38+
```
39+
40+
To Build
41+
---------------------
42+
### 1. Configuration
43+
44+
There are many ways to configure Gridcoin, here are a few common examples:
45+
##### Wallet Support, No GUI:
46+
This explicitly enables wallet support and disables the GUI.
47+
```bash
48+
./autogen.sh
49+
./configure --with-gui=no --with-incompatible-bdb \
50+
BDB_LIBS="-ldb_cxx-5" \
51+
BDB_CFLAGS="-I/usr/local/include/db5" \
52+
MAKE=gmake
53+
```
54+
55+
##### No Wallet or GUI
56+
``` bash
57+
./autogen.sh
58+
./configure --without-wallet --with-gui=no MAKE=gmake
59+
```
60+
61+
### 2. Compile
62+
**Important**: Use `gmake` (the non-GNU `make` will exit with an error).
63+
64+
```bash
65+
gmake # use "-j N" for N parallel jobs
66+
gmake check # Run tests if Python 3 is available
67+
```

doc/build-macos.md

Lines changed: 124 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,146 @@
11
# macOS Build Instructions and Notes
22

3+
**Updated for MacOS [11.2](https://www.apple.com/macos/big-sur/)**
4+
5+
This guide describes how to build gridcoinresearchd, command-line utilities, and GUI on macOS
6+
7+
**Note:** The following is for Intel Macs only!
8+
9+
## Preparation
310
The commands in this guide should be executed in a Terminal application.
4-
The built-in one is located at:
11+
macOS comes with a built-in Terminal located in:
12+
513
```
614
/Applications/Utilities/Terminal.app
715
```
16+
### 1. Xcode Command Line Tools
17+
The Xcode Command Line Tools are a collection of build tools for macOS.
18+
These tools must be installed in order to build Gridcoin from source.
819

9-
## Preparation
10-
Install the macOS command line tools:
20+
To install, run the following command from your terminal:
1121

1222
```shell
1323
xcode-select --install
1424
```
1525

16-
When the popup appears, click `Install`.
26+
Upon running the command, you should see a popup appear.
27+
Click on `Install` to continue the installation process.
28+
29+
### 2. Homebrew Package Manager
30+
Homebrew is a package manager for macOS that allows one to install packages from the command line easily.
31+
While several package managers are available for macOS, this guide will focus on Homebrew as it is the most popular.
32+
Since the examples in this guide which walk through the installation of a package will use Homebrew, it is recommended that you install it to follow along.
33+
Otherwise, you can adapt the commands to your package manager of choice.
34+
35+
To install the Homebrew package manager, see: https://brew.sh
1736

18-
Then install [Homebrew](https://brew.sh).
37+
Note: If you run into issues while installing Homebrew or pulling packages, refer to [Homebrew's troubleshooting page](https://docs.brew.sh/Troubleshooting).
38+
### 3. Install Required Dependencies
39+
The first step is to download the required dependencies.
40+
These dependencies represent the packages required to get a barebones installation up and running.
41+
To install, run the following from your terminal:
1942

20-
## Dependencies
2143
```shell
22-
brew install automake libtool boost miniupnpc openssl pkg-config python qt@5 qrencode libzip
44+
brew install automake libtool boost miniupnpc openssl pkg-config libzip
2345
```
2446

25-
If you run into issues, check [Homebrew's troubleshooting page](https://docs.brew.sh/Troubleshooting).
47+
### 4. Clone Gridcoin repository
2648

27-
If you want to build the disk image with `make deploy` (.dmg / optional), you need RSVG:
28-
```shell
29-
brew install librsvg
49+
`git` should already be installed by default on your system.
50+
Now that all the required dependencies are installed, let's clone the Gridcoin repository to a directory.
51+
All build scripts and commands will run from this directory.
52+
53+
``` bash
54+
git clone https://github.com/gridcoin-community/Gridcoin-Research
55+
cd Gridcoin-Research
56+
git checkout master
3057
```
3158

32-
...as well as [`macdeployqtplus`](../contrib/macdeploy/README.md) dependencies:
33-
```shell
34-
pip3 install ds_store mac_alias
59+
### 5. Install Optional Dependencies
60+
61+
#### Wallet Dependencies
62+
Enabling wallet support requires bdb 4.8
63+
``` bash
64+
brew install berkeley-db@4
3565
```
3666

37-
#### Berkeley DB
67+
---
3868

39-
It is recommended to use Berkeley DB 4.8. If you have to build it yourself,
40-
you can use [this](/contrib/install_db4.sh) script to install it
41-
like so:
69+
#### GUI Dependencies
4270

43-
```shell
44-
./contrib/install_db4.sh .
71+
###### Qt
72+
73+
Gridcoin includes a GUI built with the cross-platform Qt Framework.
74+
To compile the GUI, we need to install `qt@5`.
75+
Skip if you don't intend to use the GUI.
76+
77+
``` bash
78+
brew install qt@5
4579
```
4680

47-
from the root of the repository.
81+
Ensure that the `qt@5` package is installed, not the `qt` package.
82+
If 'qt' is installed, the build process will fail.
83+
if installed, remove the `qt` package with the following command:
4884

49-
Also, the Homebrew package could be installed:
85+
``` bash
86+
brew uninstall qt
87+
```
5088

51-
```shell
52-
brew install berkeley-db4
89+
Note: Building with Qt binaries downloaded from the Qt website is not officially supported.
90+
See the notes in [Bitcoin#7714](https://github.com/bitcoin/bitcoin/issues/7714).
91+
92+
###### qrencode
93+
94+
The GUI can encode addresses in a QR Code. To build in QR support for the GUI, install `qrencode`.
95+
Skip if not using the GUI or don't want QR code functionality.
96+
97+
``` bash
98+
brew install qrencode
5399
```
100+
---
54101

55-
## Build Gridcoin
102+
#### Port Mapping Dependencies
56103

57-
1. Clone the Gridcoin source code:
58-
```shell
59-
git clone https://github.com/gridcoin-community/Gridcoin-Research
60-
cd Gridcoin-Research
61-
git checkout master
62-
```
104+
###### miniupnpc
105+
106+
miniupnpc may be used for UPnP port mapping.
107+
Skip if you do not need this functionality.
108+
109+
``` bash
110+
brew install miniupnpc
111+
```
112+
113+
---
114+
115+
#### Test Suite Dependencies
63116

64-
2. Build Gridcoin:
117+
There is an included test suite that is useful for testing code changes when developing.
118+
To run the test suite (recommended), you will need to have Python 3 installed:
119+
120+
``` bash
121+
brew install python
122+
```
123+
124+
---
125+
126+
#### Deploy Dependencies
127+
128+
You can deploy a `.dmg` containing the Gridcoin application using `make deploy`.
129+
This command depends on a couple of python packages, so it is required that you have `python` installed.
130+
131+
Ensuring that `python` is installed, you can install the deploy dependencies by running the following commands in your terminal:
132+
133+
``` bash
134+
brew install librsvg
135+
```
136+
137+
``` bash
138+
pip3 install ds_store mac_alias
139+
```
140+
141+
## Build Gridcoin
142+
143+
1. Build Gridcoin:
65144

66145
Prepare the assembly code (requires Perl):
67146
```shell
@@ -78,34 +157,38 @@ brew install berkeley-db4
78157
```
79158
You can disable the GUI build by passing `--without-gui` to configure.
80159

81-
3. It is recommended to build and run the unit tests:
160+
2. It is recommended to build and run the unit tests:
82161
```shell
83162
make check
84163
```
85164

86-
4. You can also create a `.dmg` that contains the `.app` bundle (optional):
165+
3. You can also create a `.dmg` that contains the `.app` bundle (optional):
87166
```shell
88167
make deploy
89168
```
90169

91-
5. Testnet participation info is found at [Using Testnet](https://wiki.gridcoin.us/OS_X_Guide#Using_Testnet).
92-
93-
To open the app in testnet mode:
94-
```shell
95-
open -a /your/path/to/gridcoinresearch.app --args -testnet
96-
```
97-
98170
## Running
99171

100172
The daemon binary is placed in _src/_ and the GUI client is found in _src/qt/_.
101173
For example, to run the GUI client for production or testnet:
102174

175+
**Important:** [Please read this before using testnet.](https://gridcoin.us/wiki/testnet)
176+
103177
```shell
104178
./src/qt/gridcoinresearch
105179
./src/qt/gridcoinresearch -testnet
106180
./src/qt/gridcoinresearch -printtoconsole -debug -testnet
107181
```
108182

183+
The first time you run Gridcoin, it will start downloading the blockchain. This process could
184+
take several hours.
185+
186+
By default, blockchain and wallet data files will be stored in:
187+
188+
``` bash
189+
/Users/${USER}/Library/Application Support/GridcoinResearch
190+
```
191+
109192
Before running, you may create an empty configuration file:
110193
```shell
111194
mkdir -p "/Users/${USER}/Library/Application Support/GridcoinResearch"
@@ -115,13 +198,7 @@ touch "/Users/${USER}/Library/Application Support/GridcoinResearch/gridcoinresea
115198
chmod 600 "/Users/${USER}/Library/Application Support/GridcoinResearch/gridcoinresearch.conf"
116199
```
117200

118-
The first time you run Gridcoin, it will start downloading the blockchain. This process could
119-
take several hours.
120-
121201
You can monitor the download process by looking at the debug.log file:
122202
```shell
123203
tail -f $HOME/Library/Application\ Support/GridcoinResearch/debug.log
124204
```
125-
126-
## Notes
127-
* Building with downloaded Qt binaries is not officially supported. See the notes in [#7714](https://github.com/bitcoin/bitcoin/issues/7714).

0 commit comments

Comments
 (0)