I'm all out. Have you looked at the output of ldd on the various library files? This shows which libraries will be dynamically loaded, or whether they cannot be found.
- Noel On 4 April 2013 16:20, Craig James <cja...@emolecules.com> wrote: > Hi Noel, > > > On Thu, Apr 4, 2013 at 6:08 AM, Noel O'Boyle <baoille...@gmail.com> wrote: >> >> Long shot: Are there any files in your current directory with the same >> names as files in Open Babel's data directory? This is a nice way to >> confuse Open Babel. Have you altered any files in Open Babel's data >> directory? > > > No, nothing like that, no .txt files at all. One thing unusual: I have two > versions of OpenBabel installed: > > /usr/local/openbabel-2.2.1 > /usr/local/openbabel-2.3.2 > /usr/local/openbabel --> /usr/local/openbabel-2.3.2 (symlink) > > When I set BABEL_LIBDIR and BABEL_DATADIR to bogus values (e.g. to /tmp), > obabel fails as expected; when I set them to the correct directories, obabel > works again, so I'm pretty sure they're right. > >> >> >> Just a note: with Open Babel we moved away from using Makefile.PL as >> it just wasn't capable enough. CMake is setting various properties on >> the library files it creates, but these aren't passed through to the >> perl module library unless you get CMake to build that also (which we >> now do). > > > Well, that's good information. I suspect the problem is that the particular > g++ command that puts the .so together is missing something, resulting in > the C++ class-initialization code not being invoked when Perl starts > running. I'll dig into that a bit more. > >> >> Useless anecdotal evidence for different system: It works for me with >> Python on Linux for a C++ project that links to Open Babel. > > > I use swig for a pure-C module with no problems, but I'm not having luck > with an almost-identical module that links to OpenBabel. In fact, there's > one function in my OpenBabel module that doesn't call OpenBabel at all, and > that function works. > > Craig > >> >> >> - Noel >> >> On 3 April 2013 19:00, Craig James <cja...@emolecules.com> wrote: >> > This problem is driving me crazy. I have some functions written in C++ >> > with >> > a C wrapper that I need to make available from Perl. I wrote a swig >> > interface for them, and got it to compile and run. But OpenBabel can't >> > seem >> > to initialize itself. >> > >> > ./test/swig_wrapper_test.pl >> > ============================== >> > *** Open Babel Error in OBDefine >> > Failed to make an instance CompoundFilter >> > ============================== >> > *** Open Babel Error in OBDefine >> > Failed to make an instance SmartsDescriptor >> > ============================== >> > *** Open Babel Error in OBDefine >> > Failed to make an instance SmartsDescriptor >> > ============================== >> > *** Open Babel Error in OBDefine >> > Failed to make an instance SmartsDescriptor >> > ============================== >> > *** Open Babel Error in OBDefine >> > Failed to make an instance SmartsDescriptor >> > ============================== >> > *** Open Babel Error in OBDefine >> > Failed to make an instance SmartsDescriptor >> > ============================== >> > *** Open Babel Error in OBDefine >> > Failed to make an instance SmartsDescriptor >> > ============================== >> > *** Open Babel Error in OBDefine >> > Failed to make an instance OBGroupContrib >> > >> > Looking at the code (ops/loader.cpp) it seems like it can't find its >> > .txt >> > files. But other programs, such as obabel and C++ programs that I >> > compiled >> > without swig, all work fine. LD_LIBRARY_PATH is correct, and defining >> > BABEL_DATADIR doesn't make any difference. >> > >> > I'm wondering if it's related to C versus C++ internal initialization >> > ... >> > like maybe the C++ initialization code isn't being called. I used g++ >> > for >> > the "CC" and "LD" in Makefile.PL, but it made no difference. >> > >> > Any ideas? Guesses? >> > >> > Thanks, >> > Craig >> > >> > >> > >> > ------------------------------------------------------------------------------ >> > Minimize network downtime and maximize team effectiveness. >> > Reduce network management and security costs.Learn how to hire >> > the most talented Cisco Certified professionals. Visit the >> > Employer Resources Portal >> > http://www.cisco.com/web/learning/employer_resources/index.html >> > _______________________________________________ >> > OpenBabel-Devel mailing list >> > OpenBabel-Devel@lists.sourceforge.net >> > https://lists.sourceforge.net/lists/listinfo/openbabel-devel >> > > > ------------------------------------------------------------------------------ Minimize network downtime and maximize team effectiveness. Reduce network management and security costs.Learn how to hire the most talented Cisco Certified professionals. Visit the Employer Resources Portal http://www.cisco.com/web/learning/employer_resources/index.html _______________________________________________ OpenBabel-Devel mailing list OpenBabel-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-devel