Compiling odejava natives

Hi there,

I’m trying to compile the odejava natives but stuck with the following problem:
After running swig it leaves me with incomplete sources - especially OdeJNI.java has only half of the methods! If I take the Java sources from CVS it discovers that these methods are missing in the native part, too.

I’m using the CVS Version of odejava and the CVS Version of ode - are they incompatible? Or do I use a wrong swig Version (1.3.24)?
Perhaps someone can send me/check in the generated odejava_wrap.cxx?

Unfortunaltely the odejava.org page is down (some strange mysql error) so I can’t look there for info…

Any help appreciated.

Looks like one of the MySQL tables was corrupt. Lucky it wasn’t an important one. It’s now fixed. Thanks for telling me about it.

Check out: http://odejava.org/OdejavaCompileNative

Those notes were made in a bit of a hurry. I plan on recompiling the natives soon and will update that documentation.

May I ask why you are trying to compile the natives? Most people should use the ones we provide.

Will.

Ah, thanks, now I can read the doc - but where to get a “odejava-certified” ode source?
Which patches?! How to apply the patches? Guess I don’t need the Makefile patch when using VC? (I already managed to compile with that)

I want to compile the native stuff myself to have a look at that many crashes I get while using odejava, as they are pretty strange:
Some time everything seems to work properly, then I change some java file (nothing to do with the physics) then my app always crashes while starting, using java debug mode. Using non-debug mode everything is fine again - till the time I recompile my project; now default mode won’t start, but debug does! The errors all have an access violation in odejava.dll+xxxx. (using JDK1.5)
I already managed to track one of them down to a line in the ode sources - but with the incomplete lib…

https://odejava.dev.java.net/servlets/ProjectDocumentList?folderID=2191&expandFolder=2191&folderID=0

See: “ODE Sources”

I believe that contains pre-patched sources. If you plonk that into the odejava/compile directory, it should just work.

Some of those instructions are for updating the underlying ODE code which involves downloading the latest ODE sources, applying the patches and recompiling. Although if the ODE API changes, then more work is needed.

Will.

Ah, figured out the problem: It’s the SWIG Version: 1.3.24/23 does not work (even with the ode sources you specifed) - 1.3.20 does! It even works fine with the CVS source of ODE.

Why would one need the cylinder2 patch? Anything missing/not working if I don’t have it?

/Irrisor

actually no, you don’t need the cylinder2 patch currently.

re: swig – that is bad. Any idea why the newer versions didn’t work? I know that the really old SWIG versions (that some RedHat distros still sihpped with last October) do not work.

[quote]It even works fine with the CVS source of ODE.
[/quote]
And do the tests still run? If so – great!

Cheers,

Will.

[quote]Any idea why the newer versions didn’t work?
[/quote]
Sorry - no idea :frowning:

[quote] And do the tests still run?
[/quote]
Tests?! I could not find any Unit tests in the sources. ???

If you mean the Stuff in the org.odejava.test package - it can be run and does not complain about anything; they print some coordinates to System.out (except MultiGeomTest) … no real test result though.

no unit tests, but there are demos

You can launch them from the odejava-xith3d directory (you will need to add xith3d and its dependancies to your class path first).

Will.

OK, I have redone that documentation, it was terrible previously. Now it’s a bit more useful, although I would like to expand on it more.

http://odejava.org/OdejavaCompileNative

Please feel free to add your $0.02, if you join the Wiki, you can make changes to that page directly.

Cheers,

Will.

Hi William!

Today I tried my luck at compiling the Odejava natives, but without success. To stay clear of trouble, I downloaded the latest certified ODE source files referenced from the Odejava Wiki page, since those sources must have worked for somebody before me :slight_smile:

I’m trying to compile the Odejava natives for Linux.

The new Wiki page looks a lot better than the old one, so thumbs up! I’ll make a brief summary of what I did in order to make the sources compile:

1: I downloaded the latest certified ODE sources, as described on the Wiki page.
2: I copied user-settings.examples into both user-settings and user.settings (just to make sure I got the right file there - are you sure it should be user.settings, as the Wiki page says?), setting these variables:
PLATFORM=unix-gcc
PRECISION=SINGLE
BUILD=debug
WINDOWS16=0
OPCODE_DIRECTORY=OPCODE
3: I ran make-gcc.sh.

This gives the following error when make-gcc.sh is doing “make ode-lib” from the ode directory:

make: *** [ode/src/collision_trimesh_trimesh.o] Error 1

Later, when make-gcc.sh is making libodejava.so, these errors (or are they strictly speaking just warnings?) occur, and no libodejava.so file is generated:

g++: OPCODE/.o: No such file or directory
g++: OPCODE/Ice/
.o: No such file or directory

I guess the problem is that make-gcc.sh makes no attempt at compiling OPCODE, although the user-settings.example file states that the ODE build files will not do this for us. Has make-gcc really ever worked, or should I just find out how to compile OPCODE before I start compiling the Odejava natives?

Thanks in advance - any help greatly appreciated :slight_smile:

Ole

Oh well, I just read on the ODE mailing list that the ODE makefile actually does compile OPCODE, despite what is said in various ODE documentation.

So, my problems are probably not related to the Odejava makefile, but compiling ODE in general. Therefore, there’s no idea in me bugging this list with my problems in this regard. Sorry :wink:

Ole

One used to have to compile OPCODE seperatally hence the inconsistancy in the docs (they are just out of date).

Any luck?

What linux distro are you using? I last compiled this on Fedora2.

Will.

Hi again

when I compile odejava and ode myself everything works except a car demo (from jmephysics). The cars tires (cylinders) stick a little bit in the ground and the car does not move.
With the natives from Will (2004-10-30) it works fine.
What’s the difference? I used the CVS from ode and odejava and compiled with MS VS C++ .NET
Any ideas?

I figured out that it is caused by this call:

Ode.dGeomTriMeshDataBuildSingle1(data, tmpVertices, 12,
vertices.length, tmpIndices, indices.length, 12, tmpNormals);

when changing this to

Ode.dGeomTriMeshDataBuildSingle1(data, tmpVertices, 3,
vertices.length, tmpIndices, indices.length, 3, tmpNormals);

it works with the current CVS Version. What is correct? Why are 12 and 3 used, no named constants?

please see this thread (near the end)

http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=physics;action=display;num=1098477412;start=45#45

DP