[CMake] Cuda CUDA_SEPARABLE_COMPILATION errors during linking

Wesley Smith wesley.hoke at gmail.com
Mon Apr 20 13:40:46 EDT 2015


Apparently there's a bug report and fix for this:
http://www.cmake.org/Bug/view.php?id=15016

But the fix hasn't been committed anywhere.  It has been lingering in
limbo for almost 9 months.
Thanks!!
wes

On Fri, Apr 17, 2015 at 4:20 PM, Wesley Smith <wesley.hoke at gmail.com> wrote:
> With CUDA_SEPARABLE_COMPILATION enabled, I'm always getting linking
> errors when I try to build.  Seems it's looking for a directory that
> doesn't exist:
> '<snip>/build/CMakeFiles/SlicerLib.dir/Debug
>
> If I manually create this directory, everything works.  Seems that
> either the directory path isn't being computed properly or that code
> to create the directory if needed is missing.
>
> wes
>
>
> 2>C:\Program Files\NVIDIA GPU Computing
> Toolkit\CUDA\v7.0\bin\crt\link.stub : fatal error C1083: Cannot open
> compiler generated file:
> '<snip>/build/CMakeFiles/SlicerLib.dir/Debug/SlicerLib_intermediate_link.obj':
> No such file or directory
> 2>C:\Program Files
> (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(127,5):
> error MSB3073: The command "setlocal
> 2>C:\Program Files
> (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(127,5):
> error MSB3073: "C:\Program Files (x86)\CMake\bin\cmake.exe" -E echo
> "Building NVCC intermediate link file
> CMakeFiles/SlicerLib.dir/Debug/SlicerLib_intermediate_link.obj"
> 2>C:\Program Files
> (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(127,5):
> error MSB3073: if %errorlevel% neq 0 goto :cmEnd
> 2>C:\Program Files
> (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(127,5):
> error MSB3073: "C:\Program Files\NVIDIA GPU Computing
> Toolkit\CUDA\v7.0\bin\nvcc.exe" -arch=sm_30 -m64 -ccbin "C:\Program
> Files (x86)\Microsoft Visual Studio 12.0\VC\bin" -Xcompiler /MDd
> -dlink <snip>/build/CMakeFiles/SlicerLib.dir/src/bitmap/fragCounter/Debug/SlicerLib_generated_amFragCounterCuda.cu.obj
> <snip>/build/CMakeFiles/SlicerLib.dir/src/bitmap/materialCounter/Debug/SlicerLib_generated_amBitmapMaterialCounterABufferCuda.cu.obj
> <snip>/build/CMakeFiles/SlicerLib.dir/src/bitmap/materialCounter/Debug/SlicerLib_generated_amBitmapMaterialCounterCuda.cu.obj
> <snip>/build/CMakeFiles/SlicerLib.dir/src/cuda/Debug/SlicerLib_generated_amCuda.cu.obj
> <snip>/build/CMakeFiles/SlicerLib.dir/src/cuda/Debug/SlicerLib_generated_amCudaTexture.cu.obj
> <snip>/build/CMakeFiles/SlicerLib.dir/src/vector/Debug/SlicerLib_generated_amVectorBoundaryProcess.cu.obj
> <snip>/build/CMakeFiles/SlicerLib.dir/src/vector/Debug/SlicerLib_generated_amVectorContourDifference.cu.obj
> <snip>/build/CMakeFiles/SlicerLib.dir/src/vector/Debug/SlicerLib_generated_amVectorContourOffset2.cu.obj
> <snip>/build/CMakeFiles/SlicerLib.dir/src/vector/Debug/SlicerLib_generated_amVectorContourProcess.cu.obj
> <snip>/build/CMakeFiles/SlicerLib.dir/src/vector/Debug/SlicerLib_generated_amVectorCudaHood.cu.obj
> <snip>/build/CMakeFiles/SlicerLib.dir/src/vector/Debug/SlicerLib_generated_amVectorCudaIntersections.cu.obj
> <snip>/build/CMakeFiles/SlicerLib.dir/src/vector/Debug/SlicerLib_generated_amVectorCudaLineSegments.cu.obj
> <snip>/build/CMakeFiles/SlicerLib.dir/src/vector/Debug/SlicerLib_generated_amVectorCudaLineSegments2.cu.obj
> <snip>/build/CMakeFiles/SlicerLib.dir/src/vector/Debug/SlicerLib_generated_amVectorCudaParametricIntersections.cu.obj
> <snip>/build/CMakeFiles/SlicerLib.dir/src/vector/Debug/SlicerLib_generated_amVectorInfill45Processor.cu.obj
> <snip>/build/CMakeFiles/SlicerLib.dir/src/vector/Debug/SlicerLib_generated_amVectorOutlineContour.cu.obj
> <snip>/build/CMakeFiles/SlicerLib.dir/src/vector/Debug/SlicerLib_generated_amVectorSlicerProcess.cu.obj
> -o <snip>/build/CMakeFiles/SlicerLib.dir/Debug/SlicerLib_intermediate_link.obj
> 2>C:\Program Files
> (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(127,5):
> error MSB3073: if %errorlevel% neq 0 goto :cmEnd
> 2>C:\Program Files
> (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(127,5):
> error MSB3073: :cmEnd
> 2>C:\Program Files
> (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(127,5):
> error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto
> :cmDone
> 2>C:\Program Files
> (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(127,5):
> error MSB3073: :cmErrorLevel
> 2>C:\Program Files
> (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(127,5):
> error MSB3073: exit /b %1
> 2>C:\Program Files
> (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(127,5):
> error MSB3073: :cmDone
> 2>C:\Program Files
> (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(127,5):
> error MSB3073: if %errorlevel% neq 0 goto :VCEnd
> 2>C:\Program Files
> (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(127,5):
> error MSB3073: :VCEnd" exited with code 1.
> 3>------ Build started: Project: CmbVisualizer, Configuration: Debug x64 ------


More information about the CMake mailing list