I re-downloaded the FindCUDA under VISTA 64 bit, and used CMake2.6.4.
This time I put the source code dir: “C:/CUDA/FindCUDA” (since the CMakeLists.txt is in this dir)
and the build dir as: "C:/CUDA/FindCUDA/build"
Then Configure. I chose Visual Studio 9 2008 Win64.
This time no error came out, External Image and then kept all red values unchanged (all of them were correct for my case). Clicked configure again and Generate.
I opened it and found there were a lot of stuff in the project. “ALL_BUILD”,“CLEAN_CUDA_DEPENDS”,“cuda_compile_example”,“lib_example”,“test”,“test_lib”,“ZERO_CHECK”
I have no idea where they came from. I just expect to see “test”
Even in the “test” there are extra stuff in there, such as CMakeLists.txt, CMake_Rules.
So my questions are:
Which files should I exclude them from the project?
And I checked the project properties, found $(NVSDKCUDA_ROOT)/commom/inc dir is missing, and the cutil64D.lib was not included as well. Did i do anything wrong in the FindCuda.cmake step?
Yeah, those are extra build rules generated by CMake. You can build ALL_BUILD to compile all default targets. Or you can choose your target (i.e. test) and just build that. All dependancies are added automatically. Just ignore the extra junk like CLEAN_CUDA_DEPENDS and ZERO_CHECK. I think CMakeLists.txt is added to the project as a convenience so you can edit in VS without having to hunt down the file.
You don’t have to exclude anything. CMake should generate a fully working project.
I beat tmurray: DON’T USE CUTIL!!! It is not designed or intended to be used by application developers.
However, in general you do have to tell CMake what libraries to link to. It cannot determine that automatically. So if target “test” needs to be linked to /opt/myfavlib/lib/lib.a, then just use the command:
However, do note that a majority of CMake is built to make finding where library files are easy so you don’t have to hard code locations and it will thus build on anyones computer. But this is getting into CMake specific stuff, so I would suggest the CMake tutorial, the manual, or the CMake mailing list for more info.
I have a DSP code on C, and now want to port it to CUDA, but also can’t understand, what to do. I’m on KUbuntu 9.04 using Eclipse CDT. Please, tell me, how to use FindCUDA to generate project for Eclipse with CMake CDT4Generator? I’ve downloaded CMake 2.8 and FindCUDA too.
Please.help me.
In addition to all the helpful information that MisterAnder42 has provided on the forums there is a simple example of how to use FindCUDA in a CMake script. It can be found in the svn repository where I keep my simple test system used for developement:
There’s an html file (which is slightly outdated) and an example project.
Note that I’ve never generated an eclipse project from CMake, so there may be some bugs when using that generator. Please let us know on this forum if you encounter any problems.