create premake4 solutions for the various OpenCL configurations (AMD, NVIDIA, Intel OpenCL SDKs for Windows)

primarily to distribute project files that work.
CMake is still better supported in general (not all demos/libs have been ported)

Revert a recent change about warnings: %zu doesn't work in printf, %d does
This commit is contained in:
erwin.coumans
2011-09-16 01:28:34 +00:00
parent ce62d7615e
commit bb29d15058
15 changed files with 467 additions and 37 deletions

View File

@@ -28,25 +28,6 @@ SET(BulletSoftBodyOpenCLSolvers_HDRS
../btSoftBodySolverOutputCLtoGL.h
)
# OpenCL and HLSL Shaders.
# Build rules generated to stringify these into headers
# which are needed by some of the sources
SET(BulletSoftBodyOpenCLSolvers_Shaders
# OutputToVertexArray
UpdateNormals
Integrate
UpdatePositions
UpdateNodes
SolvePositions
UpdatePositionsFromVelocities
ApplyForces
PrepareLinks
VSolveLinks
)
foreach(f ${BulletSoftBodyOpenCLSolvers_Shaders})
LIST(APPEND BulletSoftBodyOpenCLSolvers_OpenCLC "../OpenCLC/${f}.cl")
endforeach(f)

View File

@@ -0,0 +1,27 @@
hasCL = findOpenCL_AMD()
if (hasCL) then
project "BulletSoftBodySolvers_OpenCL_AMD"
defines { "USE_AMD_OPENCL","CL_PLATFORM_AMD"}
initOpenCL_AMD()
kind "StaticLib"
targetdir "../../../../../lib"
includedirs {
".",
"../../../..",
"../../../../../Glut"
}
files {
"../btSoftBodySolver_OpenCL.cpp",
"../btSoftBodySolver_OpenCLSIMDAware.cpp",
"../btSoftBodySolverOutputCLtoGL.cpp"
}
end

View File

@@ -0,0 +1,82 @@
INCLUDE_DIRECTORIES(
${BULLET_PHYSICS_SOURCE_DIR}/src
${INTEL_OPENCL_INCLUDES}
)
ADD_DEFINITIONS(-DUSE_INTEL_OPENCL)
ADD_DEFINITIONS(-DCL_PLATFORM_INTEL)
SET(BulletSoftBodyOpenCLSolvers_SRCS
../btSoftBodySolver_OpenCL.cpp
../btSoftBodySolver_OpenCLSIMDAware.cpp
../btSoftBodySolverOutputCLtoGL.cpp
)
SET(BulletSoftBodyOpenCLSolvers_HDRS
../btSoftBodySolver_OpenCL.h
../btSoftBodySolver_OpenCLSIMDAware.h
../../CPU/btSoftBodySolverData.h
../btSoftBodySolverVertexData_OpenCL.h
../btSoftBodySolverTriangleData_OpenCL.h
../btSoftBodySolverLinkData_OpenCL.h
../btSoftBodySolverLinkData_OpenCLSIMDAware.h
../btSoftBodySolverBuffer_OpenCL.h
../btSoftBodySolverVertexBuffer_OpenGL.h
../btSoftBodySolverOutputCLtoGL.h
)
# OpenCL and HLSL Shaders.
# Build rules generated to stringify these into headers
# which are needed by some of the sources
SET(BulletSoftBodyOpenCLSolvers_Shaders
# OutputToVertexArray
UpdateNormals
Integrate
UpdatePositions
UpdateNodes
SolvePositions
UpdatePositionsFromVelocities
ApplyForces
PrepareLinks
VSolveLinks
)
foreach(f ${BulletSoftBodyOpenCLSolvers_Shaders})
LIST(APPEND BulletSoftBodyOpenCLSolvers_OpenCLC "../OpenCLC/${f}.cl")
endforeach(f)
ADD_LIBRARY(BulletSoftBodySolvers_OpenCL_Intel
${BulletSoftBodyOpenCLSolvers_SRCS}
${BulletSoftBodyOpenCLSolvers_HDRS}
${BulletSoftBodyOpenCLSolvers_OpenCLC}
)
SET_TARGET_PROPERTIES(BulletSoftBodySolvers_OpenCL_Intel PROPERTIES VERSION ${BULLET_VERSION})
SET_TARGET_PROPERTIES(BulletSoftBodySolvers_OpenCL_Intel PROPERTIES SOVERSION ${BULLET_VERSION})
IF (BUILD_SHARED_LIBS)
TARGET_LINK_LIBRARIES(BulletSoftBodySolvers_OpenCL_Intel BulletSoftBody)
ENDIF (BUILD_SHARED_LIBS)
IF (INSTALL_LIBS)
IF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
INSTALL(TARGETS BulletSoftBodySolvers_OpenCL_Intel DESTINATION .)
ELSE (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
INSTALL(TARGETS BulletSoftBodySolvers_OpenCL_Intel DESTINATION lib${LIB_SUFFIX})
#headers are already installed by BulletMultiThreaded library
ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
SET_TARGET_PROPERTIES(BulletSoftBodySolvers_OpenCL_Intel PROPERTIES FRAMEWORK true)
SET_TARGET_PROPERTIES(BulletSoftBodySolvers_OpenCL_Intel PROPERTIES PUBLIC_HEADER "${BulletSoftBodyOpenCLSolvers_HDRS}")
ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
ENDIF (INSTALL_LIBS)

View File

@@ -0,0 +1,27 @@
hasCL = findOpenCL_Intel()
if (hasCL) then
project "BulletSoftBodySolvers_OpenCL_Intel"
defines { "USE_INTEL_OPENCL","CL_PLATFORM_INTEL"}
initOpenCL_Intel()
kind "StaticLib"
targetdir "../../../../../lib"
includedirs {
".",
"../../../..",
"../../../../../Glut"
}
files {
"../btSoftBodySolver_OpenCL.cpp",
"../btSoftBodySolver_OpenCLSIMDAware.cpp",
"../btSoftBodySolverOutputCLtoGL.cpp"
}
end

View File

@@ -0,0 +1,27 @@
hasCL = findOpenCL_NVIDIA()
if (hasCL) then
project "BulletSoftBodySolvers_OpenCL_NVIDIA"
defines { "USE_NVIDIA_OPENCL","CL_PLATFORM_NVIDIA"}
initOpenCL_NVIDIA()
kind "StaticLib"
targetdir "../../../../../lib"
includedirs {
".",
"../../../..",
"../../../../../Glut"
}
files {
"../btSoftBodySolver_OpenCL.cpp",
"../btSoftBodySolver_OpenCLSIMDAware.cpp",
"../btSoftBodySolverOutputCLtoGL.cpp"
}
end