This list is closed, nobody may subscribe to it.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(5) |
Jul
(1) |
Aug
|
Sep
|
Oct
(1) |
Nov
(10) |
Dec
(22) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(3) |
Feb
(10) |
Mar
(5) |
Apr
(12) |
May
(8) |
Jun
(9) |
Jul
(3) |
Aug
(11) |
Sep
|
Oct
(26) |
Nov
(21) |
Dec
(20) |
2007 |
Jan
(10) |
Feb
(32) |
Mar
(14) |
Apr
(13) |
May
(44) |
Jun
(13) |
Jul
(18) |
Aug
(26) |
Sep
(17) |
Oct
(3) |
Nov
(10) |
Dec
(8) |
2008 |
Jan
(20) |
Feb
(8) |
Mar
(28) |
Apr
(18) |
May
(22) |
Jun
(13) |
Jul
(4) |
Aug
(2) |
Sep
(19) |
Oct
(17) |
Nov
(8) |
Dec
(10) |
2009 |
Jan
(4) |
Feb
(3) |
Mar
(12) |
Apr
(15) |
May
(7) |
Jun
(1) |
Jul
(13) |
Aug
(3) |
Sep
(5) |
Oct
(2) |
Nov
(14) |
Dec
(13) |
2010 |
Jan
(9) |
Feb
(6) |
Mar
(21) |
Apr
(12) |
May
(4) |
Jun
|
Jul
(2) |
Aug
(15) |
Sep
(3) |
Oct
(1) |
Nov
(18) |
Dec
(6) |
2011 |
Jan
(7) |
Feb
(13) |
Mar
(17) |
Apr
(7) |
May
(16) |
Jun
(21) |
Jul
(15) |
Aug
(11) |
Sep
(12) |
Oct
(3) |
Nov
(14) |
Dec
(4) |
2012 |
Jan
(10) |
Feb
(4) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
(3) |
Dec
(1) |
2013 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(1) |
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(4) |
Aug
|
Sep
(5) |
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: richard a. <ric...@ya...> - 2006-11-05 16:26:43
|
I get a segmentation fault on exiting interactive python after using CML: >>> import openbabel >>> mol=openbabel.OBMol() >>> c=openbabel.OBConversion() >>> c.SetInAndOutFormats('smiles', 'cml') True >>> c.ReadString(mol, 'c1ccccc1') True >>> print c.WriteString(mol) <molecule> <atomArray> <atom id="a1" elementType="C"/> <atom id="a2" elementType="C"/> <atom id="a3" elementType="C"/> <atom id="a4" elementType="C"/> <atom id="a5" elementType="C"/> <atom id="a6" elementType="C"/> </atomArray> <bondArray> <bond atomRefs2="a1 a2" order="1"/> <bond atomRefs2="a2 a3" order="2"/> <bond atomRefs2="a3 a4" order="1"/> <bond atomRefs2="a4 a5" order="2"/> <bond atomRefs2="a5 a6" order="1"/> <bond atomRefs2="a1 a6" order="2"/> </bondArray> </molecule> >>>#pressed [Ctrl-d] Segmentation fault My system is amd64 Linux (Mandriva 2007), Python 2.4.3 and Open Babel SVN trunk rev 1578. Running the above code with input set to 'smi' and output set to 'inchi' causes no segfault on exiting interactive python. I see a similar CML-releated problem when running OBRuby. In that case, I also don't get the segfault until interactive Ruby exits, or the Ruby interpreter finished executing. And there, I only see the problem when using CML, not with other format interconversions. Any ideas? thanks, Rich ____________________________ Richard Apodaca Blog: http://depth-first.com ____________________________________________________________________________________ Want to start your own business? Learn how on Yahoo! Small Business (http://smallbusiness.yahoo.com) |
From: richard a. <ric...@ya...> - 2006-11-05 16:14:04
|
Hi Marin, Your suggestion worked perfectly. I changed the first few lines of openbabel.py to the following: import sys if sys.platform.find("linux") != -1: #import dl sys.setdlopenflags(sys.getdlopenflags() | 0x100) Doing this I can now import openbabel, create a working OBConversion, and do a simple smiles->inchi conversion. Many thanks! Rich --- Martin Vogt <mar...@bi...> wrote: > Hi, > > there is indeed a simple workaround for this > problem. > Note that the dl module is only needed for the > numerical constant > > dl.RTLD_GLOBAL > > This constant is defined from a system header > 'dlfcn.h', if i recall > correctly. Searching through your system headers you > might find that > this constant is equal to 0x100 (at least on my > system: Suse 10.1 64bit). > So you can replace the top lines with: > > if sys.platform.find("linux") != -1: > sys.setdlopenflags(sys.getdlopenflags() | 0x100) > > avoiding the import of the dl module. > > Hth, Martin > > richard apodaca wrote: > > Has anyone gotten the Python Open Babel interface > to > > work on amd64 Linux? I'm using rev 1578 of the svn > > trunk > > > > When I try to import openbabel, I get the > following > > error > > > > > >>>>import openbabel > > > > Traceback (most recent call last): > > File "<stdin>", line 1, in ? > > File > > "/usr/lib64/python2.4/site-packages/openbabel.py", > > line 3, in ? > > import dl > > ImportError: No module named dl > > > > I noticed a similar problem reported here, but no > > solution: > > > > > http://sourceforge.net/mailarchive/message.php?msg_id=37015184 > > > > I had no problems either compiling or installing > > pyopenbabel - just loading it in python. > > > > My system does lack the python dl module, which as > far > > as I can tell is supposed to be standard. In > googling > > around, I found several references to the python > dl > > module being unstable on amd64 - and therefore not > > available. > > > > So - has anyone found a workaround to this > problem? > > > > I tried one: comment out the code responsible for > > loading dl in the first place (openbabel.py): > > > > if sys.platform.find("linux") != -1: > > import dl > > sys.setdlopenflags(sys.getdlopenflags() | > > dl.RTLD_GLOBAL) > > > > I can in fact import openbabel after doing this. > The > > problem is that when using OBConversion, none of > the > > formats are loaded: > > > > > >>>>import openbabel > >>>>c=openbabel.OBConversion() > > > > ============================== > > *** Open Babel Error in LoadFormatFiles > > /usr/local/lib/openbabel/cmlreactlformat.so did > not > > load properly > > ============================== > > > > ... and dozens more load errors after this one ... > > > > thanks, > > Rich > > > > > > > > > > ____________________________ > > Richard Apodaca > > Blog: http://depth-first.com > > > > > > > > > ____________________________________________________________________________________ > > Everyone is raving about the all-new Yahoo! Mail > > (http://advision.webevents.yahoo.com/mailbeta/) > > > > > > > ------------------------------------------------------------------------- > > Using Tomcat but need to do more? Need to support > web services, security? > > Get stuff done quickly with pre-integrated > technology to make your job easier > > Download IBM WebSphere Application Server v.1.0.1 > based on Apache Geronimo > > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > _______________________________________________ > > OpenBabel-scripting mailing list > > Ope...@li... > > > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > > > -- > Martin Vogt > Vorgebirgsstr. 14, D-53111 Bonn > Email: mo...@t-... Tel.: +49 > (0)228 634376 > ____________________________ Richard Apodaca Blog: http://depth-first.com ____________________________________________________________________________________ We have the perfect Group for you. Check out the handy changes to Yahoo! Groups (http://groups.yahoo.com) |
From: Martin V. <mar...@bi...> - 2006-11-05 12:01:51
|
Hi, there is indeed a simple workaround for this problem. Note that the dl module is only needed for the numerical constant dl.RTLD_GLOBAL This constant is defined from a system header 'dlfcn.h', if i recall correctly. Searching through your system headers you might find that this constant is equal to 0x100 (at least on my system: Suse 10.1 64bit). So you can replace the top lines with: if sys.platform.find("linux") != -1: sys.setdlopenflags(sys.getdlopenflags() | 0x100) avoiding the import of the dl module. Hth, Martin richard apodaca wrote: > Has anyone gotten the Python Open Babel interface to > work on amd64 Linux? I'm using rev 1578 of the svn > trunk > > When I try to import openbabel, I get the following > error > > >>>>import openbabel > > Traceback (most recent call last): > File "<stdin>", line 1, in ? > File > "/usr/lib64/python2.4/site-packages/openbabel.py", > line 3, in ? > import dl > ImportError: No module named dl > > I noticed a similar problem reported here, but no > solution: > > http://sourceforge.net/mailarchive/message.php?msg_id=37015184 > > I had no problems either compiling or installing > pyopenbabel - just loading it in python. > > My system does lack the python dl module, which as far > as I can tell is supposed to be standard. In googling > around, I found several references to the python dl > module being unstable on amd64 - and therefore not > available. > > So - has anyone found a workaround to this problem? > > I tried one: comment out the code responsible for > loading dl in the first place (openbabel.py): > > if sys.platform.find("linux") != -1: > import dl > sys.setdlopenflags(sys.getdlopenflags() | > dl.RTLD_GLOBAL) > > I can in fact import openbabel after doing this. The > problem is that when using OBConversion, none of the > formats are loaded: > > >>>>import openbabel >>>>c=openbabel.OBConversion() > > ============================== > *** Open Babel Error in LoadFormatFiles > /usr/local/lib/openbabel/cmlreactlformat.so did not > load properly > ============================== > > ... and dozens more load errors after this one ... > > thanks, > Rich > > > > > ____________________________ > Richard Apodaca > Blog: http://depth-first.com > > > > ____________________________________________________________________________________ > Everyone is raving about the all-new Yahoo! Mail > (http://advision.webevents.yahoo.com/mailbeta/) > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > OpenBabel-scripting mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting -- Martin Vogt Vorgebirgsstr. 14, D-53111 Bonn Email: mo...@t-... Tel.: +49 (0)228 634376 |
From: richard a. <ric...@ya...> - 2006-11-04 19:49:05
|
Has anyone gotten the Python Open Babel interface to work on amd64 Linux? I'm using rev 1578 of the svn trunk When I try to import openbabel, I get the following error >>> import openbabel Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib64/python2.4/site-packages/openbabel.py", line 3, in ? import dl ImportError: No module named dl I noticed a similar problem reported here, but no solution: http://sourceforge.net/mailarchive/message.php?msg_id=37015184 I had no problems either compiling or installing pyopenbabel - just loading it in python. My system does lack the python dl module, which as far as I can tell is supposed to be standard. In googling around, I found several references to the python dl module being unstable on amd64 - and therefore not available. So - has anyone found a workaround to this problem? I tried one: comment out the code responsible for loading dl in the first place (openbabel.py): if sys.platform.find("linux") != -1: import dl sys.setdlopenflags(sys.getdlopenflags() | dl.RTLD_GLOBAL) I can in fact import openbabel after doing this. The problem is that when using OBConversion, none of the formats are loaded: >>> import openbabel >>> c=openbabel.OBConversion() ============================== *** Open Babel Error in LoadFormatFiles /usr/local/lib/openbabel/cmlreactlformat.so did not load properly ============================== ... and dozens more load errors after this one ... thanks, Rich ____________________________ Richard Apodaca Blog: http://depth-first.com ____________________________________________________________________________________ Everyone is raving about the all-new Yahoo! Mail (http://advision.webevents.yahoo.com/mailbeta/) |
From: Sam A. <ter...@ya...> - 2006-10-28 21:26:54
|
Now everyone can check out the source code for the PyGTK project at http://code.google.com/p/pygtk-openbabel/ |
From: Geoffrey H. <ge...@ge...> - 2006-10-28 20:39:33
|
On Oct 28, 2006, at 1:54 AM, Sam Aarons wrote: > I have finished working on a PyGTK frontend to the always-great > program of OpenBabel. Cool! > Contributed Script Repository that Geoffrey has mentioned. That would be great. My suggestion was a bit more humble (i.e., small snippets showing SMARTS matching, analysis of molecules, ...). So I'm sure there would be a lot of interest in your project! If you send me a URL for a project page or download page, I'll get the rest started. Thanks! -Geoff |
From: richard a. <ric...@ya...> - 2006-10-28 06:08:53
|
Open Babel conversions work in Ruby! After studying the Python examples, I found that the Open Babel-Ruby interface handles SMILES and Molfile formats quite well (and presumably the others): $ irb irb(main):001:0> require 'openbabel_wrap' => true irb(main):002:0> obc=Openbabel_wrap::OBConversion.new => #<Openbabel_wrap::OBConversion:0x2b5d3ca6bf98> irb(main):003:0> mol=Openbabel_wrap::OBMol.new => #<Openbabel_wrap::OBMol:0x2b5d3ca670d8> irb(main):004:0> obc.SetInAndOutFormats("smi", "mdl") => true irb(main):005:0> obc.ReadString(mol, 'c1ccccc1') => true irb(main):006:0> mol.NumAtoms => 6 irb(main):007:0> mol.AddHydrogens => true irb(main):008:0> mol.NumAtoms => 12 irb(main):009:0> molfile=obc.WriteString mol => "\n OpenBabel10270622492D\n\n 12 12 0 0 0 0 0 0 0 0999 V2000\n 0.0000 0.0000 0.0000 C 0 0 0 0 0\n 0.0000 0.0000 0.0000 C 0 0 0 0 0\n 0.0000 0.0000 0.0000 C 0 0 0 0 0\n 0.0000 0.0000 0.0000 C 0 0 0 0 0\n 0.0000 0.0000 0.0000 C 0 0 0 0 0\n 0.0000 0.0000 0.0000 C 0 0 0 0 0\n 0.0000 0.0000 0.0000 H 0 0 0 0 0\n 0.0000 0.0000 0.0000 H 0 0 0 0 0\n 0.0000 0.0000 0.0000 H 0 0 0 0 0\n 0.0000 0.0000 0.0000 H 0 0 0 0 0\n 0.0000 0.0000 0.0000 H 0 0 0 0 0\n 0.0000 0.0000 0.0000 H 0 0 0 0 0\n 1 6 2 0 0 0\n 1 2 1 0 0 0\n 1 7 1 0 0 0\n 2 3 2 0 0 0\n 2 8 1 0 0 0\n 3 4 1 0 0 0\n 3 9 1 0 0 0\n 4 5 2 0 0 0\n 4 10 1 0 0 0\n 5 6 1 0 0 0\n 5 11 1 0 0 0\n 6 12 1 0 0 0\nM END\n" irb(main):010:0> I'm wondering about the best names for the library and its modules. For example, this looks ideal to me: require 'openbabel' # the name of the wrapper lib # is openbabel - assuming no # name clash w/ OB itself - I'll # check this out. mol = OpenBabel::OBMol.new obc = OpenBabel::OBConversion.new # etc. This is easy to set up by editing the wrapper generated by SWIG. With some simple Ruby metaprogramming techniques, it's even possible to give method names that follow Ruby convention: require 'openbabel' mol = OpenBabel::OBMol.new atom_count = mol.num_atoms mw = mol.mol_wt # ... etc. And then it might be worth offering a RubyGem. RMagick, which is the Ruby interface for ImageMagick followed this route. cheers, Rich --- richard apodaca <ric...@ya...> wrote: > Success! > > Geoff, I think this works now. I checked out OB-SVN. > With a couple of minor modifications (for example, > changing openbabel_ruby.cpp to openbabel_wrap.cpp, > adding #include <math.h>) - I'll detail them > shortly), > I got the scripts/ruby wrapper compiled. > > Behold: > > $ irb > irb(main):001:0> require 'openbabel_wrap' > => true > irb(main):002:0> m=Openbabel_wrap::OBMol.new > => #<Openbabel_wrap::OBMol:0x2ba75b5563c8> > irb(main):003:0> h=m.NewAtom > => #<Openbabel_wrap::OBAtom:0x2ba75b552778> > irb(main):004:0> h.SetAtomicNum(1) > => nil > irb(main):005:0> m.GetMolWt > => 1.00794 > > It looks like all of the format interconversion > utilities (smiles, mdl, etc) are missing, but we > should be able to fix that. The important thing is > now > we've got a good place to start from. > > It must have been the older version of OB that I was > using (2.0.2) that was the source of the problems. > > Could you verify that the above Ruby code works for > you too? > > BTW, I'll respond in more detail to you're > suggestions > below shortly. > > cheers, > Rich > > --- Geoffrey Hutchison <ge...@ge...> > wrote: > > > > > 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 > > > > > > > ____________________________________________________________________________________ > We have the perfect Group for you. Check out the > handy changes to Yahoo! Groups > (http://groups.yahoo.com) > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support > web services, security? > Get stuff done quickly with pre-integrated > technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 > based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > OpenBabel-scripting mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > ____________________________________________________________________________________ Low, Low, Low Rates! Check out Yahoo! Messenger's cheap PC-to-Phone call rates (http://voice.yahoo.com) |
From: Sam A. <ter...@ya...> - 2006-10-28 05:55:02
|
I have finished working on a PyGTK frontend to the always-great program of OpenBabel. Anyways, it's totally written using the python bindings and if anyone would like to see the code just e-mail me. Basic conversion between all formats and a frontend to the PubChem database (which has 8 million compounds). Also, this app could be the first program to be in the Contributed Script Repository that Geoffrey has mentioned. |
From: richard a. <ric...@ya...> - 2006-10-28 02:06:32
|
Success! Geoff, I think this works now. I checked out OB-SVN. With a couple of minor modifications (for example, changing openbabel_ruby.cpp to openbabel_wrap.cpp, adding #include <math.h>) - I'll detail them shortly), I got the scripts/ruby wrapper compiled. Behold: $ irb irb(main):001:0> require 'openbabel_wrap' => true irb(main):002:0> m=Openbabel_wrap::OBMol.new => #<Openbabel_wrap::OBMol:0x2ba75b5563c8> irb(main):003:0> h=m.NewAtom => #<Openbabel_wrap::OBAtom:0x2ba75b552778> irb(main):004:0> h.SetAtomicNum(1) => nil irb(main):005:0> m.GetMolWt => 1.00794 It looks like all of the format interconversion utilities (smiles, mdl, etc) are missing, but we should be able to fix that. The important thing is now we've got a good place to start from. It must have been the older version of OB that I was using (2.0.2) that was the source of the problems. Could you verify that the above Ruby code works for you too? BTW, I'll respond in more detail to you're suggestions below shortly. cheers, Rich --- Geoffrey Hutchison <ge...@ge...> wrote: > > 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 > ____________________________________________________________________________________ We have the perfect Group for you. Check out the handy changes to Yahoo! Groups (http://groups.yahoo.com) |
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 |
From: Geoffrey H. <ge...@ge...> - 2006-10-27 21:03:45
|
I've gotten a few requests for more examples of Open Babel scripting access. Judging from the recent (valid) complaints that I managed to break the Python module in the Subversion trunk, do I have a few volunteers to contribute some snippets for a "repository" on the wiki? These examples would become part of the Python developer tutorial, and would include attribution and immortal fame. :-) Thanks! -Geoff |
From: Martin V. <mar...@bi...> - 2006-10-25 10:40:27
|
I suppose you should try the attached openbabel.i. which includes the headers 'residue.h', 'mol.h' and 'atom.h'. You need to rebuild openbabel_python.cpp of course. I suppose the bindings broke when the declarations of OBResidue, OBMol and OBAtom were moved out of 'mol.h' - Martin Pascoe, S (Stephen) wrote: > I can confirm that I get a similar error when trying to build the python > bindings with r1574 of the SVN source. I have set OPENBABEL_INSTALL > such that $OPENBABEL_INSTALL/include/openbabel-2.0 exists. I have even > tried recreating openbabel_python.cpp with the latest swig. This is the > truncated error: > ... -- Martin Vogt B-IT Life Science Informatics, <http://www.bit.uni-bonn.de> Dahlmannstrasse 2, D-53113 Bonn phone: +49 228 2699 310, <mailto:mar...@bi...> |
From: Pascoe, S \(Stephen\) <S.P...@rl...> - 2006-10-25 10:35:24
|
Thanks Martin that works a treat! Stephen. --- Stephen Pascoe 01235 445980 British Atmospheric Data Centre Rutherford Appleton Laboratory, CCLRC -----Original Message----- From: Martin Vogt [mailto:mar...@bi...]=20 Sent: 25 October 2006 11:34 To: Pascoe, S (Stephen) Cc: ope...@li... Subject: Re: [OpenBabel-scripting] Python Bindings I suppose you should try the attached openbabel.i. which includes the headers 'residue.h', 'mol.h' and 'atom.h'. You need to rebuild openbabel_python.cpp of course. I suppose the bindings broke when the declarations of OBResidue, OBMol and OBAtom were moved out of 'mol.h' - Martin Pascoe, S (Stephen) wrote: > I can confirm that I get a similar error when trying to build the=20 > python bindings with r1574 of the SVN source. I have set=20 > OPENBABEL_INSTALL such that $OPENBABEL_INSTALL/include/openbabel-2.0=20 > exists. I have even tried recreating openbabel_python.cpp with the=20 > latest swig. This is the truncated error: > ... -- Martin Vogt B-IT Life Science Informatics, <http://www.bit.uni-bonn.de> Dahlmannstrasse 2, D-53113 Bonn phone: +49 228 2699 310, <mailto:mar...@bi...> |
From: Noel O'B. <bao...@gm...> - 2006-10-25 09:26:35
|
As Geoff pointed out in a previous email, your LD_LIBRARY_PATH may be the key. What is its value? On 25/10/06, Pascoe, S (Stephen) <S.P...@rl...> wrote: > > > I can confirm that I get a similar error when trying to build the python > bindings with r1574 of the SVN source. I have set OPENBABEL_INSTALL such > that $OPENBABEL_INSTALL/include/openbabel-2.0 exists. I > have even tried recreating openbabel_python.cpp with the latest swig. This > is the truncated error: > > > python setup.py build 2>&1 | less > INFO: Using the value of $OPENBABEL_INSTALL > (/research/home/spascoe/host/saturn/ > opt/openbabel) > running build > running build_py > copying openbabel.py -> build/lib.linux-i686-2.4 > running build_ext > building '_openbabel' extension > gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -march=i586 -mtune=i686 > -fmessage > -length=0 -Wall -D_FORTIFY_SOURCE=2 -g -fPIC > -I/research/home/spascoe/host/satur > n/opt/openbabel/include/openbabel-2.0 > -I/research/home/spascoe/host/saturn/opt/o > penbabel/include/openbabel-2.0/openbabel -I/usr/include/python2.4 -c > openbabel_p > ython.cpp -o build/temp.linux-i686-2.4/openbabel_python.o > openbabel_python.cpp: In function 'PyObject* > _wrap_OBMol_CreateResidue(PyObject* > , PyObject*)': > openbabel_python.cpp:38606: error: 'OBResidue' was not declared in this > scope > openbabel_python.cpp:38606: error: 'result' was not declared in this scope > openbabel_python.cpp:38617: error: expected primary-expression before ')' > token > openbabel_python.cpp: In function 'PyObject* > _wrap_OBMol_DestroyResidue(PyObject > *, PyObject*)': > openbabel_python.cpp:38688: error: 'OBResidue' was not declared in this > scope > openbabel_python.cpp:38688: error: 'arg2' was not declared in this scope > openbabel_python.cpp:38688: error: expected primary-expression before ')' > token > openbabel_python.cpp:38688: error: expected `;' before numeric constant > openbabel_python.cpp:38706: error: expected type-specifier before > 'OBResidue' > openbabel_python.cpp:38706: error: expected `>' before 'OBResidue' > openbabel_python.cpp:38706: error: expected `(' before 'OBResidue' > openbabel_python.cpp:38706: error: expected primary-expression before '>' > token > openbabel_python.cpp:38706: error: expected `)' before ';' token > openbabel_python.cpp:38707: error: no matching function for call to > 'OpenBabel:: > OBMol::DestroyResidue(<type error>)' > ... > > A summary of my system: > > > uname -a; cat /etc/issue; gcc -v > Linux saturn 2.6.13-15.8-smp #1 SMP Tue Feb 7 11:07:24 UTC 2006 i686 i686 > i386 GNU/Linux > > Welcome to SUSE LINUX 10.0 (i586) - Kernel \r (\l). > > > Using built-in specs. > Target: i586-suse-linux > Configured with: ../configure --enable-threads=posix --prefix=/usr > --with-local-prefix=/usr/local --infodir=/usr/share/info > --mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib > --enable-languages=c,c++,objc,f95,java,ada > --disable-checking > --with-gxx-include-dir=/usr/include/c++/4.0.2 > --enable-java-awt=gtk --disable-libjava-multilib --with-slibdir=/lib > --with-system-zlib --enable-shared --enable-__cxa_atexit > --without-system-libunwind --host=i586-suse-linux > Thread model: posix > gcc version 4.0.2 20050901 (prerelease) (SUSE Linux) > > Stephen. > > --- > Stephen Pascoe > British Atmospheric Data Centre > Rutherford Appleton Laboratory, CCLRC > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > _______________________________________________ > OpenBabel-scripting mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > > > |
From: Pascoe, S \(Stephen\) <S.P...@rl...> - 2006-10-25 09:22:21
|
I can confirm that I get a similar error when trying to build the python bindings with r1574 of the SVN source. I have set OPENBABEL_INSTALL such that $OPENBABEL_INSTALL/include/openbabel-2.0 exists. I have even tried recreating openbabel_python.cpp with the latest swig. This is the truncated error: =20 > python setup.py build 2>&1 | less INFO: Using the value of $OPENBABEL_INSTALL (/research/home/spascoe/host/saturn/ opt/openbabel) running build running build_py copying openbabel.py -> build/lib.linux-i686-2.4 running build_ext building '_openbabel' extension gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -march=3Di586 = -mtune=3Di686 -fmessage -length=3D0 -Wall -D_FORTIFY_SOURCE=3D2 -g -fPIC -I/research/home/spascoe/host/satur n/opt/openbabel/include/openbabel-2.0 -I/research/home/spascoe/host/saturn/opt/o penbabel/include/openbabel-2.0/openbabel -I/usr/include/python2.4 -c openbabel_p ython.cpp -o build/temp.linux-i686-2.4/openbabel_python.o openbabel_python.cpp: In function 'PyObject* _wrap_OBMol_CreateResidue(PyObject* , PyObject*)': openbabel_python.cpp:38606: error: 'OBResidue' was not declared in this scope openbabel_python.cpp:38606: error: 'result' was not declared in this scope openbabel_python.cpp:38617: error: expected primary-expression before ')' token openbabel_python.cpp: In function 'PyObject* _wrap_OBMol_DestroyResidue(PyObject *, PyObject*)': openbabel_python.cpp:38688: error: 'OBResidue' was not declared in this scope openbabel_python.cpp:38688: error: 'arg2' was not declared in this scope openbabel_python.cpp:38688: error: expected primary-expression before ')' token openbabel_python.cpp:38688: error: expected `;' before numeric constant openbabel_python.cpp:38706: error: expected type-specifier before 'OBResidue' openbabel_python.cpp:38706: error: expected `>' before 'OBResidue' openbabel_python.cpp:38706: error: expected `(' before 'OBResidue' openbabel_python.cpp:38706: error: expected primary-expression before '>' token openbabel_python.cpp:38706: error: expected `)' before ';' token openbabel_python.cpp:38707: error: no matching function for call to 'OpenBabel:: OBMol::DestroyResidue(<type error>)' ... =20 A summary of my system: =20 > uname -a; cat /etc/issue; gcc -v Linux saturn 2.6.13-15.8-smp #1 SMP Tue Feb 7 11:07:24 UTC 2006 i686 i686 i386 GNU/Linux =20 Welcome to SUSE LINUX 10.0 (i586) - Kernel \r (\l). =20 Using built-in specs. Target: i586-suse-linux Configured with: ../configure --enable-threads=3Dposix --prefix=3D/usr --with-local-prefix=3D/usr/local --infodir=3D/usr/share/info --mandir=3D/usr/share/man --libdir=3D/usr/lib --libexecdir=3D/usr/lib --enable-languages=3Dc,c++,objc,f95,java,ada --disable-checking --with-gxx-include-dir=3D/usr/include/c++/4.0.2 --enable-java-awt=3Dgtk --disable-libjava-multilib --with-slibdir=3D/lib --with-system-zlib --enable-shared --enable-__cxa_atexit --without-system-libunwind --host=3Di586-suse-linux Thread model: posix gcc version 4.0.2 20050901 (prerelease) (SUSE Linux) Stephen. =20 --- Stephen Pascoe=20 British Atmospheric Data Centre Rutherford Appleton Laboratory, CCLRC =20 |
From: Geoffrey H. <ge...@ge...> - 2006-10-23 01:10:24
|
On Oct 22, 2006, at 8:21 PM, Sam Aarons wrote: > I finally got everything in the bindings to work > correctly, but when i'm running my python application > (which uses openbabel bindings) i get this error > message. ... > ImportError: libopenbabel.so.1: cannot open shared > object file: No such file or directory By default, Open Babel compiles and installs into /usr/local (i.e., / usr/local/libopenbabel.so) Depending on your machine, this may not be in a normal library search path. If you're running Linux (looks like it), you'll need to edit / etc/ld.so.conf or the LD_LIBRARY_PATH: http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html Cheers, -Geoff |
From: Sam A. <ter...@ya...> - 2006-10-23 00:21:16
|
I finally got everything in the bindings to work correctly, but when i'm running my python application (which uses openbabel bindings) i get this error message. dlopen("/usr/lib/python2.4/site-packages/_openbabel.so", 2); Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: libopenbabel.so.1: cannot open shared object file: No such file or directory Can anyone help me on this? |
From: Sam A. <ter...@ya...> - 2006-10-22 05:20:37
|
I have the latest version of Openbabel (SVN) installed. Then i proceeded to install the Python bindings and everything went berzerk. WARNING: Environment variable OPENBABEL_INSTALL is not set INFO: Looking for library and include files in ../../src running build running build_py creating build creating build/lib.linux-i686-2.4 copying openbabel.py -> build/lib.linux-i686-2.4 copying pyopenbabel.py -> build/lib.linux-i686-2.4 running build_ext building '_openbabel' extension creating build/temp.linux-i686-2.4 gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I../../src -I/usr/include/python2.4 -c openbabel_python.cpp -o build/temp.linux-i686-2.4/openbabel_python.o cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++ openbabel_python.cpp: In function PyObject* _wrap_OBMol_CreateResidue(PyObject*, PyObject*): openbabel_python.cpp:38606: error: OBResidue was not declared in this scope openbabel_python.cpp:38606: error: result was not declared in this scope openbabel_python.cpp:38617: error: expected primary-expression before ) token openbabel_python.cpp: In function PyObject* _wrap_OBMol_DestroyResidue(PyObject*, PyObject*): openbabel_python.cpp:38688: error: OBResidue was not declared in this scope openbabel_python.cpp:38688: error: arg2 was not declared in this scope openbabel_python.cpp:38688: error: expected primary-expression before ) token openbabel_python.cpp:38688: error: expected `;' before numeric constant openbabel_python.cpp:38706: error: expected type-specifier before OBResidue openbabel_python.cpp:38706: error: expected `>' before OBResidue openbabel_python.cpp:38706: error: expected `(' before OBResidue openbabel_python.cpp:38706: error: expected primary-expression before > token openbabel_python.cpp:38706: error: expected `)' before ; token openbabel_python.cpp: In function PyObject* _wrap_OBMol_AddResidue(PyObject*, PyObject*): openbabel_python.cpp:39090: error: OBResidue was not declared in this scope openbabel_python.cpp:39090: error: arg2 was not declared in this scope openbabel_python.cpp:39112: error: expected type-specifier before OBResidue openbabel_python.cpp:39112: error: expected `>' before OBResidue openbabel_python.cpp:39112: error: expected `(' before OBResidue openbabel_python.cpp:39112: error: expected primary-expression before > token openbabel_python.cpp:39112: error: expected `)' before ; token openbabel_python.cpp: In function PyObject* _wrap_OBMol_DeleteResidue(PyObject*, PyObject*): openbabel_python.cpp:39220: error: OBResidue was not declared in this scope openbabel_python.cpp:39220: error: arg2 was not declared in this scope openbabel_python.cpp:39220: error: expected primary-expression before ) token openbabel_python.cpp:39220: error: expected `;' before numeric constant openbabel_python.cpp:39239: error: expected type-specifier before OBResidue openbabel_python.cpp:39239: error: expected `>' before OBResidue openbabel_python.cpp:39239: error: expected `(' before OBResidue openbabel_python.cpp:39239: error: expected primary-expression before > token openbabel_python.cpp:39239: error: expected `)' before ; token openbabel_python.cpp: In function PyObject* _wrap_OBMol_NewResidue(PyObject*, PyObject*): openbabel_python.cpp:39273: error: OBResidue was not declared in this scope openbabel_python.cpp:39273: error: result was not declared in this scope openbabel_python.cpp:39284: error: expected primary-expression before ) token openbabel_python.cpp: In function PyObject* _wrap_OBMol_GetResidue(PyObject*, PyObject*): openbabel_python.cpp:39863: error: OBResidue was not declared in this scope openbabel_python.cpp:39863: error: result was not declared in this scope openbabel_python.cpp:39882: error: expected primary-expression before ) token openbabel_python.cpp: In function PyObject* _wrap_OBMol_BeginResidue(PyObject*, PyObject*): openbabel_python.cpp:43939: error: OBResidue was not declared in this scope openbabel_python.cpp:43939: error: OBResidue cannot appear in a constant-expression openbabel_python.cpp:43939: error: template argument 1 is invalid openbabel_python.cpp:43939: error: template argument 1 is invalid openbabel_python.cpp:43939: error: template argument 2 is invalid openbabel_python.cpp:43939: error: expected initializer before * token openbabel_python.cpp:43940: error: result was not declared in this scope openbabel_python.cpp:43961: error: arg2 was not declared in this scope openbabel_python.cpp:43961: error: OBResidue cannot appear in a constant-expression openbabel_python.cpp:43961: error: OBResidue cannot appear in a constant-expression openbabel_python.cpp:43961: error: template argument 1 is invalid openbabel_python.cpp:43961: error: template argument 1 is invalid openbabel_python.cpp:43961: error: template argument 2 is invalid openbabel_python.cpp:43961: error: expected `>' before :: token openbabel_python.cpp:43961: error: expected `(' before :: token openbabel_python.cpp:43961: error: ::iterator has not been declared openbabel_python.cpp:43961: error: expected primary-expression before > token openbabel_python.cpp:43961: error: expected `)' before ; token openbabel_python.cpp:43962: error: expected primary-expression before ) token openbabel_python.cpp: In function PyObject* _wrap_OBMol_NextResidue(PyObject*, PyObject*): openbabel_python.cpp:43973: error: OBResidue was not declared in this scope openbabel_python.cpp:43973: error: OBResidue cannot appear in a constant-expression openbabel_python.cpp:43973: error: template argument 1 is invalid openbabel_python.cpp:43973: error: template argument 1 is invalid openbabel_python.cpp:43973: error: template argument 2 is invalid openbabel_python.cpp:43973: error: expected initializer before * token openbabel_python.cpp:43974: error: result was not declared in this scope openbabel_python.cpp:43995: error: arg2 was not declared in this scope openbabel_python.cpp:43995: error: OBResidue cannot appear in a constant-expression openbabel_python.cpp:43995: error: OBResidue cannot appear in a constant-expression openbabel_python.cpp:43995: error: template argument 1 is invalid openbabel_python.cpp:43995: error: template argument 1 is invalid openbabel_python.cpp:43995: error: template argument 2 is invalid openbabel_python.cpp:43995: error: expected `>' before :: token openbabel_python.cpp:43995: error: expected `(' before :: token openbabel_python.cpp:43995: error: ::iterator has not been declared openbabel_python.cpp:43995: error: expected primary-expression before > token openbabel_python.cpp:43995: error: expected `)' before ; token openbabel_python.cpp:43996: error: expected primary-expression before ) token ../../src/residue.h: At global scope: ../../src/residue.h:305: warning: OpenBabel::Residue defined but not used ../../src/residue.h:348: warning: OpenBabel::ElemDesc defined but not used ../../src/residue.h:380: warning: OpenBabel::ResNo defined but not used ../../src/residue.h:381: warning: OpenBabel::ElemNo defined but not used error: command 'gcc' failed with exit status 1 Please tell me how to fix this. |
From: richard a. <ric...@ya...> - 2006-10-18 02:04:01
|
Looks like my message got cut off. Here's the rest of it: type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_vectorBond_emptyq___(int, VALUE*, VALUE): openbabel_wrap.cxx:4945: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:4949: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_new_vectorResidue__SWIG_3(int, VALUE*, VALUE): openbabel_wrap.cxx:5263: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:5267: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_new_vectorResidue(int, VALUE*, VALUE): openbabel_wrap.cxx:5314: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:5323: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_vectorResidue___len__(int, VALUE*, VALUE): openbabel_wrap.cxx:5373: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:5377: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_vectorResidue_emptyq___(int, VALUE*, VALUE): openbabel_wrap.cxx:5405: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:5409: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_new_vectorRing__SWIG_3(int, VALUE*, VALUE): openbabel_wrap.cxx:5723: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:5727: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_new_vectorRing(int, VALUE*, VALUE): openbabel_wrap.cxx:5774: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:5783: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_vectorRing___len__(int, VALUE*, VALUE): openbabel_wrap.cxx:5833: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:5837: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_vectorRing_emptyq___(int, VALUE*, VALUE): openbabel_wrap.cxx:5865: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:5869: warning: dereferencing type-punned pointer will break strict-aliasing rules gcc -shared -L"/usr/lib64" -o openbabel_wrap.so openbabel_wrap.o -lruby -lopenbabel -lpthread -ldl -lcrypt -lm -lc The following files are created: openbabel_wrap.o openbabel_wrap.so (12) irb (13) require 'openbabel_wrap' produces: irb(main):001:0> require 'openbabel_wrap' (eval): [BUG] Segmentation fault ruby 1.8.5 (2006-08-25) [x86_64-linux-gnu] Aborted As I mentioned before, if I remove the OBAtom, OBBond, and OBMol definitions from Init_openbabel_wrap (last function), the Ruby module is loaded without segfaulting. I can also remove everything from the respective stanzas except the first line and still I get a segfault, so I'm guessing this is where the error happens. Would someone be willing to go through this series of steps to verify that the problem is not related to my system's configuration (my version of Ruby, my platform, my compiler, etc.) cheers, Rich __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: richard a. <ric...@ya...> - 2006-10-14 20:47:56
|
I upgraded to SWIG 1.3.29, as Geoff suggested. After compiling the swig wrapper, I still get a segfault on loading the Ruby module. Before submitting a bug report to SWIG, I wanted to make sure I was doing this correctly. So here is my process in detail. I'm using Open Babel 2.0.2, Ruby 1.8.5, and Mandriva Linux 2007 amd64. (1) ./configure, make, and (as root) make install OB (2) cd into OPENBABEL/scripts (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) (4) generate the SWIG wrapper: swig -ruby -c++ -I../src openbabel.i This generates lots of warnings that don't appear when the argument is -python instead of -ruby (maybe this is the problem): ../src/math/vector3.h:114: Warning(389): operator[] ignored (consider using %extend) ../src/math/vector3.h:123: Warning(362): operator= ignored ../src/math/vector3.h:130: Warning(378): operator!= ignored ../src/math/vector3.h:180: Warning(365): operator+= ignored ../src/math/vector3.h:187: Warning(366): operator-= ignored ../src/math/vector3.h:194: Warning(365): operator+= ignored ../src/math/vector3.h:201: Warning(366): operator-= ignored ../src/math/vector3.h:208: Warning(367): operator*= ignored ../src/math/vector3.h:215: Warning(368): operator/= ignored ../src/math/vector3.h:217: Warning(367): operator*= ignored ../src/bitvec.h:121: Warning(362): operator= ignored ../src/bitvec.h:122: Warning(371): operator&= ignored ../src/bitvec.h:123: Warning(372): operator|= ignored ../src/bitvec.h:128: Warning(372): operator|= ignored ../src/bitvec.h:129: Warning(370): operator^= ignored ../src/bitvec.h:130: Warning(366): operator-= ignored ../src/bitvec.h:131: Warning(365): operator+= ignored ../src/bitvec.h:136: Warning(389): operator[] ignored (consider using %extend) ../src/generic.h:152: Warning(362): operator= ignored ../src/generic.h:170: Warning(362): operator= ignored ../src/generic.h:279: Warning(362): operator= ignored ../src/generic.h:310: Warning(362): operator= ignored ../src/generic.h:364: Warning(362): operator= ignored ../src/generic.h:399: Warning(362): operator= ignored ../src/generic.h:437: Warning(362): operator= ignored ../src/generic.h:483: Warning(362): operator= ignored ../src/generic.h:531: Warning(362): operator= ignored ../src/generic.h:567: Warning(362): operator= ignored ../src/generic.h:598: Warning(362): operator= ignored ../src/mol.h:87: Warning(362): operator= ignored ../src/mol.h:233: Warning(362): operator= ignored ../src/mol.h:785: Warning(362): operator= ignored ../src/mol.h:786: Warning(365): operator+= ignored ../src/ring.h:62: Warning(362): operator= ignored ../src/parsmart.h:207: Warning(362): operator= ignored ../src/oberror.h:162: Warning(401): Nothing known about base class 'std::stringbuf'. Ignored. ../src/obconversion.h:175: Warning(401): Nothing known about base class 'std::binary_function<char const *,char const *,bool >'. Ignored. ../src/obconversion.h:175: Warning(401): Maybe you forgot to instantiate 'std::binary_function<char const *,char const *,bool >' using %template. openbabel.i:33: Warning(801): Wrong class name (corrected to `VectorInt') openbabel.i:33: Warning(801): Wrong class name (corrected to `VectorInt') openbabel.i:34: Warning(801): Wrong class name (corrected to `VvInt') openbabel.i:34: Warning(801): Wrong class name (corrected to `VvInt') openbabel.i:35: Warning(801): Wrong class name (corrected to `VectorDouble') openbabel.i:35: Warning(801): Wrong class name (corrected to `VectorDouble') openbabel.i:36: Warning(801): Wrong class name (corrected to `VVector3') openbabel.i:36: Warning(801): Wrong class name (corrected to `VVector3') openbabel.i:38: Warning(801): Wrong class name (corrected to `VectorMol') openbabel.i:38: Warning(801): Wrong class name (corrected to `VectorMol') openbabel.i:39: Warning(801): Wrong class name (corrected to `VectorBond') openbabel.i:39: Warning(801): Wrong class name (corrected to `VectorBond') openbabel.i:40: Warning(801): Wrong class name (corrected to `VectorResidue') openbabel.i:40: Warning(801): Wrong class name (corrected to `VectorResidue') openbabel.i:41: Warning(801): Wrong class name (corrected to `VectorRing') openbabel.i:41: Warning(801): Wrong class name (corrected to `VectorRing') ../src/math/vector3.h:57: Warning(801): Wrong class name (corrected to `Vector3') ../src/math/vector3.h:57: Warning(801): Wrong class name (corrected to `Vector3') ../src/math/vector3.h:126: Warning(503): Can't wrap 'operator <<' unless renamed to a valid identifier. ../src/math/vector3.h:129: Warning(503): Can't wrap 'operator ==' unless renamed to a valid identifier. ../src/math/vector3.h:137: Warning(503): Can't wrap 'operator +' unless renamed to a valid identifier. ../src/math/vector3.h:142: Warning(503): Can't wrap 'operator -' unless renamed to a valid identifier. ../src/math/vector3.h:147: Warning(503): Can't wrap 'operator -' unless renamed to a valid identifier. ../src/math/vector3.h:152: Warning(503): Can't wrap 'operator *' unless renamed to a valid identifier. ../src/math/vector3.h:157: Warning(503): Can't wrap 'operator *' unless renamed to a valid identifier. ../src/math/vector3.h:162: Warning(503): Can't wrap 'operator /' unless renamed to a valid identifier. ../src/math/vector3.h:171: Warning(503): Can't wrap 'operator *' unless renamed to a valid identifier. ../src/math/vector3.h:225: Warning(503): Can't wrap 'OpenBabel::dot' unless renamed to a valid identifier. ../src/math/vector3.h:228: Warning(503): Can't wrap 'OpenBabel::cross' unless renamed to a valid identifier. ../src/math/vector3.h:231: Warning(503): Can't wrap 'OpenBabel::vectorAngle' unless renamed to a valid identifier. ../src/math/vector3.h:235: Warning(503): Can't wrap 'OpenBabel::CalcTorsionAngle' unless renamed to a valid identifier. ../src/oberror.h:162: Warning(801): Wrong class name (corrected to `ObLogBuf') (5) create a new directory called "ruby" (6) move openbabel_wrap.cxx, generated from SWIG, into the ruby directory (7) cd into ruby directory (8) save the following as "extconf.rb": require 'mkmf' dir_config('openbabel') dir_config('openbabel-2.0') have_library('openbabel') create_makefile('openbabel_wrap') (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' this produces: checking for main() in -lopenbabel... yes creating Makefile and creates "Makefile" (10) add the following to line 10 of openbabel_wrap.cxx: #include <math.h> (11) make. This generates the following messages: g++ -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux-gnu -I. -I/usr/local/include/openbabel-2.0 -I/usr/local/include/openbabel-2.0/openbabel -fPIC -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -Wall -fPIC -c openbabel_wrap.cxx In file included from /usr/local/include/openbabel-2.0/openbabel/obutil.h:23, from openbabel_wrap.cxx:1648: /usr/local/include/openbabel-2.0/openbabel/babelconfig.h:18:1: warning: "EXTERN" redefined In file included from /usr/lib/ruby/1.8/x86_64-linux-gnu/ruby.h:28, from openbabel_wrap.cxx:809: /usr/lib/ruby/1.8/x86_64-linux-gnu/defines.h:203:1: warning: this is the location of the previous definition openbabel_wrap.cxx: In function int SWIG_AsPtr_std_string(VALUE, std::string**): openbabel_wrap.cxx:2186: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_new_vectorInt__SWIG_3(int, VALUE*, VALUE): openbabel_wrap.cxx:2455: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_new_vectorInt(int, VALUE*, VALUE): openbabel_wrap.cxx:2509: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_vectorInt___len__(int, VALUE*, VALUE): openbabel_wrap.cxx:2568: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_vectorInt_emptyq___(int, VALUE*, VALUE): openbabel_wrap.cxx:2604: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_new_vvInt__SWIG_2(int, VALUE*, VALUE): openbabel_wrap.cxx:2874: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_new_vvInt__SWIG_3(int, VALUE*, VALUE): openbabel_wrap.cxx:2918: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:2922: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_new_vvInt(int, VALUE*, VALUE): openbabel_wrap.cxx:2969: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:2978: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:3014: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_vvInt___len__(int, VALUE*, VALUE): openbabel_wrap.cxx:3050: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:3054: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_vvInt_emptyq___(int, VALUE*, VALUE): openbabel_wrap.cxx:3082: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:3086: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_vvInt_push(int, VALUE*, VALUE): openbabel_wrap.cxx:3149: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_vvInt___setitem__(int, VALUE*, VALUE): openbabel_wrap.cxx:3273: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_new_vectorDouble__SWIG_3(int, VALUE*, VALUE): openbabel_wrap.cxx:3429: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_new_vectorDouble(int, VALUE*, VALUE): openbabel_wrap.cxx:3483: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_vectorDouble___len__(int, VALUE*, VALUE): openbabel_wrap.cxx:3542: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_vectorDouble_emptyq___(int, VALUE*, VALUE): openbabel_wrap.cxx:3578: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_new_vVector3__SWIG_3(int, VALUE*, VALUE): openbabel_wrap.cxx:3883: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:3887: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_new_vVector3(int, VALUE*, VALUE): openbabel_wrap.cxx:3934: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:3943: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_vVector3___len__(int, VALUE*, VALUE): openbabel_wrap.cxx:3993: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:3997: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_vVector3_emptyq___(int, VALUE*, VALUE): openbabel_wrap.cxx:4025: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:4029: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_new_vectorMol__SWIG_3(int, VALUE*, VALUE): openbabel_wrap.cxx:4343: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:4347: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_new_vectorMol(int, VALUE*, VALUE): openbabel_wrap.cxx:4394: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:4403: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_vectorMol___len__(int, VALUE*, VALUE): openbabel_wrap.cxx:4453: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:4457: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_vectorMol_emptyq___(int, VALUE*, VALUE): openbabel_wrap.cxx:4485: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:4489: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_new_vectorBond__SWIG_3(int, VALUE*, VALUE): openbabel_wrap.cxx:4803: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:4807: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_new_vectorBond(int, VALUE*, VALUE): openbabel_wrap.cxx:4854: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:4863: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_vectorBond___len__(int, VALUE*, VALUE): openbabel_wrap.cxx:4913: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:4917: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_vectorBond_emptyq___(int, VALUE*, VALUE): openbabel_wrap.cxx:4945: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:4949: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_new_vectorResidue__SWIG_3(int, VALUE*, VALUE): openbabel_wrap.cxx:5263: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:5267: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_new_vectorResidue(int, VALUE*, VALUE): openbabel_wrap.cxx:5314: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:5323: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_vectorResidue___len__(int, VALUE*, VALUE): openbabel_wrap.cxx:5373: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:5377: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_vectorResidue_emptyq___(int, VALUE*, VALUE): openbabel_wrap.cxx:5405: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:5409: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_new_vectorRing__SWIG_3(int, VALUE*, VALUE): openbabel_wrap.cxx:5723: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:5727: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_new_vectorRing(int, VALUE*, VALUE): openbabel_wrap.cxx:5774: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:5783: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_vectorRing___len__(int, VALUE*, VALUE): openbabel_wrap.cxx:5833: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:5837: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx: In function VALUE _wrap_vectorRing_emptyq___(int, VALUE*, VALUE): openbabel_wrap.cxx:5865: warning: dereferencing type-punned pointer will break strict-aliasing rules openbabel_wrap.cxx:5869: warning: dereferencing type-punned pointer will break strict-aliasing rules gcc -shared -L"/usr/lib64" -o openbabel_wrap.so openbabel_wrap.o -lruby -lopenbabel -lpthread -ldl -lcrypt -lm -lc The following files are created: openbabel_wrap.o openbabel_wrap.so (12) irb (13) require 'openbabel_wrap' produces: irb(main):001:0> require 'openbabel_wrap' (eval): [BUG] Segmentation fault ruby 1.8.5 (2006-08-25) [x86_64-linux-gnu] Aborted As I mentioned before, if I remove the OBAtom, OBBond, and OBMol definitions from Init_openbabel_wrap (last function), the Ruby module is loaded without segfaulting. I can also remove everything from the respective stanzas except the first line and still I get a segfault, so I'm guessing this is where the error happens. Would someone be willing to go through this series of steps to verify that the problem is not related to my system's configuration (my version of Ruby, my platform, my compiler, etc.) cheers, Rich __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: richard a. <ric...@ya...> - 2006-10-11 15:07:04
|
--- Geoffrey Hutchison <ge...@ge...> wrote: > > On Oct 10, 2006, at 2:16 AM, richard apodaca wrote: > > > I'm trying to get Ruby scripting to work with Open > > Babel-2.0.2 and SWIG on Linux. > > What version of SWIG are you using? I'm glad to see > the progress > you've made, but certainly previous versions of the > Perl and Python > wrappers uncovered various bugs with SWIG itself. 1.3.27 on Mandriva Linux 2007. Looks like there is also a 1.3.29 on SF. > > With a little tweaking (I needed to add #include > > <math.h> at the top of the .cxx file), I was able > to > > compile openbabel_wrap.cxx against my installed > > OB-2.0.2 library using make. > > Good to know. It should be possible to inject this > into the SWIG output. > > > In the case of OBAtom, the offending code is at > the > > very start of the class stanza: > > > > cOBAtom.klass = rb_define_class_under(mRob, > "OBAtom", > > ((swig_class *) > > > SWIGTYPE_p_OpenBabel__OBNodeBase->clientdata)->klass); > > Since the Ruby support in SWIG is relatively new and > continually > improving, I'd suggest grabbing the latest SWIG from > CVS and giving > that a spin first: > http://www.swig.org/cvs.html I'll give that a shot. > If that doesn't work, let's submit this as a SWIG > bug and see what > happens. It's often hard for me to follow the SWIG > auto-generated code. You and me both. > As far as getting autoconf building working, I'll > see if I can't get > that working soon. It turns out that I was missing > some packages. > > Cheers, > -Geoff > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Geoffrey H. <ge...@ge...> - 2006-10-11 14:51:45
|
On Oct 10, 2006, at 2:16 AM, richard apodaca wrote: > I'm trying to get Ruby scripting to work with Open > Babel-2.0.2 and SWIG on Linux. What version of SWIG are you using? I'm glad to see the progress you've made, but certainly previous versions of the Perl and Python wrappers uncovered various bugs with SWIG itself. > With a little tweaking (I needed to add #include > <math.h> at the top of the .cxx file), I was able to > compile openbabel_wrap.cxx against my installed > OB-2.0.2 library using make. Good to know. It should be possible to inject this into the SWIG output. > In the case of OBAtom, the offending code is at the > very start of the class stanza: > > cOBAtom.klass = rb_define_class_under(mRob, "OBAtom", > ((swig_class *) > SWIGTYPE_p_OpenBabel__OBNodeBase->clientdata)->klass); Since the Ruby support in SWIG is relatively new and continually improving, I'd suggest grabbing the latest SWIG from CVS and giving that a spin first: http://www.swig.org/cvs.html If that doesn't work, let's submit this as a SWIG bug and see what happens. It's often hard for me to follow the SWIG auto-generated code. As far as getting autoconf building working, I'll see if I can't get that working soon. It turns out that I was missing some packages. Cheers, -Geoff |
From: Noel O'B. <bao...@gm...> - 2006-10-11 09:21:36
|
Unfortunately, I don't really know what's going on. However, it may help others if you can show the very *first* error messages you get when you run "python setup.py build", because these are likely to be the main problem. All of the other errors happen because of the main problem. Please check on the web for how to pipe standard output *and* standard error to the same file for your shell. In "bash", you use ">& mybuild.out" Noel On 06/10/06, Ahmet Bakan <ah...@pi...> wrote: > > I thought my reply was to all, excuse me. > Babel itself is working. I installed it as the root. I have attached > output for "python setup.py build". I could not catch all of the output > in a file. I have copied last part of the errors and inserted them to the > end. The part I couldn't catch is similar to the part in the file. > Thanks a lot! > Regards, > Ahmet > > On 10/6/06, Noel O'Boyle <bao...@gm...> wrote: > > > > First of all, please send all email to the mailing list. You can 'cc' it > > to me if you wish, but there are others on the mailing list who will be able > > to help you more than I can. I have attached the .out files you have sent me > > to this email. > > > > Well, there's nothing obviously wrong to me. I note that you are using a > > 64-bit system, though. There's a couple more questions which might help us > > to help you... > > > > Does Babel itself work? That is, does the output of "babel -H" list all > > of the different file formats? > > > > Did you install Open Babel globally as root? That is, did you run "make > > install" as root as described on: > > http://openbabel.sourceforge.net/wiki/Install > > > > Could you also attach the complete output (errors and all) from "python > > setup.py build"? (You can catch it using "python setup.py build |& > > pythonbuild.out") > > > > Regards, > > Noel > > > > On 06/10/06, Ahmet Bakan <ah...@pi...> wrote: > > > > > > I am building the latest version 2.0.2. > > > I have attached configure and make output files. > > > Thank you very much for your attention. > > > Regards, > > > Ahmet > > > > > > On 10/6/06, Noel O'Boyle <bao...@gm...> wrote: > > > > > > > > What version of OpenBabel are you building? > > > > > > > > Can you send configure.out and make.out to this mailing list? The > > > > problem may be with the OpenBabel compilation, rather than the Python > > > > wrapper. > > > > > > > > (See the instructions at > > > > http://openbabel.sourceforge.net/wiki/Install on how to create > > > > configure.out and make.out .) > > > > > > > > Regards, > > > > Noel > > > > > > > > On 06/10/06, Ahmet Bakan <ah...@pi...> wrote: > > > > > > > > > Hi All, > > > > > > > > > > I have followed the instructions to install Python wrapper for > > > > > OpenBabel on Linux. I have had an error or a warning on every line as I was > > > > > running the provided setup.py code. > > > > > Also after the build and install finished I could not import > > > > > openbabel module due "ImportError: No module named dl". > > > > > The errors on build and installation is as follows: > > > > > openbabel_python.cpp:46242: error: `OpenBabel' has not been > > > > > declared > > > > > openbabel_python.cpp:46242: error: `OUTOPTIONS' was not declared > > > > > in this scope > > > > > > > > > > If you can figure out that I am missing something, can you please > > > > > let me know? > > > > > I use > > > > > Python 2.4.3 > > > > > [GCC 3.4.5 20051201 (Red Hat 3.4.5-2)] on linux2 > > > > > > > > > > Thanks in advance. > > > > > Ahmet > > > > > > > > > > -- > > > > > Ahmet Bakan > > > > > Department of Computational Biology > > > > > University of Pittsburgh School of Medicine > > > > > 3501 Fifth Avenue > > > > > Suite 3064 BST3 > > > > > Pittsburgh, PA 15213-3301 > > > > > > > > > > ------------------------------------------------------------------------- > > > > > Take Surveys. Earn Cash. Influence the Future of IT > > > > > Join SourceForge.net's Techsay panel and you'll get the chance to > > > > > share your > > > > > opinions on IT & business topics through brief surveys -- and earn > > > > > cash > > > > > > > > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > > > > > > > > _______________________________________________ > > > > > OpenBabel-scripting mailing list > > > > > Ope...@li... > > > > > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > Ahmet Bakan > > > Department of Computational Biology > > > University of Pittsburgh School of Medicine > > > 3501 Fifth Avenue > > > Suite 3064 BST3 > > > Pittsburgh, PA 15213-3301 > > > > > > > > > > > > > -- > Ahmet Bakan > Department of Computational Biology > University of Pittsburgh School of Medicine > 3501 Fifth Avenue > Suite 3064 BST3 > Pittsburgh, PA 15213-3301 > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > _______________________________________________ > OpenBabel-scripting mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > > > > |
From: richard a. <ric...@ya...> - 2006-10-10 06:16:49
|
I'm trying to get Ruby scripting to work with Open Babel-2.0.2 and SWIG on Linux. So far I've been able to generate the openbabel_wrap.cxx file with SWIG from OB's openbabel.i file and the OB sources. The bottom of this file contains all of the Ruby module, class, and method definitions, as expected. I created an apparently correct extconf.rb file, which I then used to create a makefile. With a little tweaking (I needed to add #include <math.h> at the top of the .cxx file), I was able to compile openbabel_wrap.cxx against my installed OB-2.0.2 library using make. So far so good. With irb, however, loading the module segfaults: BUG] Segmentation fault ruby 1.8.5 (2006-08-25) [x86_64-linux-gnu] Aborted Not really that helpful. I was able to trace the problem to only three class definitions in obenbabel_wrap.cxx: OBAtom OBBond OBMol If I remove these three definitions, I can compile the module, load it through Ruby, and manipulate OB objects. In the case of OBAtom, the offending code is at the very start of the class stanza: cOBAtom.klass = rb_define_class_under(mRob, "OBAtom", ((swig_class *) SWIGTYPE_p_OpenBabel__OBNodeBase->clientdata)->klass); I suspect the same is true for OBBond and OBMol, but haven't checked. I initially thought that maybe this problem was linked to OBAtom inheriting from another OB object. But so does OBElementTable, for example, and that definition doesn't cause a segfault. Any ideas? I'm not very experienced with Ruby extensions, C, C++, or make, so any information would be helpful. cheers, Rich __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Noel O'B. <bao...@gm...> - 2006-10-06 08:16:13
|
What version of OpenBabel are you building? Can you send configure.out and make.out to this mailing list? The problem may be with the OpenBabel compilation, rather than the Python wrapper. (See the instructions at http://openbabel.sourceforge.net/wiki/Install on how to create configure.out and make.out.) Regards, Noel On 06/10/06, Ahmet Bakan <ah...@pi...> wrote: > > Hi All, > > I have followed the instructions to install Python wrapper for OpenBabel > on Linux. I have had an error or a warning on every line as I was running > the provided setup.py code. > Also after the build and install finished I could not import openbabel > module due "ImportError: No module named dl". > The errors on build and installation is as follows: > openbabel_python.cpp:46242: error: `OpenBabel' has not been declared > openbabel_python.cpp:46242: error: `OUTOPTIONS' was not declared in this > scope > > If you can figure out that I am missing something, can you please let me > know? > I use > Python 2.4.3 > [GCC 3.4.5 20051201 (Red Hat 3.4.5-2)] on linux2 > > Thanks in advance. > Ahmet > > -- > Ahmet Bakan > Department of Computational Biology > University of Pittsburgh School of Medicine > 3501 Fifth Avenue > Suite 3064 BST3 > Pittsburgh, PA 15213-3301 > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > _______________________________________________ > OpenBabel-scripting mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > > > |