-
Notifications
You must be signed in to change notification settings - Fork 74
PCNtoolkit from Windows
PCNtoolkit supports Linux and MacOS. If you have Windows please install WSL.
If you are not able to install WSL, there is still possibility to contribute from Windows:
conda install -c conda-forge m2w64-toolchain libpythonThese are required to compile C/C++ extensions when you run a Hierarchical Bayesian Regression (HBR) model.
BLAS (Basic Linear Algebra Subprograms) provides optimized routines for matrix and vector operations and can help speed up the HBR.
Install OpenBLAS into your active conda environment:
conda install -c conda-forge openblasThis places two files in your environment:
-
<env>/Library/lib/openblas.lib- import library, used at link time -
<env>/Library/bin/openblas.dll- shared library, loaded at runtime
Then link pytensor to use BLAS
import sys
import os
from pytensor.configdefaults import config
# sys.prefix returns the root directory of the currently active python environment
conda_lib_path = os.path.join(sys.prefix, "Library", "lib")
config.blas__ldflags = f"-L{conda_lib_path} -lopenblas"Windows does not come with Make pre-installed. Setting it up manually can be complicated, so we generally do not recommend using it directly on Windows. But if you still want to use Make, the easiest way is via Git Bash. Here's how to install it for Git Bash:
Step 1: Download Make
- Go to ezwinports on SourceForge
- Download make-4.4.1-without-guile-w32-bin.zip (or newest version without guile)
Step 2: Install to Git
- Extract the downloaded zip file
- Find your Git installation folder (usually
C:\Users\YourUsername\AppData\Local\Programs\Git\) - Copy the contents of the extracted folders into
Git\mingw64\:-
bin\→Git\mingw64\bin\ -
include\→Git\mingw64\include\ -
lib\→Git\mingw64\lib\ -
share\→Git\mingw64\share\
-
Step 3: Verify Installation in Git Bash
make --versionStep 4: Initialise conda in Git Bash to be able to use it
conda init bashNote: If this does not work, you can manually add the conda initialize block shown below to your
~\.bash_profile:# >>> conda initialize >>> . /c/Users/kontsi/AppData/Local/anaconda3/etc/profile.d/conda.sh # <<< conda initialize <
1 We have not seen improvements in the speed of HBR with BLAS