From 4ca8b997f98f614efa4fac5ab3e8078d2a97d387 Mon Sep 17 00:00:00 2001 From: Jannik Vogel Date: Mon, 8 Apr 2019 02:37:19 +0200 Subject: [PATCH 1/2] Reduce visibility of Bullet symbols in PyBullet Avoids version conflicts in programs using PyBullet, which also link against Bullet libraries --- examples/pybullet/pybullet.c | 3 +++ setup.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/examples/pybullet/pybullet.c b/examples/pybullet/pybullet.c index fe3b18799..0df3f14da 100644 --- a/examples/pybullet/pybullet.c +++ b/examples/pybullet/pybullet.c @@ -10842,6 +10842,9 @@ static struct PyModuleDef moduledef = { }; #endif +#if __GNUC__ >= 4 +__attribute__((visibility ("default"))) +#endif PyMODINIT_FUNC #if PY_MAJOR_VERSION >= 3 PyInit_pybullet(void) diff --git a/setup.py b/setup.py index adb6f3526..0e7429efc 100644 --- a/setup.py +++ b/setup.py @@ -370,6 +370,8 @@ if _platform == "linux" or _platform == "linux2": CXX_FLAGS += '-DDYNAMIC_LOAD_X11_FUNCTIONS ' CXX_FLAGS += '-DHAS_SOCKLEN_T ' CXX_FLAGS += '-fno-inline-functions-called-once ' + CXX_FLAGS += '-fvisibility=hidden ' + CXX_FLAGS += '-fvisibility-inlines-hidden ' EGL_CXX_FLAGS += '-DBT_USE_EGL ' EGL_CXX_FLAGS += '-fPIC ' # for plugins From bdf055307759cca0522951d64419e59af2dd9dc1 Mon Sep 17 00:00:00 2001 From: Steven Date: Tue, 9 Apr 2019 20:13:54 +0800 Subject: [PATCH 2/2] don't need to call the computeAccelerationsArticulatedBodyAlgorithmMultiDof() the second pass if the m_internalNeedsJointFeedback is false. --- src/BulletDynamics/Featherstone/btMultiBodyDynamicsWorld.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/BulletDynamics/Featherstone/btMultiBodyDynamicsWorld.cpp b/src/BulletDynamics/Featherstone/btMultiBodyDynamicsWorld.cpp index 1557987bc..faaa211f6 100644 --- a/src/BulletDynamics/Featherstone/btMultiBodyDynamicsWorld.cpp +++ b/src/BulletDynamics/Featherstone/btMultiBodyDynamicsWorld.cpp @@ -717,6 +717,7 @@ void btMultiBodyDynamicsWorld::solveConstraints(btContactSolverInfo& solverInfo) m_scratch_v.resize(bod->getNumLinks() + 1); m_scratch_m.resize(bod->getNumLinks() + 1); + if (bod->internalNeedsJointFeedback()) { if (!bod->isUsingRK4Integration()) {