On Tue, Nov 15, 2011 at 5:23 PM, Marcus D. Hanwell <marcus.hanw...@kitware.com> wrote: > On Tue, Nov 15, 2011 at 5:12 PM, David Lonie <lonieda...@gmail.com> wrote: >> Hi all, >> >> I'm attempting to build a relocatable avogadro installation, and I'm >> having trouble with OpenBabel's plugin handling. The trouble seems to >> be that OpenBabel hardcodes the absolute plugin directory into >> babelconfig.h, and when I move the installation, the plugins aren't >> found, and it crashes. >> >> I also tried building static OB, and the compilation fails the >> genbankformat.cpp. >> >> I know there have been relocatable builds of OB in the past, can >> anyone share their tricks? ;-) >> > In Avogadro we set the environment variables for Open Babel (can be > seen in the code for main I believe). This allows you to ask Qt for > the location, and then figure out the relative path for OpenBabel.
Trouble is, the plugin path is hardcoded (and absolute!): plugin.cpp: OBPlugin::LoadAllPlugins: ------------------------------------------------ ... DLHandler::getConvDirectory(TargetDir); // < This fetches the path vector<string> files; if(!DLHandler::findFiles(files,DLHandler::getFormatFilePattern(),TargetDir)) { return; } ... dlhandler_unix.cpp: ------------------------------------------------ bool DLHandler::getConvDirectory(string& convPath) { string testPath; testPath += OB_MODULE_PATH; // defined in src/config.h.cmake -> babelconfig.h convPath = testPath; return true; } babelconfig.h: ------------------------------------------------ #define OB_MODULE_PATH "/usr/lib/openbabel/2.3.90" So it doesn't look like this can be adjusted via an env var. Dave ------------------------------------------------------------------------------ RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 _______________________________________________ OpenBabel-Devel mailing list OpenBabel-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-devel