On Tue, Aug 17, 2010 at 9:08 AM, Brian Davis <[email protected]> wrote:
> 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:
>
> --snip --
>
> 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.
> --end snip--
>
>
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).
project1
-- myfile.cu: had rule to build project1_myfile.cu.obj from myfile.cu
project2
CMake Rules
-- cmake_build_..._myfile.rule: has rule to build project2_myfile.cu.obj
from myfile.cu
-- myfile.cu: has rule to build project1_myfile.cu.obj from myfile.cu
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. :)
>
> Thanks again for the help.
>
>
You're welcome!
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake