interrogate prevents installation on Bullet

When I try to use the:
sudo python2.7 makepanda/ --everything
command to make panda, the installation stops at roughly 50% where it is interrogating built/panda/input/

Here is the exact output:

[ 50%] Building Interrogate database built/pandac/input/
*** Error in BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h near line 45, column 1:
syntax error, unexpected IDENTIFIER, expecting ‘)’
Error parsing file: ‘btBulletCollisionCommon.h’
Storing dependency cache.
Elapsed Time: 31 sec
The following command returned a non-zero value: built/bin/interrogate -srcdir panda/src/bullet -Ipanda/src/bullet -Dvolatile -Dmutable -DCPPPARSER -D__STDC__=1 -D__cplusplus -D__inline -D__const=const -D__attribute__(x)= -D_LP64 -oc built/tmp/libpandabullet_igate.cxx -od built/pandac/input/ -fnames -string -refcount -assert -python-native -Sbuilt/include/parser-inc -Ipanda/src/bullet -Sbuilt/tmp -Sbuilt/include -S/usr/include/python2.7 -S/usr/include/eigen3 -Sinclude/bullet -module panda3d.bullet -library libpandabullet btBulletCollisionCommon.h btBulletDynamicsCommon.h bulletAllHitsRayResult.h bulletBaseCharacterControllerNode.h bulletBodyNode.h bulletBoxShape.h bulletCapsuleShape.h bulletCharacterControllerNode.h bulletClosestHitRayResult.h bulletClosestHitSweepResult.h bulletConeShape.h bulletConeTwistConstraint.h bulletConstraint.h bulletContactCallbackData.h bulletContactCallbacks.h bulletContactResult.h bulletConvexHullShape.h bulletConvexPointCloudShape.h bulletCylinderShape.h bulletDebugNode.h bulletFilterCallbackData.h bulletGenericConstraint.h bulletGhostNode.h bulletHeightfieldShape.h bulletHelper.h bulletHingeConstraint.h bulletManifoldPoint.h bulletMinkowskiSumShape.h bulletMultiSphereShape.h bulletPersistentManifold.h bulletPlaneShape.h bulletRigidBodyNode.h bulletRotationalLimitMotor.h bulletShape.h bulletSliderConstraint.h bulletSoftBodyConfig.h bulletSoftBodyControl.h bulletSoftBodyMaterial.h bulletSoftBodyNode.h bulletSoftBodyShape.h bulletSoftBodyWorldInfo.h bulletSphereShape.h bulletSphericalConstraint.h bulletTickCallbackData.h bulletTranslationalLimitMotor.h bulletTriangleMesh.h bulletTriangleMeshShape.h bulletVehicle.h bulletWheel.h bulletWorld.h bullet_includes.h bullet_utils.h config_bullet.h p3bullet_composite.cxx

where the specified file and line number is:

42 struct ClosestPointInput
43 {
44 ClosestPointInput():m_maximumDistanceSquared(btScalar(BT_LARGE_FLOAT))
45 {
46 }
48 btTransform m_transformA;
49 btTransform m_transformB;
50 btScalar m_maximumDistanceSquared;
51 };
53 virtual ~btDiscreteCollisionDetectorInterface() {};

the problem is that I do not see any reason for the parser to complain here as there doesnt seem to be any missing “)” as it suggests, nor any other obvious programming error that I can see. I fear altering the code will result in poor/inaccurate physics. Is there any known solution to this problem, or any best course of action?

As a supplemental I am running debian “wheezy” and I added all of the bullet libraries and headers into the /panda/src/bullet directory as it was unable to find them previously and I did not want to modify my library enviroment variables so that bullet is always included by default (I have heard this is a bad thing to do).

Thanks for your time and consideration!


Hi, welcome to the Panda3D community! :slight_smile:

This type of error in Interrogate usually indicates that it has misunderstood a previously encountered type; it may not have seen or understood the definition of btScalar, for instance.

However, interrogate doesn’t need to parse the Bullet headers, since we don’t expose it directly to Python. We have stub headers somewhere that we tell interrogate to use whenever it encounters a Bullet include, to protect the sensitive eyes of Interrogate from what it doesn’t need to see. However, by putting the Bullet includes directly into the source tree, you are circumventing that, and Interrogate thinks it has to parse them just as any Panda source file.

Makepanda does have a directory where you can put your includes and libraries, however, that won’t interfere with Interrogate. You should create a directory called thirdparty/linux-libs-x64/bullet/ with subdirectories “include” and “lib” in which you can put the appropriate header files and libraries, respectively.
(linux-libs-x64 is for 64-bit systems, linux-libs-a for 32-bit systems)
makepanda will automatically know where to look for them, as long as you get the directory naming right.

You should also never run makepanda as root. Makepanda won’t modify system directories. (Instead, run it with the --installer flag added so that it produces a .deb file for you to install).

Thank you! I am really excited to start working with Panda3D and I have heard that this is a really great community!

I followed your suggestions and I was able to progress another 1% until this popped up:

[ 51%] Linking dynamic library built/lib/
/usr/bin/ld: built/lib/libBulletSoftBody.a(btSoftBody.o): relocation R_X86_64_32 against `_ZGVZN11btTransform11getIdentityEvE17identityTransform’ can not be used when making a shared object; recompile with -fPIC
built/lib/libBulletSoftBody.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
Storing dependency cache.
Elapsed Time: 39 min 44 sec
The following command returned a non-zero value: g++ -shared -Wl, -o built/lib/ -Lbuilt/lib -Lbuilt/tmp built/tmp/pandabullet_pandabullet.o built/tmp/p3bullet_composite.o built/lib/ built/lib/ built/lib/ built/lib/ -pthread -Lthirdparty/linux-libs-x64/bullet/lib -L/usr/X11R6/lib -lBulletSoftBody -lBulletDynamics -lBulletCollision -lLinearMath -ldl

However, recompiling with the -fPIC does not change anything - is there another trick to this problem?

Thanks a ton!

The problem is that you are using static (.a) versions of the Bullet libraries, and you can’t link a static library into a shared library unless the static library has been compiled with relocatable code (ie. compiled with the -fPIC flag).

So, you should either recompile Bullet using shared (.so) libraries, or you should recompile Bullet with the -fPIC flag. I would suggest that you use shared libraries.

I can’t believe I overlooked that… Terribly sorry about that last bit. Thank you very much! Everything seems to be in order!