cmake,CUDA_SDK:an attempt to use cmake compile nbody

I’m using cmake to complie a CUDA_SDK example:nbody;I have noticed that Brian J. Davis wrote a article named"CUDA,CMAKE,and an attempt to build nbody"at cmake maillists inJan 25 2010.I followed his advice and can build and run the executable,but the particles do not appear in the window,at the same time other graphics do like the graphics bar and the text appears.I then make this code as a plugin loaded into the ParaView.and found that a point(0.9,0.9,0.9 become (3.4e+38,3.4e+38,3.4e+38){=(0,0,0)}when use this library’s function.So I think that I complie the CUDA with wrong options.although i have build it .but it is wrong.
What i want to do is copmlie the CUDA_SDK’s CUDA code as a library,then my own program can use this library in a red hat linux.and my first step is the nbody program.I have read Forums’ many articles about this.but didn’t get the anyone can give me same advice or post his CMakeLists.txt file here.Thanks a lot!I am hope of help~0~If I overcome this problem,I will post my solution here step by step.
Thanks Reading!

Oh~today,I copy My program to my Win32 is work and get the right result.but when it run in linux~it works but the result is worng!!!Then there is only some reasons:1,I intall wrong CUDA versons.then the library is different.I used cuda2.0_wind32 for windows and used for my red hat linux.does this linux verson is low.but i didn’t find a compile CUDA code in windows under debug,then there is something compile options diffent between linux and windows??
by the way ,My cuda_toolkit doesn’t have the libcutil.a ,but only when run in windows,i link the this the reason?oh this is driving me crazy~

FindCUDA.cmake does a couple of things with flags.

  1. It adds -m32 or -m64 based on the CUDA_64_BIT_DEVICE_CODE CMake variable. This variable is initialized based on the bitness of the host compile (CMAKE_SIZE_OF_VOID_P).
  2. It passes host compiler flags to the code compiled by the host. Note that the flag propagation can be turned off by setting CUDA_PROPAGATE_HOST_FLAGS to TRUE.

You can see the nvcc commands by running either ‘make VERBOSE=1’ in makefiles or by specifying CUDA_VERBOSE_BUILD to TRUE via ccmake or cmake-gui. With this, you should be able to compare the flags being used on windows with linux.

Also, it might be useful to try the latest version of CUDA. 2.0 is four versions behind the current release (2.1, 2.2, 2.3, 3.0).


today,I followed you advice,Then I get the complie flags in windows and linux:


C:/CUDA/bin/nvcc.exe E:/MapperProject/Particle2Reader/ -c -o E:/MapperProject/Particle2ReaderBuild/debug/ -m32 -D_HOWZ_ABOUT_THIS_DEF -Xcompiler ,"/DWIN32","/D_WINDOWS","/W3","/Zm1000","/EHsc","/GR","/D_DEBUG","/MDd","/Zi","/0b0","/Od","/RTC1" -maxrregcount=32 -arch sm_11 -DNVCC -I…


…nvcc /home/program/wgw/project/Particle2Reader/ -c -o /home/program/wgw/project/Particle2ReadeD/./ -m32 -D_HOWZ_ABOUT_THIS_DEF -Xcomplier ,"/-g" -arch=sm_11 -maxrregcount=32 -DNVCC -I…

Then,only the -Xcomplier flag is diffenent.I know the Xcomplier flags in windows can not transform to linux directly.So i confused again.Is this the point?do you have any advance advice.Now I will dowmload the CUDA2.3 and try again~

I am hoping of your reply~Thanks reading!

Did the newer version of CUDA help anything?