Hi,everyone!
I'm trying using CMAKE to complie a CUDA_SDK example:nbody;Of course I have
noticed that Brian J. Davis wrote a article name"CUDA,CMAKE,and an attempt to
build nbody"at CMAKE maillist in Jan 25 2010.I followed his advice and can
build and run the executable,but the particles do not appear in the
window,other graphics do like the graphics bar and the text appears.Davis also
meeted this problem,and the I followed his solution but didn't get the right
result:
1,SET(CUDA_NVCC_FLAGS_DEBUG -arch sm_10 -maxrregcount=32 -Xcompiler "/EHSC /W3
/nologo /Od /Zi" CACHE STRING "" FORCE)
2,SET(CUDA_64_BIT_DEUICE_CODE OFF)
3,ADD_DEFINITIONS(-D_HOWZ_ABOUT_THIS_DEF);
After this,There is no effect.Then I learned the vtkEdge's vtkKWEImageFFT which
used cuda to compute.but get the same problem.I don't know why.I am a user of
paraview:always uses the CMAKE,but didn't learn the CMAKE language.could anyone
help me,please.Thanks a lot!!
This is my CMakeLists.txt:
find_package(Cuda)
set(KIT_SRCS nbody.cpp)#main() is in this file
if(CUDA_FOUND AND CUDA_CUTIL_FOUND)
SET(KIT_CUDA_DEPENDANT_SRCS
bodySystemcpu.cpp
bodySystemcuda.cpp
nbody_gold.cpp
render_particles.cpp
paramgl.cpp)
SET(KIT_CUDA_SOURCES bodysystemcuda.cu nbody_kernel.cu)
include_directories(${CUDA_INCLUDE_DIR} ${CUDA_CUTIL_INCLUDE_DIR})
SET(CUDA_NVCC_FLAGS_DEBUG -arch sm_10 -maxrregcount=32 -Xcompiler "/EHSC
/W3 /nologo /Od /Zi" CACHE STRING "" FORCE)
SET(CUDA_64_BIT_DEUICE_CODE OFF)
ADD_DEFINITIONS(-D_HOWZ_ABOUT_THIS_DEF)
CUDA_COMPILE(KIT_CUDA_C_SOURCES ${KIT_CUDA_SOURCES})
ENDIF(CUDA_FOUND AND CUDA_CUTIL_FOUND)
LINK_DIRECTORIES(${PROJECT_SOURCE_DIR}/lib)
set(KIT_LIBS glut32 glew32)
add_executable(nbodywgw ${KIT_CUDA_C_SOURCES} ${KIT_SRCS}
${CUDA_DEPENDANT_SRCS})
target_link_libraries(nbodywgw ${KIT_LIBS} ${CUDA_LIBRARIES}
${CUDA_CUTIL_LIBRARIES})
That's all.I'm hoping geting help!thanks~0~
_______________________________________________
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