ammo.js icon indicating copy to clipboard operation
ammo.js copied to clipboard

undefined symbol errors when making with BT_USE_DOUBLE_PRECISION

Open yarpee opened this issue 4 years ago • 6 comments

I have a rayTest problem like this(https://github.com/bulletphysics/bullet3/issues/1947), so I want to test the BT_USE_DOUBLE_PRECISION macro。

I modified the make.py(added -DBT_USE_DOUBLE_PRECISION):

    stage('Build bindings')

    args = ['-DBT_USE_DOUBLE_PRECISION', '-I../src', '-c']
    for include in INCLUDES:
      args += ['-include', include]
    emscripten.Building.emcc('glue.cpp', args, 'glue.o')
    assert(os.path.exists('glue.o'))

    # Configure with CMake on Windows, and with configure on Unix.
    cmake_build = emscripten.WINDOWS

    if cmake_build:
      if not os.path.exists('CMakeCache.txt'):
        stage('Configure via CMake')
        emscripten.Building.configure([emscripten.PYTHON, os.path.join(EMSCRIPTEN_ROOT, 'emcmake'), 'cmake', '..', '-DBUILD_DEMOS=OFF', '-DBUILD_EXTRAS=OFF', '-DBUILD_CPU_DEMOS=OFF', '-DUSE_GLUT=OFF', '-DCMAKE_BUILD_TYPE=Release'])
    else:
      if not os.path.exists('config.h'):
        stage('Configure (if this fails, run autogen.sh in bullet/ first)')
        emscripten.Building.configure(['../configure', '--disable-demos','--disable-dependency-tracking'])

    stage('Make')

and modified the ammo.idl(replaced keyword 'float' to 'double').

Make succeed but link throw errors:

error: undefined symbol: _ZN10btSoftBody10appendNodeERK9btVector3d
warning: To disable errors for undefined symbols use `-s ERROR_ON_UNDEFINED_SYMBOLS=0`
error: undefined symbol: _ZN10btSoftBody12appendAnchorEiP11btRigidBodybd
error: undefined symbol: _ZN10btSoftBody12setTotalMassEdb
error: undefined symbol: _ZN10btSoftBody7setMassEid
error: undefined symbol: _ZN10btSoftBodyC1EP19btSoftBodyWorldInfoiPK9btVector3PKd
error: undefined symbol: _ZN11btConeShapeC1Edd
error: undefined symbol: _ZN11btRigidBody10setDampingEdd
error: undefined symbol: _ZN11btRigidBody12setMassPropsEdRK9btVector3
error: undefined symbol: _ZN11btShapeHull9buildHullEd
error: undefined symbol: _ZN12btConeShapeXC1Edd
error: undefined symbol: _ZN12btConeShapeZC1Edd
error: undefined symbol: _ZN14btAngularLimit3setEddddd
error: undefined symbol: _ZN14btCapsuleShapeC1Edd
error: undefined symbol: _ZN15btCapsuleShapeXC1Edd
error: undefined symbol: _ZN15btCapsuleShapeZC1Edd
error: undefined symbol: _ZN16btRaycastVehicle16applyEngineForceEdi
error: undefined symbol: _ZN16btRaycastVehicle16setSteeringValueEdi
error: undefined symbol: _ZN16btRaycastVehicle16updateSuspensionEd
error: undefined symbol: _ZN16btRaycastVehicle8addWheelERK9btVector3S2_S2_ddRKNS_15btVehicleTuningEb
error: undefined symbol: _ZN16btRaycastVehicle8setBrakeEdi
error: undefined symbol: _ZN17btConvexHullShapeC1EPKdii
error: undefined symbol: _ZN17btHingeConstraint14setMotorTargetEdd
error: undefined symbol: _ZN17btSoftBodyHelpers17CreateFromTriMeshER19btSoftBodyWorldInfoPKdPKiib
error: undefined symbol: _ZN18btMultiSphereShapeC1EPK9btVector3PKdi
error: undefined symbol: _ZN18btStaticPlaneShapeC1ERK9btVector3d
error: undefined symbol: _ZN25btHeightfieldTerrainShapeC1EiiPKvdddi14PHY_ScalarTypeb
error: undefined symbol: _ZN29btGeneric6DofSpringConstraint10setDampingEid
error: undefined symbol: _ZN29btGeneric6DofSpringConstraint12setStiffnessEid
error: undefined symbol: _ZN29btGeneric6DofSpringConstraint19setEquilibriumPointEid
error: undefined symbol: _ZN30btKinematicCharacterController10setGravityEd
error: undefined symbol: _ZN30btKinematicCharacterController11setMaxSlopeEd
error: undefined symbol: _ZN30btKinematicCharacterController12setFallSpeedEd
error: undefined symbol: _ZN30btKinematicCharacterController12setJumpSpeedEd
error: undefined symbol: _ZN30btKinematicCharacterController16setMaxJumpHeightEd
error: undefined symbol: _ZN30btKinematicCharacterControllerC1EP24btPairCachingGhostObjectP13btConvexShapedi
error: undefined symbol: _ZNK16btCollisionShape17getBoundingSphereER9btVector3Rd
error: undefined symbol: _ZNK16btCollisionShape27getContactBreakingThresholdEd
error: undefined symbol: _ZNK16btCollisionWorld15convexSweepTestEPK13btConvexShapeRK11btTransformS5_RNS_20ConvexResultCallbackEd
Error: Aborting compilation due to previous errors
shared:ERROR: '/Users/knightzhu/Downloads/emsdk-master/node/12.9.1_64bit/bin/node /Users/knightzhu/Downloads/emsdk-master/fastcomp/emscripten/src/compiler.js /var/folders/p_/zqd1ksvn3gqbvrvx85ckf_whsbyxm6/T/tmpFx04O8.txt /Users/knightzhu/Downloads/emsdk-master/fastcomp/emscripten/src/library_pthread_stub.js' failed (1)

I tried '-s ERROR_ON_UNDEFINED_SYMBOLS=0', generated ammo.js succeed but throw runtime error: missing function: _ZN15btCapsuleShapeXC1Edd

Anybody can help?

yarpee avatar Jan 02 '20 02:01 yarpee

I have the same errors. @kripken Would you have few minutes to look at this?

tgrajewski avatar May 05 '20 14:05 tgrajewski

No idea offhand what could cause this. To debug it, I'd pick one of those symbols, and then use llvm-nm to look at all the input files for the link command, to make sure it's actually there.

kripken avatar May 05 '20 15:05 kripken

@tgrajewski @yarpee Did you find a solution for this?

Thanks!

bbird5490 avatar Sep 20 '22 11:09 bbird5490

I didn't found a solution, I've just not used BT_USE_DOUBLE_PRECISION at all.

tgrajewski avatar Sep 20 '22 11:09 tgrajewski

@tgrajewski Ok thank you!

bbird5490 avatar Sep 20 '22 12:09 bbird5490

Anyone found a solution yet?

stevedekorte avatar Nov 09 '22 20:11 stevedekorte