From: Geoffrey H. <ge...@ge...> - 2006-10-27 21:49:41
|
On Oct 14, 2006, at 4:47 PM, richard apodaca wrote: > (3) edit openbabel.i: comment out line 27 (Swig can't > find std_list.i for Ruby - it works for Python, > though). Change line 5 to %module openbabel_wrap > (don't want to risk a collision w/ installed openbabel > library) Seems like it might soon be a good idea to have different openbabel.i files for the different scripting modules. The SVN version (for 2.1.0bX) has the std_list.i #ifdef'ed out automatically. > This generates lots of warnings that don't appear when > the argument is -python instead of -ruby (maybe this > is the problem): Nah. I get these for Perl and Python too. The problem is that C++ has different naming restrictions than scripting languages. So some functions may not be available until remapped. Not a problem for core functionality, as far as I've seen. > (8) save the following as "extconf.rb": > require 'mkmf' > > dir_config('openbabel') > dir_config('openbabel-2.0') > have_library('openbabel') > > create_makefile('openbabel_wrap') One bit which might be good is to have a path to the libopenbabel too. On my system it was looking in the normal search path, which may or may not work for everyone (e.g., with a custom --prefix call to the Open Babel configure script.) > (9) create the makefile: > > ruby extconf.rb > --with-openbabel-include='/usr/local/include/openbabel-2.0/openbabel' > --with-openbabel-2.0-include='/usr/local/include/openbabel-2.0' Ideally could this be something that could go into the scripts/ Makefile.am as a shell script? The Makefiles should have the correct paths already. > (13) require 'openbabel_wrap' > irb(main):001:0> require 'openbabel_wrap' Here (on OS X, Ruby 1.8.4), I get: irb(main):001:0> require 'openbabel_wrap' => true Not quite sure of enough ruby (or the binding) to try anything else yet... Maybe you should try this on the SVN version? I'd obviously like to get a ruby module into 2.1.0 anyway. Cheers, -Geoff |