一 网址汇总
官网:SPAMS
在线文档:for python
GitHub:SPAMS-python
二 安装要求
- 一个 C++ 现代编译器(使用 gcc >= 4.5 测试)
- 安装Xcode:App Store
- 安装 ARM 版 Homebrew
直接执行:
/bin/bash -c "$(curl -fsSL https://gitee.com/ineo6/homebrew-install/raw/master/install.sh)"
设置环境变量:终端输入:
echo $SHELL
通过结果,确定Mac使用zsh作为默认Shell,使用.zprofile,命令:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
- 安装gcc:在终端
brew install gcc
查看gcc版本:
gcc -v
- 一个 BLAS/LAPACK 库(如 OpenBLAS、Intel MKL、Atlas)
- 安装OpenBLAS:在终端
brew install openblas
三 从 PyPI 安装:
标准安装使用 Numpy 使用的 BLAS 和 LAPACK 库:
pip install spams
四 测试:
From Python (assuming spams package is installed):
from spams.tests import test_spams
test_spams('-h') # print the man page
test_spams() # run all tests
test_spams(['sort', 'calcAAt']) # run specific tests
test_spams(python_exec='python3') # specify the python exec
Done.