[英]LINK: fatal error lnk1181: cannot open input file 'id=2.obj'
I'm trying to compile cudamat in my Windows 10, by using VS2015 x64 native tools command prompt.我正在尝试使用 VS2015 x64 本机工具命令提示符在我的 Windows 10 中编译 cudamat。 I've already installed Cuda toolkit 8 as well as Visual Studio 2015 with MSVC compiler.
我已经安装了 Cuda 工具包 8 以及带有 MSVC 编译器的 Visual Studio 2015。 After downloading cudamat, I gave the following command in that directory:
下载 cudamat 后,我在该目录中给出了以下命令:
python setup.py install
python setup.py 安装
When it tries to build cudamat.libcudamat extension, I get the following error by the linker:当它尝试构建 cudamat.libcudamat 扩展时,链接器出现以下错误:
fatal error lnk1181: cannot open input file 'id=2.obj'
致命错误 lnk1181:无法打开输入文件 'id=2.obj'
error: command 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v8.0\\bin\\nvcc.exe' failed with exit status 2
错误:命令“C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v8.0\\bin\\nvcc.exe”失败,退出状态为 2
Could someone help me?有人可以帮助我吗?
If you have this problem, we can assume that earlier compilation of cudamat.obj and cudamat_kernels.obj were succesful.如果你有这个问题,我们可以假设早期的 cudamat.obj 和 cudamat_kernels.obj 编译是成功的。
To make it work, you'll have to do it manually as described here .要使其工作,您必须按照此处所述手动完成。
Long in short:长话短说:
git clone https://github.com/cudamat/cudamat.git
).git clone https://github.com/cudamat/cudamat.git
)。python -c "import sys; print(sys.path)"
)python -c "import sys; print(sys.path)"
检查路径python -c "import sys; print(sys.path)"
) Now you will have to go to this folder and compile dll's manually.现在,您必须转到此文件夹并手动编译 dll。 To do this you have to execute few commands:
为此,您必须执行一些命令:
nvcc -c -O -o cudamat.obj cudamat.cu
nvcc -c -O -o cudamat_kernels.obj cudamat_kernels.cu
nvcc --shared -o libcudamat.dll cudamat.obj cudamat_kernels.obj -lcublas
and then repeat the process changing cudamat to learn and libcudamat.dll to libcudalearn.dll然后重复将 cudamat 更改为学习和 libcudamat.dll 更改为 libcudalearn.dll 的过程
This should already work but if not, you have to tweak your python paths so it can see your new library这应该已经工作了,但如果没有,你必须调整你的 python 路径,以便它可以看到你的新库
Alternatively, you can try also: pip install http://github.com/f0k/cudamat/archive/simplify-compile.zip
或者,您也可以尝试:
pip install http://github.com/f0k/cudamat/archive/simplify-compile.zip
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.