|
6 | 6 | PyStan on Windows
|
7 | 7 | ===================
|
8 | 8 |
|
9 |
| -PyStan is supported under Windows with the following caveats: |
| 9 | +PyStan is partially supported under Windows with the following caveats: |
10 | 10 |
|
11 | 11 | - Python 3.5 or higher must be used.
|
12 | 12 | - When drawing samples ``n_jobs=1`` must be used. (PyStan on Windows cannot use multiple processors in parallel.)
|
| 13 | +- Vectorized functions are not supported with MSVC (see GCC section) |
13 | 14 |
|
14 | 15 | PyStan requires a working C++ compiler. Configuring such a compiler is
|
15 | 16 | typically the most challenging step in getting PyStan running.
|
16 | 17 |
|
| 18 | +Due to problems with MSVC template deduction, functions with Eigen library are failing. Until this bug is fixed no full support is provided for Windows + MSVC. Currently, no fix is known for this problem, other than to change the compiler to GCC. |
| 19 | + |
| 20 | + |
17 | 21 | Installing Python
|
18 | 22 | =================
|
19 | 23 |
|
@@ -64,3 +68,57 @@ a very simple model::
|
64 | 68 | Again, remember that using ``n_jobs=1`` when calling ``sampling`` is required
|
65 | 69 | as PyStan on Windows does not support sampling using multiple processors in
|
66 | 70 | parallel.
|
| 71 | + |
| 72 | + |
| 73 | +GCC on Windows |
| 74 | +============== |
| 75 | + |
| 76 | +For full support of vectorized functions, the user must use GCC compiler. |
| 77 | + |
| 78 | +Supported GCC compilers |
| 79 | + |
| 80 | +- Python 2.7 and <=3.4 : mingw32 |
| 81 | +- Python 3.5=< : `MSYS2 mingw-w64` |
| 82 | + |
| 83 | +For mingw32 installation see |
| 84 | +http://docs.cython.org/en/latest/src/tutorial/appendix.html |
| 85 | + |
| 86 | +or with conda use:: |
| 87 | + |
| 88 | + conda install mingw32 libpython |
| 89 | + |
| 90 | +Setting up mingw-w64 on Windows |
| 91 | +=============================== |
| 92 | + |
| 93 | +Install Python with either Anaconda or Miniconda |
| 94 | + |
| 95 | +- Anaconda https://www.anaconda.com/download/ |
| 96 | +- Miniconda https://conda.io/miniconda.html |
| 97 | + |
| 98 | +Create an virtual conda-environment [OPTIONAL]:: |
| 99 | + |
| 100 | + conda create -n stan_env python=3.6 |
| 101 | + |
| 102 | +Activate conda-env [OPTIONAL]:: |
| 103 | + |
| 104 | + activate stan_env |
| 105 | + |
| 106 | +Install `libpython` and `m2w64-toolchain` packages:: |
| 107 | + |
| 108 | + conda install libpython |
| 109 | + conda install -c msys2 m2w64-toolchain |
| 110 | + |
| 111 | +In `PYTHONPATH\\Lib\\distutils` create `distutils.cfg` with text editor (e.g. `notepad`, `notepad++`) and add the following lines:: |
| 112 | + |
| 113 | + [build] |
| 114 | + mingw32 |
| 115 | + |
| 116 | +To find the correct `distutils` path, run `python`:: |
| 117 | + |
| 118 | + >>> import distutils |
| 119 | + >>> print(distutils.__file__) |
| 120 | + |
| 121 | +Finally, install other packages:: |
| 122 | + |
| 123 | + conda install numpy cython matplotlib |
| 124 | + pip install pystan |
0 commit comments