我想在 python 中调用返回 uBLAS vector/矩阵的 C++ 函数。 有一个名为 PyUblas 的包可以做到这一点, 但我无法让它在 Ubuntu 中运行。
任何人都可以引导我完成获得此 sample 的步骤吗?上类?
此外,我对安装 instructions 有点困惑.我没有按照说明安装 boost 和 numpy,因为我已经从 Ubuntu 存储库安装了它们。
最佳答案
我想这并不难。这是我在网站和 test/samply.py 中运行小样本所做的。
下载并解压 PyUblas 并安装必要的库后,cd 进入 PyUblas-VERSION
./configure.py --help
./configure.py --some-options
sudo python setup.py install
cd test/
g++ -I/usr/include/python2.7 -fPIC -g -fpic -shared sample_ext.cpp -lboost_python -lpython2.7 -o sample_ext.so
python sample.py
关于c++ - 让 PyUblas 示例在 Ubuntu 中工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6753788/