File: windows.md

package info (click to toggle)
neuron 8.2.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 34,760 kB
  • sloc: cpp: 149,571; python: 58,465; ansic: 50,329; sh: 3,510; xml: 213; pascal: 51; makefile: 35; sed: 5
file content (66 lines) | stat: -rw-r--r-- 2,256 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Windows build

## Pre-requisites

You need to install the following:

*  Git: [https://git-scm.com/](https://git-scm.com/)
*  Chocolatey: [https://chocolatey.org/](https://chocolatey.org/)
*  Visual Studio with C++: [https://visualstudio.microsoft.com/vs/features/cplusplus/](https://visualstudio.microsoft.com/vs/features/cplusplus/)
*  `pwsh` (grab the latest PowerShell release on GitHub: [https://github.com/PowerShell/PowerShell/releases/latest](https://github.com/PowerShell/PowerShell/releases/latest))

## Build Environment installation

You can follow the lines of the scripts from the `ci` folder. The scripts can also be launched as-is for local installation. Perform a git clone of the `nrn` repository.

From a powershell with **administrator** priviledges, run:
```powershell
PS C:\workspace\nrn> .\ci\win_download_deps.cmd
```
This will download all required installers and corresponding versions(`Python`, `MPI`, `nsis`)

Then launch the installation script:
```powershell
PS C:\workspace\nrn> .\ci\win_install_deps.cmd
```
in order to:

* install all downloaded Python versions and for each:
  * fix MSVCC version
  * fix MSVC runtime library
  * install numpy 
* install `nsis` and required plugin
* install MPI
* install MSYS2 (via `Chocolatey`) and then MinGW toolchain and required build pacakages

## How to build NEURON

For a complete `build/install/create setup.exe`, in a `MinGW64` shell you can run:
```bash
$ bash ci/win_build_cmake.sh
```
As you can see in the script, a typical configuration would be:
```bash
/mingw64/bin/cmake .. \
	-G 'Unix Makefiles'  \
	-DNRN_ENABLE_MPI_DYNAMIC=ON  \
	-DNRN_ENABLE_MPI=ON  \
	-DCMAKE_PREFIX_PATH='/c/msmpi'  \
	-DNRN_ENABLE_INTERVIEWS=ON  \
	-DNRN_ENABLE_PYTHON=ON  \
	-DNRN_ENABLE_RX3D=ON  \
	-DNRN_RX3D_OPT_LEVEL=2 \
	-DPYTHON_EXECUTABLE=/c/Python37/python.exe \
	-DNRN_ENABLE_PYTHON_DYNAMIC=ON  \
	-DNRN_PYTHON_DYNAMIC='c:/Python37/python.exe;c:/Python38/python.exe;c:/Python39/python.exe;c:/Python310/python.exe'  \
	-DCMAKE_INSTALL_PREFIX='/c/nrn-install' \
	-DMPI_CXX_LIB_NAMES:STRING=msmpi \
	-DMPI_C_LIB_NAMES:STRING=msmpi \
	-DMPI_msmpi_LIBRARY:FILEPATH=c:/msmpi/lib/x64/msmpi.lib
```
To create the Windows installer, you need to run:
```bash
make install
make setup_exe
```