@ -226,9 +226,11 @@ invokes cmake commands as needed.
* Install the dependencies
* Install the dependencies
* Change to the root of the source code directory, change to the most recent release branch, and build:
* Change to the root of the source code directory, change to the most recent release branch, and build:
```bash
cd monero
cd monero
git checkout release-v0.14
git checkout release-v0.14
make
make
```
*Optional*: If your machine has several cores and enough memory, enable
*Optional*: If your machine has several cores and enough memory, enable
parallel build by running `make -j<number of threads>` instead of `make`. For
parallel build by running `make -j<number of threads>` instead of `make`. For
@ -252,23 +254,31 @@ invokes cmake commands as needed.
* **Optional**: build and run the test suite to verify the binaries:
* **Optional**: build and run the test suite to verify the binaries:
```bash
make release-test
make release-test
```
*NOTE*: `core_tests` test may take a few hours to complete.
*NOTE*: `core_tests` test may take a few hours to complete.
* **Optional**: to build binaries suitable for debugging:
* **Optional**: to build binaries suitable for debugging:
```bash
make debug
make debug
```
* **Optional**: to build statically-linked binaries:
* **Optional**: to build statically-linked binaries:
```bash
make release-static
make release-static
```
Dependencies need to be built with -fPIC. Static libraries usually aren't, so you may have to build them yourself with -fPIC. Refer to their documentation for how to build them.
Dependencies need to be built with -fPIC. Static libraries usually aren't, so you may have to build them yourself with -fPIC. Refer to their documentation for how to build them.
* **Optional**: build documentation in `doc/html` (omit `HAVE_DOT=YES` if `graphviz` is not installed):
* **Optional**: build documentation in `doc/html` (omit `HAVE_DOT=YES` if `graphviz` is not installed):
```bash
HAVE_DOT=YES doxygen Doxyfile
HAVE_DOT=YES doxygen Doxyfile
```
#### On the Raspberry Pi
#### On the Raspberry Pi
@ -279,24 +289,30 @@ Tested on a Raspberry Pi Zero with a clean install of minimal Raspbian Stretch (
* Install the dependencies for Monero from the 'Debian' column in the table above.
* Install the dependencies for Monero from the 'Debian' column in the table above.
* Increase the system swap size:
* Increase the system swap size:
```
```bash
sudo /etc/init.d/dphys-swapfile stop
sudo /etc/init.d/dphys-swapfile stop
sudo nano /etc/dphys-swapfile
sudo nano /etc/dphys-swapfile
CONF_SWAPSIZE=2048
CONF_SWAPSIZE=2048
sudo /etc/init.d/dphys-swapfile start
sudo /etc/init.d/dphys-swapfile start
```
```
* If using an external hard disk without an external power supply, ensure it gets enough power to avoid hardware issues when syncing, by adding the line "max_usb_current=1" to /boot/config.txt
* If using an external hard disk without an external power supply, ensure it gets enough power to avoid hardware issues when syncing, by adding the line "max_usb_current=1" to /boot/config.txt
* Clone monero and checkout the most recent release version:
* Clone monero and checkout the most recent release version:
* The resulting executables can be found in `build/release/bin`
* The resulting executables can be found in `build/release/bin`
@ -313,28 +329,33 @@ If you are using the older Raspbian Jessie image, compiling Monero is a bit more
* As before, `apt-get update && apt-get upgrade` to install all of the latest software, and increase the system swap size
* As before, `apt-get update && apt-get upgrade` to install all of the latest software, and increase the system swap size
```
```bash
sudo /etc/init.d/dphys-swapfile stop
sudo /etc/init.d/dphys-swapfile stop
sudo nano /etc/dphys-swapfile
sudo nano /etc/dphys-swapfile
CONF_SWAPSIZE=2048
CONF_SWAPSIZE=2048
sudo /etc/init.d/dphys-swapfile start
sudo /etc/init.d/dphys-swapfile start
```
```
* Then, install the dependencies for Monero except `libunwind` and `libboost-all-dev`
* Then, install the dependencies for Monero except `libunwind` and `libboost-all-dev`
* Install the latest version of boost (this may first require invoking `apt-get remove --purge libboost*` to remove a previous version if you're not using a clean install):
* Install the latest version of boost (this may first require invoking `apt-get remove --purge libboost*` to remove a previous version if you're not using a clean install):
sudo ./bjam cxxflags=-fPIC cflags=-fPIC -a install
sudo ./bjam cxxflags=-fPIC cflags=-fPIC -a install
```
```
* Wait ~4 hours
* Wait ~4 hours
* From here, follow the [general Raspberry Pi instructions](#on-the-raspberry-pi) from the "Clone monero and checkout most recent release version" step.
* From here, follow the [general Raspberry Pi instructions](#on-the-raspberry-pi) from the "Clone monero and checkout most recent release version" step.
@ -353,24 +374,32 @@ application.
* Open the MSYS shell via the `MSYS2 Shell` shortcut
* Open the MSYS shell via the `MSYS2 Shell` shortcut
* Update packages using pacman:
* Update packages using pacman:
```bash
pacman -Syu
pacman -Syu
```
* Exit the MSYS shell using Alt+F4
* Exit the MSYS shell using Alt+F4
* Edit the properties for the `MSYS2 Shell` shortcut changing "msys2_shell.bat" to "msys2_shell.cmd -mingw64" for 64-bit builds or "msys2_shell.cmd -mingw32" for 32-bit builds
* Edit the properties for the `MSYS2 Shell` shortcut changing "msys2_shell.bat" to "msys2_shell.cmd -mingw64" for 64-bit builds or "msys2_shell.cmd -mingw32" for 32-bit builds
* Restart MSYS shell via modified shortcut and update packages again using pacman:
* Restart MSYS shell via modified shortcut and update packages again using pacman:
```bash
pacman -Syu
pacman -Syu
```
* Install dependencies:
* Install dependencies:
To build for 64-bit Windows:
To build for 64-bit Windows:
```bash
pacman -S mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake mingw-w64-x86_64-boost mingw-w64-x86_64-openssl mingw-w64-x86_64-zeromq mingw-w64-x86_64-libsodium mingw-w64-x86_64-hidapi
pacman -S mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake mingw-w64-x86_64-boost mingw-w64-x86_64-openssl mingw-w64-x86_64-zeromq mingw-w64-x86_64-libsodium mingw-w64-x86_64-hidapi
```
To build for 32-bit Windows:
To build for 32-bit Windows:
```bash
pacman -S mingw-w64-i686-toolchain make mingw-w64-i686-cmake mingw-w64-i686-boost mingw-w64-i686-openssl mingw-w64-i686-zeromq mingw-w64-i686-libsodium mingw-w64-i686-hidapi
pacman -S mingw-w64-i686-toolchain make mingw-w64-i686-cmake mingw-w64-i686-boost mingw-w64-i686-openssl mingw-w64-i686-zeromq mingw-w64-i686-libsodium mingw-w64-i686-hidapi
```
* Open the MingW shell via `MinGW-w64-Win64 Shell` shortcut on 64-bit Windows
* Open the MingW shell via `MinGW-w64-Win64 Shell` shortcut on 64-bit Windows
or `MinGW-w64-Win64 Shell` shortcut on 32-bit Windows. Note that if you are
or `MinGW-w64-Win64 Shell` shortcut on 32-bit Windows. Note that if you are
* If you would like a specific [version/tag](https://github.com/monero-project/monero/tags), do a git checkout for that version. eg. 'v0.14.1.0'. If you don't care about the version and just want binaries from master, skip this step:
* If you would like a specific [version/tag](https://github.com/monero-project/monero/tags), do a git checkout for that version. eg. 'v0.14.1.0'. If you don't care about the version and just want binaries from master, skip this step:
```bash
git checkout v0.14.1.0
git checkout v0.14.1.0
```
* If you are on a 64-bit system, run:
* If you are on a 64-bit system, run:
```bash
make release-static-win64
make release-static-win64
```
* If you are on a 32-bit system, run:
* If you are on a 32-bit system, run:
```bash
make release-static-win32
make release-static-win32
```
* The resulting executables can be found in `build/release/bin`
* The resulting executables can be found in `build/release/bin`
* **Optional**: to build Windows binaries suitable for debugging on a 64-bit system, run:
* **Optional**: to build Windows binaries suitable for debugging on a 64-bit system, run:
```bash
make debug-static-win64
make debug-static-win64
```
* **Optional**: to build Windows binaries suitable for debugging on a 32-bit system, run:
* **Optional**: to build Windows binaries suitable for debugging on a 32-bit system, run:
```bash
make debug-static-win32
make debug-static-win32
```
* The resulting executables can be found in `build/debug/bin`
* The resulting executables can be found in `build/debug/bin`
@ -448,7 +491,7 @@ We assume you are compiling with a non-root user and you have `doas` enabled.
Note: do not use the boost package provided by OpenBSD, as we are installing boost to `/usr/local`.
Note: do not use the boost package provided by OpenBSD, as we are installing boost to `/usr/local`.
```
```bash
# Create boost building directory
# Create boost building directory
mkdir ~/boost
mkdir ~/boost
cd ~/boost
cd ~/boost
@ -484,7 +527,7 @@ Build the cppzmq bindings.
We assume you are compiling with a non-root user and you have `doas` enabled.
We assume you are compiling with a non-root user and you have `doas` enabled.
```
```bash
# Create cppzmq building directory
# Create cppzmq building directory
mkdir ~/cppzmq
mkdir ~/cppzmq
cd ~/cppzmq
cd ~/cppzmq
@ -504,7 +547,10 @@ cmake ..
doas make install
doas make install
```
```
Build monero: `env DEVELOPER_LOCAL_TOOLS=1 BOOST_ROOT=/usr/local make release-static`
Build monero:
```bash
env DEVELOPER_LOCAL_TOOLS=1 BOOST_ROOT=/usr/local make release-static
```
#### OpenBSD >= 6.4
#### OpenBSD >= 6.4
@ -527,23 +573,27 @@ Then you need to increase the data ulimit size to 2GB and try again: `ulimit -d
The default Solaris linker can't be used, you have to install GNU ld, then run cmake manually with the path to your copy of GNU ld:
The default Solaris linker can't be used, you have to install GNU ld, then run cmake manually with the path to your copy of GNU ld:
* ```make depends target=arm-linux-gnueabihf``` for armv7 binaries. Requires: g++-arm-linux-gnueabihf
* ```make depends target=i686-linux-gnu``` for 32-bit linux binaries.
* ```make depends target=aarch64-linux-gnu``` for armv8 binaries. Requires: g++-aarch64-linux-gnu
* Requires: `g++-multilib bc`
* ```make depends target=i686-w64-mingw32``` for 32-bit windows binaries.
* Requires: `python3 g++-mingw-w64-i686`
* ```make depends target=arm-linux-gnueabihf``` for armv7 binaries.
* Requires: `g++-arm-linux-gnueabihf`
* ```make depends target=aarch64-linux-gnu``` for armv8 binaries.
* Requires: `g++-aarch64-linux-gnu`
The required packages are the names for each toolchain on apt. Depending on your distro, they may have different names.
The required packages are the names for each toolchain on apt. Depending on your distro, they may have different names.
@ -583,7 +639,9 @@ Packages are available for
* Ubuntu and [snap supported](https://snapcraft.io/docs/core/install) systems, via a community contributed build.
* Ubuntu and [snap supported](https://snapcraft.io/docs/core/install) systems, via a community contributed build.
```bash
snap install monero --beta
snap install monero --beta
```
Installing a snap is very quick. Snaps are secure. They are isolated with all of their dependencies. Snaps also auto update when a new version is released.
Installing a snap is very quick. Snaps are secure. They are isolated with all of their dependencies. Snaps also auto update when a new version is released.
@ -593,14 +651,19 @@ Installing a snap is very quick. Snaps are secure. They are isolated with all of
* Void Linux:
* Void Linux:
```bash
xbps-install -S monero
xbps-install -S monero
```
* GuixSD
* GuixSD
```bash
guix package -i monero
guix package -i monero
```
* Docker
* Docker
```bash
# Build using all available cores
# Build using all available cores
docker build -t monero .
docker build -t monero .
@ -612,6 +675,7 @@ Installing a snap is very quick. Snaps are secure. They are isolated with all of
@ -702,13 +774,13 @@ This section contains general instructions for debugging failed installs or prob
We generally use the tool `gdb` (GNU debugger) to provide stack trace functionality, and `ulimit` to provide core dumps in builds which crash or segfault.
We generally use the tool `gdb` (GNU debugger) to provide stack trace functionality, and `ulimit` to provide core dumps in builds which crash or segfault.
* To use gdb in order to obtain a stack trace for a build that has stalled:
* To use `gdb` in order to obtain a stack trace for a build that has stalled:
Run the build.
Run the build.
Once it stalls, enter the following command:
Once it stalls, enter the following command:
```
```bash
gdb /path/to/monerod `pidof monerod`
gdb /path/to/monerod `pidof monerod`
```
```
@ -726,7 +798,9 @@ When it terminates with an output along the lines of "Segmentation fault (core d
You can now analyse this core dump with `gdb` as follows:
You can now analyse this core dump with `gdb` as follows:
`gdb /path/to/monerod /path/to/dumpfile`
```bash
gdb /path/to/monerod /path/to/dumpfile`
```
Print the stack trace with `bt`
Print the stack trace with `bt`
@ -746,7 +820,9 @@ There are two tools available:
Configure Monero with the -D SANITIZE=ON cmake flag, eg:
Configure Monero with the -D SANITIZE=ON cmake flag, eg:
cd build/debug && cmake -D SANITIZE=ON -D CMAKE_BUILD_TYPE=Debug ../..
```bash
cd build/debug && cmake -D SANITIZE=ON -D CMAKE_BUILD_TYPE=Debug ../..
```
You can then run the monero tools normally. Performance will typically halve.
You can then run the monero tools normally. Performance will typically halve.
@ -760,7 +836,9 @@ Instructions for debugging suspected blockchain corruption as per @HYC
There is an `mdb_stat` command in the LMDB source that can print statistics about the database but it's not routinely built. This can be built with the following command:
There is an `mdb_stat` command in the LMDB source that can print statistics about the database but it's not routinely built. This can be built with the following command:
`cd ~/monero/external/db_drivers/liblmdb && make`
```bash
cd ~/monero/external/db_drivers/liblmdb && make
```
The output of `mdb_stat -ea <path to blockchain dir>` will indicate inconsistencies in the blocks, block_heights and block_info table.
The output of `mdb_stat -ea <path to blockchain dir>` will indicate inconsistencies in the blocks, block_heights and block_info table.
make [-jn] debug-test # where n is number of compiler processes
make [-jn] debug-test # where n is number of compiler processes
```
```
@ -17,7 +17,7 @@ Tests are located in `tests/core_tests/`, and follow a straightforward naming co
To run only Monero's core tests (after building):
To run only Monero's core tests (after building):
```
```bash
cd build/debug/tests/core_tests
cd build/debug/tests/core_tests
ctest
ctest
```
```
@ -36,7 +36,7 @@ Tests correspond to components under `src/crypto/`. A quick comparison reveals t
To run only Monero's crypto tests (after building):
To run only Monero's crypto tests (after building):
```
```bash
cd build/debug/tests/crypto
cd build/debug/tests/crypto
ctest
ctest
```
```
@ -53,13 +53,13 @@ To run the same tests on a release build, replace `debug` with `release`.
Functional tests are located under the `tests/functional` directory.
Functional tests are located under the `tests/functional` directory.
First, run a regtest daemon in the offline mode and with a fixed difficulty:
First, run a regtest daemon in the offline mode and with a fixed difficulty:
```
```bash
monerod --regtest --offline --fixed-difficulty 1
monerod --regtest --offline --fixed-difficulty 1
```
```
Alternatively, you can run multiple daemons and let them connect with each other by using `--add-exclusive-node`. In this case, make sure that the same fixed difficulty is given to all the daemons.
Alternatively, you can run multiple daemons and let them connect with each other by using `--add-exclusive-node`. In this case, make sure that the same fixed difficulty is given to all the daemons.
Next, restore a mainnet wallet with the following seed and restore height 0 (the file path doesn't matter):
Next, restore a mainnet wallet with the following seed and restore height 0 (the file path doesn't matter):