<font size="2"><font face="verdana,sans-serif">Hi all,</font></font><div><font size="2"><font face="verdana,sans-serif"><br></font></font></div><div><font size="2"><font face="verdana,sans-serif">I wanted to try ITK4 from git, among other things because it already includes <a href="http://www.insight-journal.org/browse/publication/176">IJ contribution 176</a>. It configures and builds without problems.</font></font></div>
<div><font size="2"><font face="verdana,sans-serif"><br></font></font></div><div><font size="2"><font face="verdana,sans-serif">However when I switch from ITK 3.20 to it in my project (called "Spine"), I start getting a new mysterious error:</font></font></div>
<div><font size="2"><div style="font-family: verdana, sans-serif; "><br></div><div><font class="Apple-style-span" face="'courier new', monospace">1>------ Build started: Project: ZERO_CHECK, Configuration: Debug x64 ------</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">2>------ Build started: Project: Spine, Configuration: Debug x64 ------</font></div><div><font class="Apple-style-span" face="'courier new', monospace">2> Building NVCC (Device) object Debug/Spine_generated_LHstuff.cu.obj</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">2> The command line is too long.</font></div><div><font class="Apple-style-span" face="'courier new', monospace">2> CMake Error at CMakeFiles/Spine_generated_LHstuff.cu.obj.cmake:198 (message):</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">2> Error generating D:/Repo/Spine/Debug/Spine_generated_LHstuff.cu.obj</font></div><div><font class="Apple-style-span" face="'courier new', monospace">2> </font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">2> </font></div><div><font class="Apple-style-span" face="'courier new', monospace">2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 1.</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">3>------ Skipped Build: Project: ALL_BUILD, Configuration: Debug x64 ------</font></div><div><font class="Apple-style-span" face="'courier new', monospace">3>Project not selected to build for this solution configuration </font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">========== Build: 1 succeeded, 1 failed, 1 up-to-date, 1 skipped ==========</font></div><div style="font-family: verdana, sans-serif; "><br></div>
<div style="font-family: verdana, sans-serif; ">LHstuff.cu compiles normally, both with CUDA toolkit 3.2 and the recently installed 4.0. I switched to VS2010 since I installed CUDA 4.0 a few days ago (when it was released). This is the only CUDA file in my project.</div>
<div style="font-family: verdana, sans-serif; "><br></div><div style="font-family: verdana, sans-serif; ">LHstuff.cu has the following custom build command (part of the CMake-generated .vcxproj):</div><div><div style="font-family: verdana, sans-serif; ">
<br></div><div><font class="Apple-style-span" face="'courier new', monospace">"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E make_directory D:/Repo/Spine/$(Configuration)</font></div><div><font class="Apple-style-span" face="'courier new', monospace">if errorlevel 1 goto :VCEnd</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -D verbose:BOOL=OFF -D "CCBIN:PATH=$(VCInstallDir)bin" -D build_configuration:STRING=$(ConfigurationName) -D generated_file:STRING=D:/Repo/Spine/$(Configuration)/Spine_generated_LHstuff.cu.obj -D generated_cubin_file:STRING=D:/Repo/Spine/$(Configuration)/Spine_generated_LHstuff.cu.obj.cubin.txt -P D:/Repo/Spine/CMakeFiles/Spine_generated_LHstuff.cu.obj.cmake</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">if errorlevel 1 goto :VCEnd</font></div></div><div style="font-family: verdana, sans-serif; "><br></div><div><font class="Apple-style-span" face="verdana, sans-serif">and the relevant part of "</font><font class="Apple-style-span" face="'courier new', monospace">Spine_generated_LHstuff.cu.obj.cmake</font><span class="Apple-style-span" style="font-family: verdana, sans-serif; ">" (around line 198):</span></div>
<div style="font-family: verdana, sans-serif; "><br></div><div><div><font class="Apple-style-span" face="'courier new', monospace"># Generate the dependency file</font></div><div><font class="Apple-style-span" face="'courier new', monospace">cuda_execute_process(</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> "Generating dependency file: ${NVCC_generated_dependency_file}"</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> COMMAND "${CUDA_NVCC_EXECUTABLE}"</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> -M</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> ${CUDACC_DEFINE}</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> "${source_file}"</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> -o "${NVCC_generated_dependency_file}"</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> ${CCBIN}</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> ${nvcc_flags}</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> ${nvcc_host_compiler_flags}</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> ${depends_CUDA_NVCC_FLAGS}</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> -DNVCC</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> ${CUDA_NVCC_INCLUDE_ARGS}</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> )</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace">if(CUDA_result)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> message(FATAL_ERROR "Error generating ${generated_file}")</font></div><div><font class="Apple-style-span" face="'courier new', monospace">endif()</font></div>
</div><div style="font-family: verdana, sans-serif; "><br></div><div><font class="Apple-style-span" face="verdana, sans-serif">It seems that deeper directory structure of ITK4 is pushing this command in "</font><font class="Apple-style-span" face="'courier new', monospace">Spine_generated_LHstuff.cu.obj.cmake</font><span class="Apple-style-span" style="font-family: verdana, sans-serif; ">" over some limit (possibly 255 characters). Do you have any suggestions how to resolve this issue?</span></div>
<div style="font-family: verdana, sans-serif; "><br></div><div style="font-family: verdana, sans-serif; ">Regards,</div><div style="font-family: verdana, sans-serif; ">Dženan</div></font></div>