我正在尝试在 Windows 10 设备上安装 libgpuarray。他们网站上的说明 here有点困惑,因为我是 Windows 构建和开发的新手。有人可以提供有关安装此软件的说明(假设我知之甚少)吗?
最佳答案
我刚刚成功构建了 libgpuarray...
这是一个有用的页面:Add windows install instructions #264
所以首先,你需要有一个编译器。
我使用的是 Visual Studio 2015,MinGW/MSYS 应该也适用于这个项目,但我不熟悉这些编译器。
其次,您需要在构建之前安装cmake
,只需转到他们的official site即可。并下载它。
我没有尝试其他选项,但如果您使用的是 python,则 libgpuarray 还需要安装 mako
。
然后,仔细按照上面链接中的步骤(复制到这里并附上一些注释)。
Clone the library from GitHub.
Create build folder, open CMake gui (I suggest to run a command like this before using gui:
cmake .. -G "Visual Studio 14 2015 Win64"
, I always got errors using gui to create config)Change CMAKE_INSTALL_PREFIX to libgpuarray/lib (just use the folder you want to install, it defaults to "C:\Program Files\libgpuarray"). Perhaps this should be default on windows.
(I also setCMAKE_BUILD_TYPE=Release
)Configure and generate. (should be no error here)
Open the .sln file with Visual Studio
Build the INSTALL package (needs PR #263)
Manually move the dll's to somewhere in the PATH. Perhaps we should automate this on windows.
如果你不需要为 python 设置,你现在可以停止。
Build the Cython extension (in the libgpuarray root) with:
python setup.py build_ext --compiler=msvc
(before this setup command, you may need to runcall "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
)Install the package with
python setup.py install
希望对您有所帮助。
关于windows - 如何安装 libgpuarray Windows,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43010163/