Disney Dynamica Bullet 2.76 not compile-Ubuntu 10.04 64-bit

mrplatzangst
Posts: 4
Joined: Sat Aug 21, 2010 9:10 pm

Disney Dynamica Bullet 2.76 not compile-Ubuntu 10.04 64-bit

Post by mrplatzangst »

Hi there,

I already posted in this thread, that I couldn't compile the plug-in successfully.

Now I realized, that it was definitely the wrong location. It has to go inside this forum!

I will continue the discussion here.
It would be nice if someone could join the threads.

So..
Again, my error message:

Code: Select all

[ 94%] Building CXX object Extras/MayaPlugin/CMakeFiles/BulletMayaPlugin.dir/bt_solver.o
/home/myself/Downloads/dynamica-Bullet-2.76-source/Extras/MayaPlugin/bt_solver.cpp: In member function ‘virtual void bt_solver_t::export_bullet_file(const char*)’:
/home/myself/Downloads/dynamica-Bullet-2.76-source/Extras/MayaPlugin/bt_solver.cpp:76: error: ‘fopen’ was not declared in this scope
/home/myself/Downloads/dynamica-Bullet-2.76-source/Extras/MayaPlugin/bt_solver.cpp:79: error: ‘stderr’ was not declared in this scope
/home/myself/Downloads/dynamica-Bullet-2.76-source/Extras/MayaPlugin/bt_solver.cpp:79: error: ‘fprintf’ was not declared in this scope
/home/myself/Downloads/dynamica-Bullet-2.76-source/Extras/MayaPlugin/bt_solver.cpp:86: error: ‘fwrite’ was not declared in this scope
/home/myself/Downloads/dynamica-Bullet-2.76-source/Extras/MayaPlugin/bt_solver.cpp:87: error: ‘fclose’ was not declared in this scope
make[2]: *** [Extras/MayaPlugin/CMakeFiles/BulletMayaPlugin.dir/bt_solver.o] Error 1
make[1]: *** [Extras/MayaPlugin/CMakeFiles/BulletMayaPlugin.dir/all] Error 2
make: *** [all] Error 2
A friend of mine advised me to add #include <stdio.h> to the bt_solver.cpp file.
...like this:

Code: Select all

#include "LinearMath/btSerializer.h"
#include "bt_solver.h"
#include "../BulletColladaConverter/ColladaConverter.h"
#include <string.h>
#include <stdio.h>
I decided to give it another try.

Code: Select all

make clean && cmake . -G "Unix Makefiles" && make
After some more successful compiling, it stopped here:

Code: Select all

