After some more testing I have found that it actually does work if I
compile without the plugin library but load it with dyn.load. I'm not
sure why this wasn't working before. It only works though if the plugin
library is loaded before libobtest2.so (the open babel main lib basically).
So,
To get things to work in Python, I have to set some dlopen flags as follows:
sys.setdlopenflags(sys.getdlopenflags() | dl.RTLD_GLOBAL)
The following discussion hints at something similar for R:
http://www.mail-archive.com/r-help@r-project.org/msg143108.html.
- Noel
On 25 March 2013 20:30, Kevin
Thanks, but swig did not help.
After some more experimentation, I have discovered I can get it to work
in the following way, but I think it is a bit impractical. If I compile
the shared library as:
g++ -shared -o libobtest2.so obtest2.o -fpic
/usr/lib/openbabel/2.2.3/mdlformat.so -lopenba
This isn't exactly answering your question, but have you considered
creating the R Swig wrapper. This may just simply work out of the box
(or indeed not!) with little effort.
- Noel
On 20 March 2013 16:13, Kevin Horan wrote:
> I would like to make use of open babel from within the R languag
I would like to make use of open babel from within the R language.
Initially I just need to do some format conversions, but may expand the
usage to other parts of OpenBabel as well. I am familiar with embedding
C/C++ code in R, but I'm having some trouble with the plugin mechanism
of OpenB