diff --git a/Demos/CcdPhysicsDemo/ibmsdk/Makefile b/Demos/CcdPhysicsDemo/ibmsdk/Makefile index 846bd25ad..2039e8b73 100755 --- a/Demos/CcdPhysicsDemo/ibmsdk/Makefile +++ b/Demos/CcdPhysicsDemo/ibmsdk/Makefile @@ -26,17 +26,6 @@ PROGRAM_ppu := CcdPhysicsDemo ###################################################################### OBJS = CcdPhysicsDemo.o main.o -IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi) - -ifeq ("$(IBM_CELLSDK_VERSION)","3.0") - CELL_TOP ?= /opt/cell/sdk - CELL_SYSROOT = /opt/cell/sysroot - include $(CELL_TOP)/buildutils/make.footer -else - CELL_TOP ?= /opt/ibm/cell-sdk/prototype - CELL_SYSROOT = $(CELL_TOP)/sysroot - include $(CELL_TOP)/make.footer -endif ######################################################################## # Libraries, Include paths, Defines @@ -52,6 +41,7 @@ SYS_LIBS := -lspe2 -lglut -lGLU -lGL -lm -lXext -lXmu -lX11 IMPORTS = $(ROOT)/lib/ibmsdk/bulletmultithreaded.a \ $(ROOT)/lib/ibmsdk/bulletopenglsupport.a \ $(ROOT)/lib/ibmsdk/bulletdynamics.a \ + $(ROOT)/lib/ibmsdk/bulletconvexhull.a \ $(ROOT)/lib/ibmsdk/bulletcollision.a \ $(ROOT)/lib/ibmsdk/bulletmath.a @@ -64,7 +54,17 @@ INSTALL_FILES = $(PROGRAM_ppu) # make.footer ######################################################################## +IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi) +ifeq ("$(IBM_CELLSDK_VERSION)","3.0") + CELL_TOP ?= /opt/cell/sdk +# CELL_SYSROOT = $(CELL_TOP); + include $(CELL_TOP)/buildutils/make.footer +else + CELL_TOP ?= /opt/ibm/cell-sdk/prototype + CELL_SYSROOT = $(CELL_TOP)/sysroot + include $(CELL_TOP)/make.footer +endif $(PPMS): cp textures/$@ . diff --git a/Demos/CellSpuDemo/ibmsdk/Makefile b/Demos/CellSpuDemo/ibmsdk/Makefile index cdc1351d4..b5aad1553 100755 --- a/Demos/CellSpuDemo/ibmsdk/Makefile +++ b/Demos/CellSpuDemo/ibmsdk/Makefile @@ -39,6 +39,7 @@ SYS_LIBS := -lspe2 -lglut -lGLU -lGL -lm -lXext -lXmu -lX11 IMPORTS = $(ROOT)/lib/ibmsdk/bulletmultithreaded.a \ $(ROOT)/lib/ibmsdk/bulletopenglsupport.a \ $(ROOT)/lib/ibmsdk/bulletdynamics.a \ + $(ROOT)/lib/ibmsdk/bulletconvexhull.a \ $(ROOT)/lib/ibmsdk/bulletcollision.a \ $(ROOT)/lib/ibmsdk/bulletmath.a diff --git a/Demos/CollisionDemo/ibmsdk/Makefile b/Demos/CollisionDemo/ibmsdk/Makefile index e7c929f33..e2a935293 100755 --- a/Demos/CollisionDemo/ibmsdk/Makefile +++ b/Demos/CollisionDemo/ibmsdk/Makefile @@ -38,6 +38,7 @@ SYS_LIBS := -lglut -lGLU -lGL -lm -lXext -lXmu -lX11 IMPORTS = $(ROOT)/lib/ibmsdk/bulletopenglsupport.a \ $(ROOT)/lib/ibmsdk/bulletdynamics.a \ + $(ROOT)/lib/ibmsdk/bulletconvexhull.a \ $(ROOT)/lib/ibmsdk/bulletcollision.a \ $(ROOT)/lib/ibmsdk/bulletmath.a diff --git a/Demos/OpenGL/GL_ShapeDrawer.cpp b/Demos/OpenGL/GL_ShapeDrawer.cpp index b44d640d7..0524103d4 100644 --- a/Demos/OpenGL/GL_ShapeDrawer.cpp +++ b/Demos/OpenGL/GL_ShapeDrawer.cpp @@ -41,7 +41,7 @@ subject to the following restrictions: #include "BulletCollision/CollisionShapes/btUniformScalingShape.h" #include "BulletCollision/CollisionShapes/btStaticPlaneShape.h" /// -#include "btShapeHull.h" +#include "ConvexHull/btShapeHull.h" #include "LinearMath/btTransformUtil.h" diff --git a/Demos/OpenGL/ibmsdk/Makefile b/Demos/OpenGL/ibmsdk/Makefile index ee1962e13..f2ce46c84 100644 --- a/Demos/OpenGL/ibmsdk/Makefile +++ b/Demos/OpenGL/ibmsdk/Makefile @@ -9,6 +9,7 @@ LIBRARY_ppu = bulletopenglsupport.a #### Compiler flags CPPFLAGS = -DUSE_LIBSPE2 \ +-I$(ROOT)/Extras/ \ -I$(ROOT)/src/ \ -I$(SDKINC) \ -I$(HOST) diff --git a/Extras/BulletMultiThreaded/Makefile b/Extras/BulletMultiThreaded/Makefile index 08ee49d91..e62bda04f 100644 --- a/Extras/BulletMultiThreaded/Makefile +++ b/Extras/BulletMultiThreaded/Makefile @@ -9,14 +9,13 @@ IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi) ifeq ("$(IBM_CELLSDK_VERSION)","3.0") CELL_TOP ?= /opt/cell/sdk CELL_SYSROOT := /opt/cell/sysroot - include $(CELL_TOP)/buildutils/make.footer else CELL_TOP ?= /opt/ibm/cell-sdk/prototype CELL_SYSROOT := $(CELL_TOP)/sysroot - include $(CELL_TOP)/make.footer endif +USE_CCACHE=ccache RM=rm -f OUTDIR=./out DEBUGFLAG=-DNDEBUG @@ -29,7 +28,7 @@ ifeq "$(__ARCH_BITS__)" "64" else SPU_DEFFLAGS= -DUSE_LIBSPE2 -D__SPU__ endif -SPU_GCC=/usr/bin/spu-gcc +SPU_GCC=$(USE_CCACHE) /usr/bin/spu-gcc SPU_INCLUDEDIR= -I. -I$(CELL_SYSROOT)/usr/spu/include -I../../src -I$(NARROWPHASEDIR) #SPU_CFLAGS= $(DEBUGFLAG) -W -Wall -Winline -Os -c -include spu_intrinsics.h -include stdbool.h SPU_CFLAGS= $(DEBUGFLAG) -W -Wall -Winline -O3 -mbranch-hints -fomit-frame-pointer -ftree-vectorize -finline-functions -ftree-vect-loop-version -ftree-loop-optimize -ffast-math -fno-rtti -fno-exceptions -c -include spu_intrinsics.h -include stdbool.h @@ -42,10 +41,10 @@ SYMBOLNAME=spu_program ifeq "$(__ARCH_BITS__)" "64" PPU_DEFFLAGS= -DUSE_LIBSPE2 -DUSE_ADDR64 - PPU_GCC=/usr/bin/ppu-gcc + PPU_GCC=$(USE_CCACHE) /usr/bin/ppu-gcc else PPU_DEFFLAGS= -DUSE_LIBSPE2 - PPU_GCC=/usr/bin/ppu32-gcc + PPU_GCC=$(USE_CCACHE) /usr/bin/ppu32-gcc endif PPU_CFLAGS= $(ARCHITECTUREFLAG) $(DEBUGFLAG) -W -Wall -Winline -O3 -c -mabi=altivec -maltivec -include altivec.h -include stdbool.h @@ -67,6 +66,9 @@ SpuFakeDma : MakeOut SpuContactManifoldCollisionAlgorithm_spu : MakeOut $(SPU_GCC) $(SPU_DEFFLAGS) $(SPU_CFLAGS) $(SPU_INCLUDEDIR) -o $(OUTDIR)/$@.o SpuContactManifoldCollisionAlgorithm.cpp +SpuCollisionShapes : MakeOut + $(SPU_GCC) $(SPU_DEFFLAGS) $(SPU_CFLAGS) $(SPU_INCLUDEDIR) -o $(OUTDIR)/$@.o $(NARROWPHASEDIR)/$@.cpp + SpuContactResult : MakeOut $(SPU_GCC) $(SPU_DEFFLAGS) $(SPU_CFLAGS) $(SPU_INCLUDEDIR) -o $(OUTDIR)/$@.o $(NARROWPHASEDIR)/$@.cpp @@ -130,7 +132,7 @@ SpuSampleTaskProcess : MakeOut spu : SpuFakeDma SpuContactManifoldCollisionAlgorithm_spu SpuContactResult SpuTaskFile \ - SpuGjkPairDetector SpuMinkowskiPenetrationDepthSolver SpuVoronoiSimplexSolver \ + SpuGjkPairDetector SpuMinkowskiPenetrationDepthSolver SpuVoronoiSimplexSolver SpuCollisionShapes \ btPersistentManifold btOptimizedBvh btCollisionObject btTriangleCallback btTriangleIndexVertexArray \ btStridingMeshInterface btAlignedAllocator $(SPU_GCC) -o $(OUTDIR)/spuCollision.elf \ @@ -138,6 +140,7 @@ spu : SpuFakeDma SpuContactManifoldCollisionAlgorithm_spu SpuContactResult SpuTa $(OUTDIR)/SpuFakeDma.o \ $(OUTDIR)/SpuContactManifoldCollisionAlgorithm_spu.o \ $(OUTDIR)/SpuContactResult.o \ + $(OUTDIR)/SpuCollisionShapes.o \ $(OUTDIR)/SpuGjkPairDetector.o \ $(OUTDIR)/SpuMinkowskiPenetrationDepthSolver.o \ $(OUTDIR)/SpuVoronoiSimplexSolver.o \ @@ -148,7 +151,7 @@ spu : SpuFakeDma SpuContactManifoldCollisionAlgorithm_spu SpuContactResult SpuTa $(OUTDIR)/btAlignedAllocator.o \ $(SPU_LFLAGS) $(SPU_LIBRARIES) -spu-embed : spu +spu-embed : spu $(SPU_EMBED) $(ARCHITECTUREFLAG) $(SYMBOLNAME) $(OUTDIR)/spuCollision.elf $(OUTDIR)/$@.o $(SPU_AR) -qcs $(LIBOUTDIR)/libspu.a $(OUTDIR)/$@.o @@ -164,13 +167,9 @@ ppu : SpuGatheringCollisionDispatcher SpuCollisionTaskProcess btThreadSupportInt $(OUTDIR)/btThreadSupportInterface.o \ $(OUTDIR)/SpuContactManifoldCollisionAlgorithm.o +all : spu-embed ppu -all : spu ppu - -all-embed : spu-embed ppu - - -clean : +clean: $(RM) $(OUTDIR)/* ; $(RM) $(LIBOUTDIR)/libspu.a ; $(RM) $(LIBOUTDIR)/bulletmultithreaded.a diff --git a/Extras/BulletMultiThreaded/SpuFakeDma.h b/Extras/BulletMultiThreaded/SpuFakeDma.h index 3c4b5536a..0dbb4b465 100644 --- a/Extras/BulletMultiThreaded/SpuFakeDma.h +++ b/Extras/BulletMultiThreaded/SpuFakeDma.h @@ -9,13 +9,15 @@ #ifdef __SPU__ +#ifndef USE_LIBSPE2 + #include #include #define DMA_TAG(xfer) (xfer + 1) #define DMA_MASK(xfer) (1 << DMA_TAG(xfer)) -#elif defined(USE_LIBSPE2) +#else // !USE_LIBSPE2 #define DMA_TAG(xfer) (xfer + 1) #define DMA_MASK(xfer) (1 << DMA_TAG(xfer)) @@ -88,7 +90,8 @@ -#else +#endif // USE_LIBSPE2 +#else // !__SPU__ //Simulate DMA using memcpy or direct access on non-CELL platforms that don't have DMAs and SPUs (Win32, Mac, Linux etc) //Potential to add networked simulation using this interface diff --git a/Extras/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp b/Extras/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp index 4b293b2d6..51d9a765e 100644 --- a/Extras/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp +++ b/Extras/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp @@ -30,8 +30,10 @@ #ifdef __SPU__ ///Software caching from the IBM Cell SDK, it reduces 25% SPU time for our test cases +#ifndef USE_LIBSPE2 #define USE_SOFTWARE_CACHE 1 -#endif //__CELLOS_LV2__ +#endif +#endif //__SPU__ //////////////////////////////////////////////// /// software caching diff --git a/Extras/ConvexHull/ibmsdk/Makefile b/Extras/ConvexHull/ibmsdk/Makefile new file mode 100644 index 000000000..a0fb47286 --- /dev/null +++ b/Extras/ConvexHull/ibmsdk/Makefile @@ -0,0 +1,38 @@ +#### Source code Dirs +VPATH = ../ + +ROOT = ../../.. +HOST = /usr/include + +#### Library +LIBRARY_ppu = bulletconvexhull.a + +#### Compiler flags +CPPFLAGS = -DUSE_LIBSPE2 \ +-I$(ROOT)/Extras/ \ +-I$(ROOT)/src/ \ +-I$(SDKINC) \ +-I$(HOST) + +#### Optimization level flags +#CC_OPT_LEVEL = $(CC_OPT_LEVEL_DEBUG) +CC_OPT_LEVEL = -O3 + +##### Objects to be archived in lib +OBJS = \ +btConvexHull.o \ +btShapeHull.o + +#### Install directories +INSTALL_DIR = $(ROOT)/lib/ibmsdk/ +INSTALL_FILES = $(LIBRARY) + +IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi) + +ifeq ("$(IBM_CELLSDK_VERSION)","3.0") + CELL_TOP ?= /opt/cell/sdk + include $(CELL_TOP)/buildutils/make.footer +else + CELL_TOP ?= /opt/ibm/cell-sdk/prototype + include $(CELL_TOP)/make.footer +endif diff --git a/src/BulletCollision/ibmsdk/Makefile b/src/BulletCollision/ibmsdk/Makefile index 7f3aab3f0..ce21904e5 100644 --- a/src/BulletCollision/ibmsdk/Makefile +++ b/src/BulletCollision/ibmsdk/Makefile @@ -49,6 +49,7 @@ btCollisionDispatcher.o \ btCollisionObject.o \ btCollisionWorld.o \ btCompoundCollisionAlgorithm.o \ +btConvexPlaneCollisionAlgorithm.o \ btConvexConcaveCollisionAlgorithm.o \ btConvexConvexAlgorithm.o \ btEmptyCollisionAlgorithm.o \