@@ -6,7 +6,6 @@ Below are some notes on how to build Gridcoin for Windows.
66The options known to work for building Gridcoin on Windows are:
77
88* On Linux, using the [ Mingw-w64] ( https://www.mingw-w64.org/ ) cross compiler tool chain.
9-
109* On Windows, using [ Windows Subsystem for Linux (WSL)] ( https://docs.microsoft.com/windows/wsl/about ) and Mingw-w64.
1110
1211Other options which may work, but which have not been extensively tested are (please contribute instructions):
@@ -16,15 +15,12 @@ Other options which may work, but which have not been extensively tested are (pl
1615Installing Windows Subsystem for Linux
1716---------------------------------------
1817
19- Note that while WSL can be installed with
20- other Linux variants, such as OpenSUSE, the following instructions have only been tested with Ubuntu.
21-
22- [ Follow the upstream installation instructions, available here] ( https://docs.microsoft.com/windows/wsl/install-win10 ) .
18+ Follow the upstream installation instructions, available [ here] ( https://docs.microsoft.com/windows/wsl/install-win10 ) .
2319
2420Cross-compilation for Ubuntu and Windows Subsystem for Linux
2521------------------------------------------------------------
2622
27- The steps below can be performed on Ubuntu or WSL. The depends system
23+ The steps below can be performed on Ubuntu (including in a VM) or WSL. The depends system
2824will also work on other Linux distributions, however the commands for
2925installing the toolchain will be different.
3026
@@ -34,14 +30,6 @@ First, install the general dependencies:
3430 sudo apt upgrade
3531 sudo apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git
3632
37- Then install the mingw-w64 cross-compilation tool chain:
38-
39- sudo apt install g++-mingw-w64-x86-64
40-
41- Or the following to build for 32-bit
42-
43- sudo apt-get install g++-mingw-w64-i686 mingw-w64-i686-dev
44-
4533A host toolchain (` build-essential ` ) is necessary because some dependency
4634packages need to build host utilities that are used in the build process.
4735
@@ -52,27 +40,31 @@ If you want to build the windows installer with `make deploy` you need [NSIS](ht
5240Acquire the source in the usual way:
5341
5442 git clone https://github.com/gridcoin-community/Gridcoin-Research.git
55- cd Gridcoin-Research
5643 git checkout master
44+ cd Gridcoin-Research
5745
5846## Building for 64-bit Windows
5947
60- If on Ubuntu set the default ` mingw32 g++ ` compiler option to POSIX< sup > [ 1 ] ( #footnote1 ) </ sup > :
48+ The first step is to install the mingw-w64 cross-compilation tool chain :
6149
62- sudo update-alternatives --config x86_64-w64-mingw32-g++
50+ sudo apt install g++-mingw-w64-x86-64
51+
52+ Next, set the default ` mingw32 g++ ` compiler option to POSIX:
53+
54+ ```
55+ sudo update-alternatives --config x86_64-w64-mingw32-g++
56+ ```
6357
6458After running the above command, you should see output similar to that below.
6559Choose the option that ends with ` posix ` .
6660
6761```
6862There are 2 choices for the alternative x86_64-w64-mingw32-g++ (providing /usr/bin/x86_64-w64-mingw32-g++).
69-
7063 Selection Path Priority Status
7164------------------------------------------------------------
7265 0 /usr/bin/x86_64-w64-mingw32-g++-win32 60 auto mode
7366* 1 /usr/bin/x86_64-w64-mingw32-g++-posix 30 manual mode
7467 2 /usr/bin/x86_64-w64-mingw32-g++-win32 60 manual mode
75-
7668Press <enter> to keep the current choice[*], or type selection number:
7769```
7870
@@ -101,7 +93,11 @@ Build using:
10193
10294## Building for 32-bit Windows
10395
104- If on Ubuntu set the default ` mingw32 g++ ` compiler option to POSIX<sup >[ 1] ( #footnote1 ) </sup >:
96+ To build executables for Windows 32-bit, install the following dependencies:
97+
98+ sudo apt-get install g++-mingw-w64-i686 mingw-w64-i686-dev
99+
100+ Next, set the default ` mingw32 g++ ` compiler option to POSIX:
105101
106102 sudo update-alternatives --config i686-w64-mingw32-g++ # Set the default mingw32 g++ compiler option to posix.
107103
@@ -140,12 +136,3 @@ way. This will install to `c:\workspace\Gridcoin-Research`, for example:
140136You can also create an installer using:
141137
142138 make deploy
143-
144- Footnotes
145- ---------
146- <a name =" footnote1 " >1</a >: Starting from Ubuntu Xenial 16.04, both the 32 and 64 bit Mingw-w64 packages install two different
147- compiler options to allow a choice between either posix or win32 threads. The default option is win32 threads which is the more
148- efficient since it will result in binary code that links directly with the Windows kernel32.lib. Unfortunately, the headers
149- required to support win32 threads conflict with some of the classes in the C++11 standard library, in particular std::mutex.
150- It's not possible to build the Gridcoin code using the win32 version of the Mingw-w64 cross compilers (at least not without
151- modifying headers in the Gridcoin source code).
0 commit comments