简体   繁体   中英

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. I've already installed Cuda toolkit 8 as well as Visual Studio 2015 with MSVC compiler. After downloading cudamat, I gave the following command in that directory:

python setup.py install

When it tries to build cudamat.libcudamat extension, I get the following error by the linker:

fatal error lnk1181: cannot open input file 'id=2.obj'

error: command 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v8.0\\bin\\nvcc.exe' failed with exit status 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.

To make it work, you'll have to do it manually as described here .

Long in short:

  1. First you have to go to directory where you have Cudamat downloaded ( git clone https://github.com/cudamat/cudamat.git ).
  2. Copy cudamat folder (the one where you can find cudamat.py, learn.py and init.py) to your python site-packages folder (you can check the path using python -c "import sys; print(sys.path)" )
  3. Now you will have to go to this folder and compile dll's manually. 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

  4. This should already work but if not, you have to tweak your python paths so it can see your new library

Alternatively, you can try also: pip install http://github.com/f0k/cudamat/archive/simplify-compile.zip

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM