我在一开始运行一个简单的PyMC程序,遇到来了下面3个warning
WARNING (pytensor.configdefaults): g++ not available, if using conda:
conda install m2w64-toolchain
WARNING (pytensor.configdefaults): g++ not detected! PyTensor will be unable to compile C-implementations and will default to Python. Performance may be severely degraded. To remove this warning, set PyTensor flags cxx to an empty string.
WARNING (pytensor.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
第1、2个warning比较容易解决,将g++的目录放到系统路径中。有很多种安装g++的办法,其中我使用的是安装msys2,用pacman安装g++环境,见msys2的文档。
第3个warning是没有显式指定blas库,所以就fallback到了numpy 实现的一种blas。解决办法仍然可以在msys2 中用pacman安装openblas,然后参考
https://pytensor.readthedocs.io/en/latest/troubleshooting.html
配置pytensor使用blas库,我用的是使用文件配置的方法
[blas]
ldflags = -lopenblas
openblas的链接方法参考
https://github.com/OpenMathLib/OpenBLAS/wiki/User-Manual