Compiling odejava and ode from scratch

I’m having terrible difficulty trying to compile ode and odejava from scratch, mostly because the instructions don’t add up. If filenames aren’t exact, I’m doing this from memory, so bear with me.
Here is what I did on my Mac (osx 10.4.10):

  1. Checked out odejava from odejava’s cvs
  2. Downloaded ode-.9 source
  3. Looking at the various readmes, I put the source in compile/odejava/ode, although there was no config/user_settings to edit.
  4. Ignoring this problem, I tried to compile ODE by running the configure script and then make.
    a. Couldn’t get it to compile with OPCODE, compiled when I edited some include statements for GIMPACT, however even though it generated no errors, there were no libraries outputted for my use (or .o files that I could tell). The directories it claimed to put them in didn’t exist (I think they were /usr/local/lib (this one existed but had no new files in it after running make) and /usr/local/ode).

This is essentially where I gave up. I’m just looking for up to date binaries and .jar libraries for odejava, but odejava.org seemed very out of date (since 2004 for the natives). Are there any more up-to-date packaged versions out there (preferably able to run ode .9, since that has new features that I would like).

odejava-jni has build-scripts in the build folder. We are currently struggling with building universal binaries, but if you remove one of the -arch flags osx binaries should build fine. Probably you can even help out with the universal binaries?
You can use odejava-jni (HEAD) with the other odejava parts in the branch “with-odejava-jni”.

That may have been my problem, I just checked out the odejava branch and not odejava-jni. I’ll give that a try once I have a bit more free time and I’ll let you know how it went. If I figure out how to get it working, I’d be glad to write up a more modern tutorial for mac users.

Starting from the odejava-jni branch, I’ve successfully been able to compile ode-0.9. Here are some notes of what I had to change to make it work correctly:
0. Make sure XCode is installed since that gives mac the gcc compiler.

  1. Can’t use svn, doesn’t give the configure file (sh autogen.sh didn’t help either). Used the snapshot release from sourceforge.
  2. run ./configure --enable-release --with-trimesh=gimpact. The other options in odejava readme caused it to fail.
  3. open GIMPACT/src/gim_memory.cpp and remove the include for malloc.h (not necessary for mac os x)
  4. run make
  5. The .o files and libode.dylib are placed in ./ode/src even though the configure script claims they go to /usr/local/include and /usr/local/lib

That’s the good news. The bad news is that I’m stuck running swig to generate the necessary files. I used the newest swig if it makes a difference. To get it to not generate errors, I had to change some paths in the odejava.i file, although it confused me as to why some worked and others didn’t since they all seemed to point incorrectly. Anyway, once it ran, there were no new files placed in the generated/ folder.

Any help would be appreciated.

Actually swig did generate code, just once again in a place unexpected --> went to generated/org/etc instead of generated/java/org/etc
Anyway with that discovered I began trying to compile and link the odejava stuff and it made more errors. I got around some by moving some of the opende directories so that the include statements could actually read them (this is also where I’m having trouble since I’m not familiar with gcc so I don’t know the purpose or syntax for all of the flagged options). When running these, there are thousands of errors generated from the odejava.cxx file. Oddly enough the errors shouldn’t be errors when looking at the source code for odejava.cxx, so I have a feeling that I should use a slightly older version of swig.

Once I try this and the build scripts in the build folder, if it doesn’t compile, I’m not sure that there is much more that I can try. Also, I think that someone needs to rewrite the odejava.i file for swig since ode has progressed a lot since the .i file was last written.

Tried the build scripts, didn’t work because I need a dos2unix executable. Where would I get one?

fink? (I don’t know - ask google ;)) You need new autotools (automake etc.) as well, these can be installed with fink, at least.