You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/getting-started/building-the-node-on-windows.md
+141-53
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,7 @@
2
2
3
3
This document explains how to build a __DEVELOPMENT__ version of the `cardano-node`. Note that this is *not* for building a __PRODUCTION__ version of the node.
4
4
5
-
We recommend installing and using `git-bash` for development purposes, which is `git` when installed with `choco install git`.
6
-
5
+
See [install.md](./install.md) for a more thorough explanation of the dependencies and packages that have to be installed to run a node. Although the installation instructions in that document are aimed at building on Linux, large parts of the text are interesting to Windows users as well.
7
6
8
7
## Install the Haskell environment
9
8
@@ -18,90 +17,173 @@ ghcup set ghc 8.10.7
18
17
ghcup set cabal 3.6.2.0
19
18
```
20
19
21
-
Alternatively, with `ghcup tui` you can pick the specific versions of the tools that you want to install, in particular you should have installed and set:
22
-
-`cabal >= 3.6.2.0`
23
-
-`GHC >= 8.10.7`
24
-
25
-
## Install pkg-config
26
-
27
-
To start building on `Windows`, you will need to install and configure specific tools outlined below. We recommend using [chocolatey](https://chocolatey.org), which provides the `choco` command to install some of these tools. You can run all the instructions that invoke `choco` in bash with root privileges.
20
+
## Install MSYS2 and basic dependencies
28
21
22
+
### GHCUP and MSYS2
23
+
24
+
Note that the GHCUP comes with its own installation for MSYS2, and it can be used to build `cardano-node`. You can start the MSYS2 shell with
Alternatively, you can update the `mingw64` tool-chain, that adds number of packages including latest `gcc`. This may give rise to `crt` linker error. Please read the [section - global cabal configuration](#global-cabal-configuration) to mitigate the error.
45
+
46
+
```bash
47
+
pacman -S mingw-w64-x86_64-toolchain
31
48
```
32
49
33
-
##Install vcpkg
50
+
### Installing MSYS independently
34
51
35
-
You will first need to install `vcpkg` to proceed installing necessary libraries (which is the next step).
52
+
Go to [the MSYS2 website](https://www.msys2.org/) and follow its instructions to install MSYS2. It will also install `pacman`. Then, update and upgrade all `pacman` packages and install basic dependencies:
For this, use `git`(which you can also install using `choco`) and follow [these instructions](https://github.com/microsoft/vcpkg#quick-start-windows).
59
+
## Installing and configuring third party libraries
60
+
You can use `vcpkg`, or `pacman` or both to install third party libraries. Following are the dependencies for `cardano-node`.
- You can also use `x64-mingw-dynamic` for `VCPKG_DEFAULT_TRIPLET`, if you'd like to use shared libraries
78
+
- Install libraries
79
+
```bash
80
+
vcpkg install libsodium
81
+
vcpkg install openssl
82
+
vcpkg install lmdb
83
+
```
84
+
-__cardano-crypto-class__ uses several features of `secp256k1` that are not compiled into `vcpkg` package. Hence it needs to be compiled separately.
85
+
-`vcpkg` generates `pkg-config` when it can. It generates configuration for `openssl`. To avoid mixing configurations with existing system, you can use following to install packages
If `unzip` complains that `../secp256k1.zip` is not a zip file, unzip the
116
+
file manually in the explorer by choosing the option to unzip from the
117
+
right-click menu.
48
118
49
-
To find system dependencies like `libsodium`, `cabal` uses `pkg-config`. On Windows, you will need to create the `libsodium.pc` description file in a correct directory.
119
+
### Managing package configuration
120
+
Make sure that package configurations are correectly installed. If you are using chocolatey or other tool, it may be possible that more than one `pkg-config` tools are installed. You are encouraged to use `pkg-config` that __MSYS2__ has to minimize the error. Also make sure that the pkg configuration are discoverable by checking that `pkg-config --list-all` lists all the installed packages.
121
+
122
+
Note that the pkg-config will only look in the paths pointed to by `pkg-config --variable pc_path pkg-config`. Also check if pkg-config correctly displays library path, by checking `pkg-config --variable libdir <pkg-name>`. In case, the path is incorrectly displayed, modify the file `pkg-config --path <pkg-name>` to correct the path.
> Note that you need to replace `VCPKG_PATH` with the absolute path, where you use `vcpkg`, and `LIBSODIUM_VERSION` with the version number of `libsodium` which was installed on your system. Please verify that the paths above contain `libsodium.dll` file and headers.
68
125
69
-
> Also, you cannot use `prefix=` in the `libsodium.pc` file. This might be changed for some other directory, `pkg-config` provides a switch to use the provided `prefix`, but there is no way to instruct `cabal`to do so.
126
+
## Global `cabal`configuration
70
127
71
-
Follow the same procedure of creating `.pc` files for `openssl`, `secp256k1` and `lmdb`.
128
+
Modify the following entries to your global `cabal` config file in your
129
+
`\path\to\cabal\` directory, such that they look like this:
Go to the directory, where you cloned the `cardano-node` repository and add the command below to your `cabal.project.local` file (if you don't already have it, create one):
0 commit comments