I am referring to Bullet svn r1540.
I'm on Debian GNU/Linux testing "Lenny" x86 32bit.
My VGA is Nvidia 6600GT, with no support for CUDA.
I tried to build Extras/CUDA with cmake/make/gcc.
I didn't understand well *.vcproj build files, but I tried to compile something...
I managed to obtain a libCUDA.a archive that contains:
- bt3DGridBroadphase.o
- btCudaBroadphase.o
- paramgl.o
- param.o
- particles.o
- particleSystem.o
- render_particles.o
- shaders.o
Now I describe what I did.
I downloaded the CUDA toolkit for Ubuntu 7.10 at [1] and installed it (as non-root user) to /home/user/cuda (to have the folder /home/user/cuda/include).
It was useful because without the files in its include/ folder I couldn't compile Extras/CUDA.
I wrote this Extras/CUDA/CMakeLists.txt (I used src/LinearMath/CMakeLists.txt as a base)(note in the second line that /home/user/cuda/include is hardcoded):
INCLUDE_DIRECTORIES(
${BULLET_PHYSICS_SOURCE_DIR}/src ${BULLET_PHYSICS_SOURCE_DIR}/Demos/OpenGL /home/user/cuda/include }
)
SET(CUDA_SRCS
bt3DGridBroadphase.cpp
btCudaBroadphase.cpp
param.cpp
paramgl.cpp
particles.cpp
particleSystem.cpp
render_particles.cpp
shaders.cpp
)
SET(CUDA_HDRS
bt3DGridBroadphaseFunc.h
btCudaBroadphase.h
btCudaBroadphaseKernel.h
cutil_gl_error.h
cutil_math.h
paramgl.h
param.h
particleSystem.h
render_particles.h
shaders.h
)
ADD_LIBRARY(CUDA ${CUDA_SRCS} ${CUDA_HDRS})
SET_TARGET_PROPERTIES(CUDA PROPERTIES VERSION ${BULLET_VERSION})
SET_TARGET_PROPERTIES(CUDA PROPERTIES SOVERSION ${BULLET_VERSION})
#FILES_MATCHING requires CMake 2.6
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
INSTALL(TARGETS CUDA DESTINATION lib)
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include FILES_MATCHING PATTERN "*.h")
ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
SET_TARGET_PROPERTIES(CUDA PROPERTIES FRAMEWORK true)
SET_TARGET_PROPERTIES(CUDA PROPERTIES PUBLIC_HEADER "${CUDA_HDRS}")
ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
To compile I had to modify some files in Extras/CUDA.
btCudaBroadphase.cpp: add "#include <string.h>"
bt3DGridBroadphase.cpp: add "#include <string.h>"
param.cpp: substitute "#include <param.h>" with "#include "param.h"
paramgl.cpp: substitute "#include <param.h>" with "#include "param.h"" and "#include <paramgl.h>" with "#include "paramgl.h""; add "#include <string.h>"
paramgl.h: substitute "#include <param.h>" with "#include "param.h"
render_particles.cpp: "#include <paramgl.h>" with "#include "paramgl.h"
I hope this contribution is useful to have cmake build support for CUDA (and eventually OpenCL...).
Cheers,
slackydeb
[1] http://www.nvidia.com/object/thankyou_l ... 10_x86.run