compile bullet with cmake on mac osx problem

sefiroths
Posts: 21
Joined: Thu Nov 11, 2010 1:45 pm

compile bullet with cmake on mac osx problem

Post by sefiroths »

hi
i have readed Creating a project from scratch using XCode
i had this issues:

Code: Select all

"btTypedConstraint::serialize(void*, btSerializer*) const", referenced from:

 "btAlignedFreeInternal(void*)", referenced from:

then you have to include the Bullet frameworks in your Xcode project. Make sure they are built and installed like this (This is without Xcode, maybe there is some way to make them in Xcode too, I don't know):

   cmake . -G "Unix Makefiles" -DINSTALL_LIBS=ON -DBUILD_SHARED_LIBS=ON \
    -DFRAMEWORK=ON  -DCMAKE_OSX_ARCHITECTURES='i386;x86_64' \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/Library/Frameworks \
    -DCMAKE_INSTALL_NAME_DIR=/Library/Frameworks -DBUILD_DEMOS:BOOL=OFF
   make -j4
   sudo make install
however after make -j4
i have this log:

Code: Select all

Linking CXX shared library BulletSoftBodySolvers_CPU.framework/Versions/2.78/BulletSoftBodySolvers_CPU
[100%] Built target BulletSoftBodySolvers_CPU
Linking CXX shared library BulletSoftBodySolvers_OpenCL_Mini.framework/Versions/2.78/BulletSoftBodySolvers_OpenCL_Mini
Undefined symbols:
  "_clGetProgramInfo", referenced from:
      CLFunctions::compileCLKernelFromString(char const*, char const*, char const*)in btSoftBodySolver_OpenCL.o
      CLFunctions::compileCLKernelFromString(char const*, char const*, char const*)in btSoftBodySolver_OpenCL.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Undefined symbols:
  "_clGetProgramInfo", referenced from:
      CLFunctions::compileCLKernelFromString(char const*, char const*, char const*)in btSoftBodySolver_OpenCL.o
      CLFunctions::compileCLKernelFromString(char const*, char const*, char const*)in btSoftBodySolver_OpenCL.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/zm/zmsG5haUFwG-RvEo3bYwRE+++TI/-Tmp-//ccGK41tT.out (No such file or directory)
make[2]: *** [src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/MiniCL/BulletSoftBodySolvers_OpenCL_Mini.framework/Versions/2.78/BulletSoftBodySolvers_OpenCL_Mini] Error 1
make[1]: *** [src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/MiniCL/CMakeFiles/BulletSoftBodySolvers_OpenCL_Mini.dir/all] Error 2
make: *** [all] Error 2
sefis-Mac-Pro:bullet-2.78 sefi$ 
all other seems right no errors so i report only the end.
are this errors normal?

i have found that is an issue fixed, i redownload from svn and retry
termhn
Posts: 11
Joined: Wed Jun 29, 2011 3:49 pm

Re: compile bullet with cmake on mac osx problem

Post by termhn »

This is a bug in 2.78. Do an svn checkout to get th latest version:

Code: Select all

Svn checkout http://bullet.googlecode.com/svn/trunk
That's assuming you're on Mac. Before doing that, cd into the folder you want the stuff to go in. Say "bullet-svn" maybe. Then cmake and make again and there shouldn't be an error. If you're trying to use for iPhone dev that won't work, just say and I'll explain how.
sefiroths
Posts: 21
Joined: Thu Nov 11, 2010 1:45 pm

Re: compile bullet with cmake on mac osx problem

Post by sefiroths »

ok i have compiled correctly, and followed the tut creating from scratch, added the 5 framework generated by cmake to the project,
but still get an error:

btAlignedFreeInternal(void*) referenced from [...] symbols not found...
i started with Create a new C++ console application, using XCode from the tut, however i'll wat to use for iPhone dev after that...
thanks
termhn
Posts: 11
Joined: Wed Jun 29, 2011 3:49 pm

Re: compile bullet with cmake on mac osx problem

Post by termhn »

do this:
trim down the src folder. The only things you need are "btBulletDynamicsCommon.h", "btBulletCollisionCommon.h", "Bullet Collision", "Bullet Dynamics", "Linear Math", and "Bullet Soft Body", and you might only need some of those. But anyway, I'm assuming you've created another folder called "src" and put only those in it. Drag that into xcode and check the copy thing. Then you have to go into your build settings (project->edit project settings->build) and search for header search paths. then put in a not recursive header search path "./src/" without quotes into "Header Search Paths", and "User Header Search Paths" Then you should be able to build.
sefiroths
Posts: 21
Joined: Thu Nov 11, 2010 1:45 pm

Re: compile bullet with cmake on mac osx problem

Post by sefiroths »

unfortunately doesn't work for me...
over 1000 errors occurs...
You do not have the required permissions to view the files attached to this post.
sefiroths
Posts: 21
Joined: Thu Nov 11, 2010 1:45 pm

Re: compile bullet with cmake on mac osx problem

Post by sefiroths »

when i deleted references in project of the other folders all went well, thanks!