View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008258CMakeCMakepublic2008-12-08 13:592016-06-10 14:30
ReporterJames Bigler 
Assigned ToBill Hoffman 
PrioritynormalSeverityminorReproducibilityrandom
StatusclosedResolutionmoved 
PlatformOSOS Version
Product VersionCMake-2-6 
Target VersionFixed in Version 
Summary0008258: Race condition in certain parallel builds in VS
Description2.6.3R5 behaving a little strangely on one of my test projects.

I have a program that generates cpp files from some input file. My program also outputs a dependency file which I parse into a CMake readable format. The basic setup creates a cmake script using configure_file with all the commands to build my cpp and dependency files. A custom target executes the cmake script during build. Also during configuration the dependency file that was generated by the build tool is included into CMake to define source level dependencies.

I'm using VS 2005 32/64 on WinXP 64. VS is set to build projects in parallel.

In 2.6.2, this problem doesn't appear.

In 2.6.3R5, if I hit rebuild some of the tools would start to complain about missing files as CMake starts to regenerate stuff in the middle of the build (or end of the project compilation). This only happens sometimes.

If I do a clean followed by a build it works just fine.

This is output from a project that completed successfully:
Building Custom Rule C:/code/CMake-cuda-staging/src/CMakeLists.tx
CMake is re-running because build system is out-of-date.
-- Configuring done
-- Generating done
-- Build files have been written to: C:/code/CMake-cuda-staging/build-64 Compiling...

Output from a project that failed
Building Custom Rule C:/code/CMake-cuda-staging/src/CMakeLists.txt
CMake is re-running because build system is out-of-date.
CMake Error: Could not open file for write in copy operation C:/code/CMake-cuda-staging/build-64/src/cuda/test_generated_test_bin.cu.cpp.cmake.tmp
CMake Error: : System Error: Invalid argument
CMake Error at CMake/cuda/FindCUDA.cmake:609 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  CMake/cuda/FindCUDA.cmake:685 (CUDA_add_custom_commands)
  src/CMakeLists.txt:21 (CUDA_ADD_EXECUTABLE)
CMake Error: Could not open file for write in copy operation C:/code/CMake-cuda-staging/build-64/src/cuda/cuda_compile_generated_test_bin.cu.cpp.cmake.tmp
CMake Error: : System Error: Invalid argument
CMake Error at CMake/cuda/FindCUDA.cmake:609 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  CMake/cuda/FindCUDA.cmake:709 (CUDA_add_custom_commands)
  src/CMakeLists.txt:44 (CUDA_COMPILE)
-- Configuring incomplete, errors occurred! Project : error PRJ0019: A tool returned an error code from "Building Custom Rule C:/code/CMake-cuda-staging/src/CMakeLists.txt"

Another:
Building Custom Rule C:/code/CMake-cuda-staging/src/CMakeLists.txt
CMake is re-running because build system is out-of-date.
-- Configuring done CMake Error: Unable to open check cache file for write. C:/code/CMake-cuda-staging/build-64/CMakeFiles/cmake.check_cache
Project : error PRJ0019: A tool returned an error code from "Building Custom Rule C:/code/CMake-cuda-staging/src/CMakeLists.txt"

Another:
Building Custom Rule C:/code/CMake-cuda-staging/src/CMakeLists.txt
CMake is re-running because build system is out-of-date.
-- Configuring done
-- Generating done
CMake Error: Cannot open file for write: C:/code/CMake-cuda-staging/build-64/Cuda-project.sln.tmp
CMake Error: : System Error: Invalid argument
-- Build files have been written to: C:/code/CMake-cuda-staging/build-64
Project : error PRJ0019: A tool returned an error code from "Building Custom Rule C:/code/CMake-cuda-staging/src/CMakeLists.txt"

I'm guessing there is a race condition involving the cmake state that wasn't there with the last release. Also, I'm guessing that VS executes clean along the way (instead of upfront with a clean command followed by a build) while building and causes problems.

I can share the project I'm working on, but you would need a NVIDIA card that supports CUDA and the CUDA toolkit.
TagsNo tags attached.
Attached Filesgz file icon diffs.tar.gz [^] (49,741 bytes) 2008-12-08 16:45

 Relationships

  Notes
(0014308)
Bill Hoffman (manager)
2008-12-08 14:54

I can not imaging what changed. Can you try something. Can you generate the project with 2.6.2 then move the directory aside, then generate with 2.6.3 RC 5, then diff the directories. Don't do any building, and keep the path names the same to minimize the diffs. That should make it easier to figure out what changed.
(0014310)
James Bigler (developer)
2008-12-08 15:52

Things were fun thanks to the changing GUID, but one of the major differences that I could note in the dependencies is this.

In ALL_BUILD.vcproj there is a change in the AdditionalDependencies. 2.6.2 has these extra dependencies that 2.6.3R5 doesn't.

< C:\Program Files (x86)\Programming\CMake 2.6\share\cmake-2.6\Modules\Platform\Windows-cl.cmake";C:\code\CMake-cuda-staging\build-cmake2.6.3R5\CMakeFiles\CMakeCPlatform.cmake;C:\code\CMake-cuda-staging\build-cmake2.6.3R5\CMakeFiles\CMakeCXXPlatform.cmake;"C:\Program Files (x86)\Programming\CMake 2.6\share\cmake-2.6\Modules\Platform\cl.cmake

The module files shouldn't be changing, and I doubt that the Platform cmake files would be either. If you want, I can attach the two directories so that you can do the diff your self (or send them to you via your kitware email address).

Also, the sln file has all sorts of diffs, but most of them are due to changes in the GUID and a reordering of the projects. I'll see if I can do some textural swapping of the GUIDs to make the diffs easier to read.
(0014311)
Bill Hoffman (manager)
2008-12-08 15:57

Try configuring with 2.6.2, then save all the files, then configure the SAME binary tree with 2.6.3. That should leave the GUID's the same, but should update the .vcproj files with any changes.
(0014312)
James Bigler (developer)
2008-12-08 16:46

OK, so this is what I did.

1. Install 2.6.2
2. Configure into a clean build directory (build-cmake).
3. Copy the contents (cp -Rp build-cmake build-cmake-2.6.2).
4. Install 2.6.3R5
5. Configure in existing build directory (build-cmake) overwriting whatever was in there.
6. tar zcvf diffs.tar.gz build-cmake build-cmake-2.6.2

So far the only major differences are the change in dependencies for ALL_BUILD and the ordering of the project files in the solution file.
(0041477)
Kitware Robot (administrator)
2016-06-10 14:27

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2008-12-08 13:59 James Bigler New Issue
2008-12-08 14:54 Bill Hoffman Note Added: 0014308
2008-12-08 15:52 James Bigler Note Added: 0014310
2008-12-08 15:57 Bill Hoffman Note Added: 0014311
2008-12-08 15:57 Bill Hoffman Status new => assigned
2008-12-08 15:57 Bill Hoffman Assigned To => Bill Hoffman
2008-12-08 16:45 James Bigler File Added: diffs.tar.gz
2008-12-08 16:46 James Bigler Note Added: 0014312
2016-06-10 14:27 Kitware Robot Note Added: 0041477
2016-06-10 14:27 Kitware Robot Status assigned => resolved
2016-06-10 14:27 Kitware Robot Resolution open => moved
2016-06-10 14:30 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team