[CMake] Moving large MSVS projects to CUDA

James Bigler jamesbigler at gmail.com
Tue May 8 16:01:35 EDT 2012


On Mon, May 7, 2012 at 4:04 PM, Ming <ymyang at wisc.edu> wrote:

>      **
>>
> *By design, CMake should detect configuration changes and reconfigure
> before the build starts.  The VS plugin was designed to provide a single
> dialog box that would allow for reloading of the entire solution with a
> single click rather than having to click "reload" for each project one at a
> time.  This plugin doesn't work properly in VS 2010, because MS broke
> something.
>
> To run the configuration manually, you would need to configure your build
> from the CMake-GUI instead of relying on VS to run the configuration during
> the build.  You would use the same build and source directory.  This should
> work fine.
> *
> Hello again James and thank you helpful replies,  I have managed to
> perform iterative configure-build steps until I’ve reached an equilibrium
> in my number of failures.  Unfortunately, there are still errors (attached
> in files) that I am having much difficulties with, they seem to fall under
> the following categories:
>
>    - Syntax errors? I am not sure why, but the c++ compiler is now taking
>    issue with identical code that it did not before.  Examples include:
>       *compiler limit: blocks nested too deeply*
>       *syntax error: missing ‘;’ before ‘<’*
>       *: is not a class or namespace name... etc*
>       - Command line errors (These two are due to a “command line too
>    long” issue that I have searched for resolutions on. I noticed Mr. Bigler,
>    that you had posted regarding this issue for other people having issues
>    with a program called ITK?  It seems to be persisting and unresolved?)
>    - Linker errors (these seem to be due to lack of objects to link to
>    due to issues 1 and 2.)
>
> One of my questions is now, is it possible that cmake with findcuda is
> pointing MSVS to a different compiler than cmake itself would have
> specified?
>
> Thanks,
> Ming
>
> p.s. outputs are attached.  apologies for so much text, it is a large
> toolkit.
>

1. You probably shouldn't rename all your files .cu instead of .cpp.  I
would advise that you separate as much as possible the CUDA code and your
host code.  CUDA can deal with a lot of template code, but you've obviously
reached some limit of CUDA.
2. Yes the long command line is still a problem.  I haven't had the
occasion to fix this.  Probably the best thing you could do to work around
it is to place all your device code into a separate directory (new CMake
scope) and set the include paths to only the paths you absolutely need.
Read the documentation for CMake then ask the mailing list how to do this
if you can't figure out how to do this, as I don't have the time to go into
setting this.  See the documentation for include_directories and the
directory property called INCLUDE_DIRECTORIES
(get_directory_proprty/set_directory_properties).

James

James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120508/7d1fe6a0/attachment-0001.htm>


More information about the CMake mailing list