MantisBT - opensim
View Issue Details
0006545opensim[REGION] Physics Enginespublic2013-02-15 16:272014-06-30 02:30
Robert Adams 
master (dev code) 
Grid (Multiple Regions per Sim)
Mono / Linux64
0006545: BULLETSIM: ldd reports as not a dynamic executable
OpenSim will not start with bulletsim enabled:

22:39:44 - [BULLETS SCENE]: Selected bullet engine bulletunmanaged -> BulletUnmanaged/
22:39:44 - [APPLICATION]:
APPLICATION EXCEPTION DETECTED: System.UnhandledExceptionEventArgs

Exception: System.DllNotFoundException: lib64/
  at (wrapper managed-to-native) OpenSim.Region.Physics.BulletSPlugin.BSAPIUnman/BSAPICPP:Initialize2 (OpenMetaverse.Vector3,intptr,int,intptr,int,intptr,OpenSim.Region.Physics.BulletSPlugin.BSAPIUnman/BSAPICPP/DebugLogCallback)

On further investigation both lib32/ and lib64/ are reported as 'not a dynamic executable' by ldd.

I've tested this on two servers, both running centos 5 x86_64 with mono 2.10.2, one is an openvz VM the other a VMware VM, and get the same result. Other .so files work ok with ldd and ODE physics works fine.
No tags attached.
Issue History
2013-02-15 16:27jak.danielsNew Issue
2013-02-16 11:17jak.danielsNote Added: 0023576
2013-02-16 11:24nebadonAssigned To => Robert Adams
2013-02-16 11:24nebadonStatusnew => assigned
2013-02-17 11:14Robert AdamsNote Added: 0023578
2013-03-01 12:31jak.danielsNote Added: 0023616
2013-03-01 15:12Robert AdamsNote Added: 0023617
2013-03-07 12:27jak.danielsNote Added: 0023645
2014-06-30 02:30Jak DanielsNote Added: 0026414

2013-02-16 11:17   
ldd works on RHEL/Centos 6, producing the output

ldd => (0x00007fff44dff000) => /usr/lib64/ (0x00007f943dbee000) => /lib64/ (0x00007f943d96a000) => /lib64/ (0x00007f943d753000) => /lib64/ (0x00007f943d3d4000)
        /lib64/ (0x00007f943e216000)

so I got to wondering if there were differences in the way shared objects can be optimised by the compiler depending on the platform and whether this might have compatibility issues. My search turned up this from the LDP: [^]

"Use -fPIC or -fpic to generate code. Whether to use -fPIC or -fpic to generate code is target-dependent. The -fPIC choice always works, but may produce larger code than -fpic (mnenomic to remember this is that PIC is in a larger case, so it may produce larger amounts of code). Using -fpic option usually generates smaller and faster code, but will have platform-dependent limitations, such as the number of globally visible symbols or the size of the code. The linker will tell you whether it fits when you create the shared library. When in doubt, I choose -fPIC, because it always works."

I don't know which flag was given to gcc when compiling, and I know this is probably a long shot, but it might possibly be the problem?
Robert Adams   
2013-02-17 11:14   
Sadly, BulletSim is already being built with "-fPIC". I will have to keep looking.
2013-03-01 12:31   
What version of gcc is used to compile it and on what platform?
Is Bulletsim available as source so I can try compiling it with the gcc from RHEL5?
thanks :-)
Robert Adams   
2013-03-01 15:12   
BulletSim sources are in the OpenSimulator 'libs' repository:
"git clone git://". [^] In the subdirectory "trunk/unmanaged/BulletSim" you will find a BUILD.TXT with the instructions for building Bullet itself and then building and linking BulletSim.
2013-03-07 12:27   
Ok, have compiled on Centos 5 and the works just fine! If you could tell me what distro and tool-chain version you used to compile, then I could set up a VM like that and experiment with the build flags to see if I can make the build process compatible with Cenos/RHEL5. Its still a popular distro on VPS's ;-)
Jak Daniels   
2014-06-30 02:30   
bin/lib64/ is compiled/linked with a newer gcc and the shared object library has a platform type set in its header which makes centos 5 not able to recognise it as a valid shared object.

in your opensim directory try typing:
ldd ./bin/lib64/
to see if it is recognised as a valid shared object library

for me on centos 5 it returns: not a dynamic executable

there is a very hacky fix you can do which is to change a byte in the header of the .so file so that the platform type is one that is recognised by centos 5 ldd

cp ./bin/lib64/ ./bin/lib64/
printf "\x00" | dd bs=1 seek=7 count=1 conv=notrunc

then ldd should recognise the shared library!