<br><br><div class="gmail_quote">On Tue, Aug 17, 2010 at 9:08 AM, Brian Davis <span dir="ltr"><<a href="mailto:bitminer@gmail.com">bitminer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I am and it is working. It is not clear to me still why it would be a problem with parallel builds due to the target object naming convention you have used as stated in:<br><div class="gmail_quote"><div><br>--snip --<div class="im">
<br>
Yup, I just build file names by appending/prepending things: <target>_generated_<filename>.<target_type>.depend.tmp. The .depend file is the dependency file used to track dependencies, and the tmp version is what nvcc generates. I then use a copy_if_different command, so that the dependency file only gets its timestamp updated if it actually changes. GCC -M only writes to the dependency file if it changes, but nvcc -M always write to it, so I have to emulate this behavior myself.<br>
</div>
--end snip--<br><br></div></div></blockquote><div><br>The problem is the existence of multiple rules that create the same output file in multiple projects. This is because when you attach a build rule to a file, the build rule follows the file across projects (at least within the same source directory).<br>
<br>project1<br> -- <a href="http://myfile.cu/" target="_blank">myfile.cu</a>:
had rule to build project1_myfile.cu.obj from <a href="http://myfile.cu/" target="_blank">myfile.cu</a><br>
<br>project2<br> CMake Rules<br> -- cmake_build_..._myfile.rule: has
rule to build project2_myfile.cu.obj from <a href="http://myfile.cu/" target="_blank">myfile.cu</a><br> -- <a href="http://myfile.cu/" target="_blank">myfile.cu</a>: has rule to build project1_myfile.cu.obj
from <a href="http://myfile.cu/" target="_blank">myfile.cu</a><br><br>There are two rules to build project1_myfile.cu.obj. If you compiled project1 and project2 at the same time, there is a chance that the rules to generate project1_myfile.cu.obj will be run at the same time, and two processes trying to write to the same file causes race conditions. When the CUDA_ATTACH flag is turned off this doesn't happen, and life is good for you again. :) <br>
</div> <br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="gmail_quote"><div><br>Thanks again for the help.<br>
</div></div><br>
</blockquote></div><br>You're welcome!<br>