Linux, make fails

Post Reply
mat
Posts: 2
Joined: Mon Jul 19, 2021 1:06 pm

Linux, make fails

Post by mat »

Dear all,
I would like to build and run the Bullet engine on a Ubuntu 18.04 server.

As written in the Git repo: https://github.com/bulletphysics/bullet3
I am executing the following commands:

Code: Select all

./build_cmake_pybullet_double.sh
cd build3
./premake4_linux64 --double gmake
cd gmake
make
During "==== Building Test_BulletCollision (release64) ====" it throws the following error and abords the buil process:

Code: Select all

==== Building Test_BulletCollision (release64) ====
Linking Test_BulletCollision
obj/x64/Release/Test_BulletCollision/main.o: In function `(anonymous namespace)::TriangleCollector::~TriangleCollector()':
main.cpp:(.text+0x38f): undefined reference to `btTriangleCallback::~btTriangleCallback()'
obj/x64/Release/Test_BulletCollision/main.o: In function `(anonymous namespace)::BulletCollisionTest_Heightfield_ProcessAllTriangles_FiltersByUpAxis_Test::TestBody()':
main.cpp:(.text+0xfdce): undefined reference to `btHeightfieldTerrainShape::btHeightfieldTerrainShape(int, int, void const*, double, double, double, int, PHY_ScalarType, bool)'
main.cpp:(.text+0xfe82): undefined reference to `btHeightfieldTerrainShape::processAllTriangles(btTriangleCallback*, btVector3 const&, btVector3 const&) const'
main.cpp:(.text+0xff6e): undefined reference to `btHeightfieldTerrainShape::processAllTriangles(btTriangleCallback*, btVector3 const&, btVector3 const&) const'
main.cpp:(.text+0xffd3): undefined reference to `btTriangleCallback::~btTriangleCallback()'
main.cpp:(.text+0xffea): undefined reference to `btHeightfieldTerrainShape::~btHeightfieldTerrainShape()'
main.cpp:(.text+0x101b1): undefined reference to `btTriangleCallback::~btTriangleCallback()'
main.cpp:(.text+0x101c8): undefined reference to `btHeightfieldTerrainShape::~btHeightfieldTerrainShape()'
obj/x64/Release/Test_BulletCollision/main.o: In function `(anonymous namespace)::TriangleCollector::~TriangleCollector()':
main.cpp:(.text+0x37b): undefined reference to `btTriangleCallback::~btTriangleCallback()'
obj/x64/Release/Test_BulletCollision/main.o:(.data.rel.ro+0xd0): undefined reference to `typeinfo for btTriangleCallback'
collect2: error: ld returned 1 exit status
Test_BulletCollision.make:101: recipe for target '../../bin/Test_BulletCollision_gmake_x64_release' failed
make[1]: *** [../../bin/Test_BulletCollision_gmake_x64_release] Error 1
Makefile:224: recipe for target 'Test_BulletCollision' failed
make: *** [Test_BulletCollision] Error 2
Any ideas what went wrong?

Best regards
mat
User avatar
drleviathan
Posts: 849
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: Linux, make fails

Post by drleviathan »

The first line of your commands should have successfully built the project:

Code: Select all

./build_cmake_pybullet_double.sh
It works for me on Ubuntu-20.04 with cmake-3.20..3, make-4.2.1.

I tried your premake recipe and it failed for the same error. I do not believe the premake config is maintained. My memory tells me that I tried building Bullet with premake about six years ago and was only able to succeed after making changes to the build script. However, I never did submit those changes back to the codebase because they were part of a larger failed experiment.

For best results: use the cmake.
wil92
Posts: 1
Joined: Thu Nov 25, 2021 11:39 pm

Re: Linux, make fails

Post by wil92 »

drleviathan wrote: Tue Jul 20, 2021 1:18 am The first line of your commands should have successfully built the project:

Code: Select all

./build_cmake_pybullet_double.sh
It works for me on Ubuntu-20.04 with cmake-3.20..3, make-4.2.1.

I tried your premake recipe and it failed for the same error. I do not believe the premake config is maintained. My memory tells me that I tried building Bullet with premake about six years ago and was only able to succeed after making changes to the build script. However, I never did submit those changes back to the codebase because they were part of a larger failed experiment.

For best results: use the cmake.
Hi, I'm facing the same error, could you please tell me what you mean with:
For best result: use the cmake
. How can I use cmake to build library?
User avatar
drleviathan
Posts: 849
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: Linux, make fails

Post by drleviathan »

For best results: use the cmake.
I meant: don't use the premake build scripts: stick with cmake.

Hrm... I'm not seeing any Test_BulletCollision targets in the cmake configs. When I hunt around I find in test/collision/CMakeLists.txt there is a Test_Collision target. What version of Bullet do you think you're building? Maybe try downloading the latest version or pull the tip of master branch from github.
Post Reply