From: richard a. <ric...@ya...> - 2006-11-06 02:04:03
|
I know Java is technically not a scripting language, but I was wondering if anyone was interested in trying to get a Java interface to OB working. I'm in the process of trying to do this. I've managed to get somewhere interesting, but I'm now stuck. I'm hoping that someone that knows more about this stuff than me can give a pointer or two. I know next to nothing about SWIG, C++, make, etc., so any information would be helpful. I'm using OB svn trunk rev 1587, amd64 Linux Mandriva 2007, SWIG 1.3.29. Here's what I've done so far: (1) cd scripts (2) mkdir java (3) cd java (4) swig -java -c++ -I../../src -o openbabel_java.cpp ../openbabel.i [This generates a bunch of *.java files and openbabel_java.cpp] (5) g++ -fpic -c openbabel_java.cpp -I/usr/java/jdk1.5.0_09/include -I/usr/java/jdk1.5.0_09/include/linux -I/usr/local/include/openbabel-2.0 -I/usr/local/include/openbabel-2.0/openbabel [this produces errors about sqrt, so I add a #include] (6) on line 1 of openbabel_java.cpp, add #include <math.h> (7) repeat step (5) - no errors this time (8) ld -G openbabel_java.o -o openbabel_java.so (9) javac *.java [produces 32 errors about missing classes such as OBChainsParser, OBBitVec, matrix3x3, OBAromaticTyper, and so on.] In looking at the java directory, I can see that none of the corresponding *.java files were created so. However, there are files such as OBMol.java. In the 32 errors I got after javac, none of them related to OBMol, or any of the other classes for which the *.java file is defined - as far as I can tell. So I conclude that for some reason SWIG is not generating the needed *.java files OBChainsParser.java, OBBitVec.java, etc, and their corresponding classes. I've tried adding #include and %import, %include, and %import for 'bitvec.h', but this still does not produce the OBBitVec.java file that seems to be needed. It looks like this is really close to working - it's just a matter of getting SWIG to generate these few java classes. Any ideas? cheers, Rich ____________________________ Richard Apodaca Blog: http://depth-first.com __________________________________________________________________________________________ Check out the New Yahoo! Mail - Fire up a more powerful email and get things done faster. (http://advision.webevents.yahoo.com/mailbeta) |