Skip to content
This repository was archived by the owner on Mar 19, 2021. It is now read-only.

Commit 3be386e

Browse files
authored
[DOC] Update windows instructions (#377)
* Update windows instructions Add warning for MSVC support (vectorized functions) Instructions for GCC on Windows * separate lines [build] -> mingw32 * fix codeblocks * Missing backslash (double) * Comment for msvc vectorization * Fix typo * Add comment on partial support * Fix missing cython
1 parent 8330cef commit 3be386e

File tree

1 file changed

+59
-1
lines changed

1 file changed

+59
-1
lines changed

doc/windows.rst

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,18 @@
66
PyStan on Windows
77
===================
88

9-
PyStan is supported under Windows with the following caveats:
9+
PyStan is partially supported under Windows with the following caveats:
1010

1111
- Python 3.5 or higher must be used.
1212
- 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)
1314

1415
PyStan requires a working C++ compiler. Configuring such a compiler is
1516
typically the most challenging step in getting PyStan running.
1617

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+
1721
Installing Python
1822
=================
1923

@@ -64,3 +68,57 @@ a very simple model::
6468
Again, remember that using ``n_jobs=1`` when calling ``sampling`` is required
6569
as PyStan on Windows does not support sampling using multiple processors in
6670
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

Comments
 (0)