Hi, i am a little stuck, maybe someone can help me. I want to make a static library written in c++ + cuda. I have changed Project->properties->Configuration Properties->General->Configuration type to static library as i would if i were building a regular static lib. However, when i add my cuda code, a weird thing happens (everything is ok without cuda). The projects builds succesfully, but no .lib file is generated - the folder that should contain the result is empty. All the .obj files are built as they should be, but the should-be-resulting library is nowhere to be found.
I also tried adding the “-lib” flag to nvcc command line (is it neccesarry or not?), but this results in this error: “nvcc fatal : More than one compilation phase specified”. I have consulted this with the table of “compilation phase” flags in the nvcc manual, but there is no other of that flags on the command line except for the -lib that i added, so i dont really understand this error. The commnad is:
“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\bin\nvcc.exe” -gencode=arch=compute_20,code="sm_21,compute_20" --use-local-env --cl-version 2008 -ccbin “C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\x86_amd64” -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\include" --keep-dir “x64\Release\” -maxrregcount=32 --machine 64 --compile -lib -Xcompiler "/EHsc /nologo /Od /Zi /MD " -o “x64\Release\mykernell.obj” “C:.…(path to my project)…\mykernell.cu”
I am a little lost, could someone who already created some .lib with CUDA share his workflow, please? Or havent you seen some tutorial on this?