Skip to content

Commit dc66e72

Browse files
committed
docs: Update build instructions
1 parent 706b0da commit dc66e72

10 files changed

+322
-336
lines changed

README.md

+23-13
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,28 @@ Building Gridcoin
1111

1212
These dependencies are required:
1313

14-
Library | Purpose | Description
15-
------------|------------------|----------------------------------------------------------------
16-
pkg-config | Build | Learn library inter-dependencies
17-
libssl | Crypto | Random Number Generation, Elliptic Curve Cryptography
18-
libboost | Utility | Library for threading, data structures, etc
19-
libevent | Networking | OS independent asynchronous networking
20-
miniupnpc | UPnP Support | Firewall-jumping support
21-
qt | GUI | GUI toolkit (only needed when GUI enabled)
22-
libqrencode | QR codes in GUI | Optional for generating QR codes (only needed when GUI enabled)
23-
24-
To build, run
25-
```./autogen.sh && ./configure && make```.
14+
Library | Purpose | Description
15+
-------------|------------------|----------------------------------------------------------------
16+
cmake | Build | Build system (optional)
17+
pkgconf | Build | Learn library inter-dependencies
18+
openssl | Crypto | Random Number Generation, Elliptic Curve Cryptography
19+
libboost | Utility | Library for threading, data structures, etc
20+
libcurl | Utility | URL client library
21+
libzip | Utility | Library for manipulating zip archives
22+
miniupnpc | UPnP Support | Firewall-jumping support (optional)
23+
qt5 | GUI | GUI toolkit (optional)
24+
libqrencode | QR codes in GUI | Library for encoding data in a QR Code symbol (optional, depends on GUI)
25+
26+
To build, run:
27+
28+
* With CMake:
29+
30+
`mkdir build && cmake build && cmake .. && cmake --build .`
31+
32+
* With Autotools:
33+
34+
`./autogen.sh && ./configure && make`
35+
2636
For more detailed and platform-specific instructions, see [the doc folder.](doc/)
2737

2838
Development process
@@ -71,7 +81,7 @@ master if the staging branch is busy.
7181
Community
7282
=========
7383

74-
For general questions, please visit our Discord server at https://discord.gg/jf9XX4a, or Freenode IRC in #gridcoin-help. We also have a Slack channel at [teamgridcoin.slack.com](https://join.slack.com/t/teamgridcoin/shared_invite/zt-3s81akww-GHt~_KvtxfhxUgi3yW3~Bg).
84+
For general questions, please visit our Discord server at https://discord.gg/jf9XX4a, or Libera Chat in #gridcoin-help. We also have a Slack channel at [teamgridcoin.slack.com](https://join.slack.com/t/teamgridcoin/shared_invite/zt-3s81akww-GHt~_KvtxfhxUgi3yW3~Bg).
7585

7686
License
7787
-------

doc/README.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Gridcoin
22
=============
33

44
Setup
5-
---------------------
5+
-----
66
Gridcoin is a free open source project derived from Bitcoin, with
77
the goal of providing a long-term energy-efficient cryptocurrency, rewarding BOINC work.
88
Built on the foundation of Bitcoin, PPCoin and NovaCoin, innovations such as proof-of-stake
@@ -16,16 +16,18 @@ To download Gridcoin, visit [gridcoin.us](https://gridcoin.us).
1616
for help and more information.
1717
* A lot of features core features are based on Bitcoin and have been documented on the [Bitcoin Wiki](https://en.bitcoin.it/wiki/Main_Page)
1818
* For general questions, please visit our Discord server at https://discord.gg/jf9XX4a
19-
* Ask for help or discuss on [#gridcoin](https://webchat.freenode.net?channels=gridcoin) on Freenode
20-
* You can also join us on [Slack](https://join.slack.com/t/teamgridcoin/shared_invite/enQtMjk2NTI4MzAwMzg0LTE4N2I3ZWZjYWJlZGM1Zjg3MTUyMDhiN2M5NmRmZTA2NDA0ZmY1ZTFmOGM3ZGU2YTBkOTdhNTk2ZjkzMGZkODY/)```
19+
* Ask for help or discuss on [#gridcoin](https://web.libera.chat/?channels=#gridcoin) on Libera Chat
20+
* You can also join us on [Slack](https://join.slack.com/t/teamgridcoin/shared_invite/enQtMjk2NTI4MzAwMzg0LTE4N2I3ZWZjYWJlZGM1Zjg3MTUyMDhiN2M5NmRmZTA2NDA0ZmY1ZTFmOGM3ZGU2YTBkOTdhNTk2ZjkzMGZkODY/)
2121

2222
Building
23-
---------------------
23+
--------
2424
The following are developer notes on how to build Gridcoin on your native platform. They are not complete guides, but include notes on the necessary libraries, compile flags, etc.
2525

26+
- [CMake Build Options](cmake-options.md)
2627
- [OS X Build Notes](build-macos.md)
2728
- [Unix Build Notes](build-unix.md)
2829
- [Windows Build Notes](build-windows.md)
30+
- [FreeBSD Build Notes](build-freebsd.md)
2931
- [OpenBSD Build Notes](build-openbsd.md)
3032

3133
Running
@@ -35,15 +37,14 @@ To create a secure environment for running Gridcoin see:
3537
- [Running Gridcoin](running.md)
3638

3739
Development
38-
---------------------
40+
-----------
3941
The Gridcoin repo's [root README](/README.md) contains relevant information on the development process and automated testing.
4042

4143
- [Developer Notes](coding.txt)
4244
- [Release Process](release-process.md)
43-
- [Travis CI](travis-ci.md)
4445

4546
License
46-
---------------------
47+
-------
4748
Distributed under the [MIT software license](/COPYING).
4849
This product includes software developed by the OpenSSL Project for use in the [OpenSSL Toolkit](https://www.openssl.org/). This product includes
4950
cryptographic software written by Eric Young ([[email protected]](mailto:[email protected])), and UPnP software written by Thomas Bernard.

doc/build-freebsd.md

+65-16
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,41 @@ Preparing the Build
99
--------------------
1010

1111
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+
1213
#### General Dependencies
14+
1315
```bash
14-
pkg install autoconf automake boost-libs git gmake libevent libtool pkgconf openssl libzip
16+
pkg install cmake
17+
# or
18+
pkg install autoconf automake gmake libtool
1519

20+
pkg install boost-libs curl db5 leveldb libzip openssl pkgconf secp256k1
1621
```
22+
1723
---
1824
#### GUI Dependencies
25+
1926
```bash
2027
pkg install qt5 libqrencode
2128
```
2229

2330
---
2431
#### Test Suite Dependencies
32+
2533
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:
34+
To run the test suite (recommended), you will need to have the following packages installed:
2735

28-
```bash
29-
pkg install python3
30-
```
36+
* With CMake:
37+
38+
```bash
39+
pkg install vim
40+
```
41+
42+
* With Autotools:
43+
44+
```bash
45+
pkg install python3
46+
```
3147

3248
Clone the repository and cd into it:
3349

@@ -42,19 +58,52 @@ To Build
4258
### 1. Configuration
4359

4460
There are many ways to configure Gridcoin, here are a few common examples:
61+
4562
##### Wallet Support, No GUI:
46-
This explicitly enables wallet support and disables the GUI.
47-
```bash
48-
./autogen.sh
49-
./configure --with-gui=no \
50-
MAKE=gmake
51-
```
63+
This configuration does not enable the GUI.
5264

65+
* With CMake:
66+
67+
```bash
68+
mkdir build && cd build
69+
cmake ..
70+
```
71+
72+
* With Autotools:
73+
74+
```bash
75+
./autogen.sh
76+
./configure --with-gui=no \
77+
MAKE=gmake
78+
```
5379

5480
### 2. Compile
55-
**Important**: Use `gmake` (the non-GNU `make` will exit with an error).
5681

57-
```bash
58-
gmake # use "-j N" for N parallel jobs
59-
gmake check # Run tests if Python 3 is available
60-
```
82+
* With CMake:
83+
84+
```bash
85+
cmake --build . # use "-j N" for N parallel jobs
86+
ctest . # Run tests
87+
```
88+
89+
* With Autotools:
90+
91+
```bash
92+
gmake # use "-j N" for N parallel jobs
93+
```
94+
95+
### 3. Test
96+
97+
* With CMake:
98+
99+
```bash
100+
cmake .. -DENABLE_TESTS=ON
101+
cmake --build .
102+
ctest .
103+
```
104+
105+
* With Autotools:
106+
107+
```bash
108+
gmake check
109+
```

doc/build-macos.md

+72-31
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ macOS comes with a built-in Terminal located in:
1414
/Applications/Utilities/Terminal.app
1515
```
1616
### 1. Xcode Command Line Tools
17+
1718
The Xcode Command Line Tools are a collection of build tools for macOS.
1819
These tools must be installed in order to build Gridcoin from source.
1920

@@ -27,6 +28,7 @@ Upon running the command, you should see a popup appear.
2728
Click on `Install` to continue the installation process.
2829

2930
### 2. Homebrew Package Manager
31+
3032
Homebrew is a package manager for macOS that allows one to install packages from the command line easily.
3133
While several package managers are available for macOS, this guide will focus on Homebrew as it is the most popular.
3234
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.
@@ -35,13 +37,19 @@ Otherwise, you can adapt the commands to your package manager of choice.
3537
To install the Homebrew package manager, see: https://brew.sh
3638

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

4347
```shell
44-
brew install automake libtool boost openssl pkg-config libzip berkeley-db@4
48+
brew install cmake
49+
# or
50+
brew install automake libtool
51+
52+
brew install berkeley-db@5 boost curl leveldb libzip openssl pkgconf secp256k1
4553
```
4654

4755
### 4. Clone Gridcoin repository
@@ -107,11 +115,19 @@ brew install miniupnpc
107115
#### Test Suite Dependencies
108116

109117
There is an included test suite that is useful for testing code changes when developing.
110-
To run the test suite (recommended), you will need to have Python 3 installed:
118+
To run the test suite (recommended), you will need to have the following packages installed:
111119

112-
``` bash
113-
brew install python
114-
```
120+
* With CMake:
121+
122+
```bash
123+
brew install vim
124+
```
125+
126+
* With Autotools:
127+
128+
```bash
129+
brew install python
130+
```
115131

116132
---
117133

@@ -132,32 +148,57 @@ pip3 install ds_store mac_alias
132148

133149
## Build Gridcoin
134150

135-
1. Build Gridcoin:
136-
137-
Prepare the assembly code (requires Perl):
138-
```shell
139-
cd src/
140-
../contrib/nomacro.pl
141-
cd ..
142-
```
143-
144-
Configure and build the headless Gridcoin binaries as well as the GUI (if Qt is found).
145-
```shell
146-
./autogen.sh
147-
./configure
148-
make
149-
```
150-
You can disable the GUI build by passing `--without-gui` to configure.
151-
152-
2. It is recommended to build and run the unit tests:
153-
```shell
154-
make check
155-
```
156-
157-
3. You can also create a `.dmg` that contains the `.app` bundle (optional):
158-
```shell
159-
make deploy
160-
```
151+
1. Prepare the assembly code (requires Perl):
152+
153+
```shell
154+
pushd src
155+
../contrib/nomacro.pl
156+
popd
157+
```
158+
159+
2. Configure and build the Gridcoin binaries:
160+
161+
You can enable the GUI build by passing `-DENABLE_GUI=ON` to CMake or
162+
`--with-gui=qt5` to the configure script.
163+
164+
* With CMake:
165+
166+
```shell
167+
mkdir build && cd build
168+
cmake ..
169+
cmake --build .
170+
```
171+
* With Autotools:
172+
173+
```shell
174+
./autogen.sh
175+
./configure
176+
make
177+
```
178+
179+
3. It is recommended to build and run the unit tests:
180+
181+
* With CMake:
182+
183+
```shell
184+
cmake .. -DENABLE_TESTS=ON
185+
cmake --build .
186+
ctest .
187+
```
188+
189+
* With Autotools:
190+
191+
```shell
192+
make check
193+
```
194+
195+
4. You can also create a `.dmg` that contains the `.app` bundle (optional):
196+
197+
* With Autotools:
198+
199+
```shell
200+
make deploy
201+
```
161202

162203
## Running
163204

0 commit comments

Comments
 (0)