[ 95%] Building CXX object Extras/MayaPlugin/CMakeFiles/BulletMayaPlugin.dir/bulletExport.o
[ 95%] Building CXX object Extras/MayaPlugin/CMakeFiles/BulletMayaPlugin.dir/rigidBodyNode.o
[ 95%] Building CXX object Extras/MayaPlugin/CMakeFiles/BulletMayaPlugin.dir/rigidBodyArrayNode.o
[ 96%] Building CXX object Extras/MayaPlugin/CMakeFiles/BulletMayaPlugin.dir/collisionShapeNode.o
[ 96%] Building CXX object Extras/MayaPlugin/CMakeFiles/BulletMayaPlugin.dir/solver.o
[ 96%] Building CXX object Extras/MayaPlugin/CMakeFiles/BulletMayaPlugin.dir/bt_solver.o
[ 96%] Building CXX object Extras/MayaPlugin/CMakeFiles/BulletMayaPlugin.dir/bt_rigid_body.o
[ 97%] Building CXX object Extras/MayaPlugin/CMakeFiles/BulletMayaPlugin.dir/dSolverNode.o
[ 97%] Building CXX object Extras/MayaPlugin/CMakeFiles/BulletMayaPlugin.dir/dSolverCmd.o
[ 97%] Building CXX object Extras/MayaPlugin/CMakeFiles/BulletMayaPlugin.dir/dRigidBodyCmd.o
[ 97%] Building CXX object Extras/MayaPlugin/CMakeFiles/BulletMayaPlugin.dir/dRigidBodyArrayCmd.o
[ 98%] Building CXX object Extras/MayaPlugin/CMakeFiles/BulletMayaPlugin.dir/pdbIO.o
[ 98%] Building CXX object Extras/MayaPlugin/CMakeFiles/BulletMayaPlugin.dir/drawUtils.o
[ 98%] Building CXX object Extras/MayaPlugin/CMakeFiles/BulletMayaPlugin.dir/constraint/dHingeConstraintCmd.o
[ 98%] Building CXX object Extras/MayaPlugin/CMakeFiles/BulletMayaPlugin.dir/constraint/dSliderConstraintCmd.o
[ 99%] Building CXX object Extras/MayaPlugin/CMakeFiles/BulletMayaPlugin.dir/constraint/hingeConstraintNode.o
[ 99%] Building CXX object Extras/MayaPlugin/CMakeFiles/BulletMayaPlugin.dir/constraint/sixdofConstraintNode.o
[ 99%] Building CXX object Extras/MayaPlugin/CMakeFiles/BulletMayaPlugin.dir/constraint/dNailConstraintCmd.o
[ 99%] Building CXX object Extras/MayaPlugin/CMakeFiles/BulletMayaPlugin.dir/constraint/dsixdofConstraintCmd.o
[100%] Building CXX object Extras/MayaPlugin/CMakeFiles/BulletMayaPlugin.dir/constraint/nailConstraintNode.o
[100%] Building CXX object Extras/MayaPlugin/CMakeFiles/BulletMayaPlugin.dir/constraint/sliderConstraintNode.o
Linking CXX shared library libBulletMayaPlugin.so
/usr/bin/ld: ../../src/BulletDynamics/libBulletDynamics.a(btGeneric6DofConstraint.o): relocation R_X86_64_32S against `vtable for btGeneric6DofConstraint' can not be used when making a shared object; recompile with -fPIC
../../src/BulletDynamics/libBulletDynamics.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [Extras/MayaPlugin/libBulletMayaPlugin.so] Error 1
make[1]: *** [Extras/MayaPlugin/CMakeFiles/BulletMayaPlugin.dir/all] Error 2
make: *** [all] Error 2
I think it tries to tell me to recompile something with -fPIC.

I tried the following code:

Code: Select all

export "CC=/usr/bin/gcc-4.4 -fPIC"; make
...same errors :-(

Any ideas?
Do you need additional information about my system? Tell me :-)

Greetings!
Last edited by mrplatzangst on Tue Aug 24, 2010 6:45 pm, edited 1 time in total.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Disney Dynamica Bullet 2.76 not compile-Ubuntu 10.04 64-

Post by Erwin Coumans »

Looks like you are using an out-of-date source tree, where and when did you get it?

That #include <stdio.h> was already fixed back in April 2010.
Also the -fPIC issue was fixed.

Can you please download the latest revision 41 from http://code.google.com/p/dynamica/downloads/list (or svn trunk) and see if that helps?
Thanks,
Erwin
mrplatzangst
Posts: 4
Joined: Sat Aug 21, 2010 9:10 pm

Re: Disney Dynamica Bullet 2.76 not compile-Ubuntu 10.04 64-

Post by mrplatzangst »

Hey Erwin,

thanks for the reply!

Ironically I did get the sources from the same website a few days ago. At least I think so.

These issues are fixed? This sounds awesome!
Now I definitely give it another try :-)

I will keep you updated!

Greetings

EDIT:
I have downloaded the new code in revision 41 and the compiler still has problems :-(

Code: Select all

unzip dynamica-src-rev41.zip
cd dynamica-src
cmake . -G "Unix Makefiles"
make
Then I get this:

Code: Select all

[ 99%] Building CXX object Extras/MayaPlugin/CMakeFiles/BulletMayaPlugin.dir/constraint/dsixdofConstraintCmd.o
[100%] Building CXX object Extras/MayaPlugin/CMakeFiles/BulletMayaPlugin.dir/constraint/nailConstraintNode.o
[100%] Building CXX object Extras/MayaPlugin/CMakeFiles/BulletMayaPlugin.dir/constraint/sliderConstraintNode.o
[100%] Building CXX object Extras/MayaPlugin/CMakeFiles/BulletMayaPlugin.dir/colladaExport.o
Linking CXX shared library libBulletMayaPlugin.so
/usr/bin/ld: ../LibXML/libXML.a(parser.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
../LibXML/libXML.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [Extras/MayaPlugin/libBulletMayaPlugin.so] Error 1
make[1]: *** [Extras/MayaPlugin/CMakeFiles/BulletMayaPlugin.dir/all] Error 2
make: *** [all] Error 2
There is still this -fPIC error. Just in a different file.

After some googling I found this article in the Gentoo Linux Documentation.
http://www.gentoo.org/proj/en/base/amd6 ... t=1&chap=3

It is about fixing -fPIC errors. In my case it recommends to recompile libXML.a with -fPIC enabled.
I'd love to do this, but how?

Greetings!
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Disney Dynamica Bullet 2.76 not compile-Ubuntu 10.04 64-

Post by Erwin Coumans »

Currently we only add the -fPic for C++ files but LibXML has C files.

Can you edit CMakeLists.txt in the Dynamica root directory, and add the following red lines around line 16, and see if that helps?

IF (UNIX AND NOT APPLE )
ADD_DEFINITIONS(-DBUILD_SHARED_LIBS=ON)
OPTION(BUILD_FPIC "Build Linux/Unix version using -fPIC" ON)
IF(BUILD_FPIC)
SET( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fPIC" )
SET( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fPIC" )
SET( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fPIC" )
SET( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fPIC" )

ENDIF(BUILD_FPIC)
ENDIF()

Thanks,
Erwin
mrplatzangst
Posts: 4
Joined: Sat Aug 21, 2010 9:10 pm

Re: Disney Dynamica Bullet 2.76 not compile-Ubuntu 10.04 64-

Post by mrplatzangst »

Thank you very much Erwin!

The plugin compiled without errors and it works!
You just made my day :-)

The only weird thing was the installation of the plugin itself. The README told me to run make install. But there was no make install target in the Makefile. I ended up copying the files into the right place by hand.

Greetings!
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Disney Dynamica Bullet 2.76 not compile-Ubuntu 10.04 64-

Post by Erwin Coumans »

Thanks for the feedback and testing.

The README is out of date and assume using the Makefile instead of CMake.

Thanks,
Erwin
mrotman
Posts: 1
Joined: Wed Sep 08, 2010 12:21 am

Re: Disney Dynamica Bullet 2.76 not compile-Ubuntu 10.04 64-

Post by mrotman »

I have been waiting for someone to compile Dynamica for linux for a very long time. Could you please post your working plugin? Or at least explain how to make one to someone without a lot of programming experience.

I am using Cent OS with maya 2011


thank you!!