what should PYTHONPATH and LD_LIBRARY_PATH be set to?
Hi,
Sorry to ask such an apparently naive question, but I haven't been able to find the answer on the mailing list, or in the documentation, or by experimenting myself... In a generic linux installation, when I'm not using an RPM, what do I need to set the PYTHONPATH and LD_LIBRARY_PATH to, in order to be able to use modeller in the typical python way (i.e. "import modeller" from within python)? The documentation indicates this is possible with modeller 9v1, if the above paths are set appropriately, but it doesn't indicate what "appropriately" means.
Thanks! David
David Mobley wrote: > Sorry to ask such an apparently naive question, but I haven't been > able to find the answer on the mailing list, or in the documentation, > or by experimenting myself... In a generic linux installation, when > I'm not using an RPM, what do I need to set the PYTHONPATH and > LD_LIBRARY_PATH to, in order to be able to use modeller in the > typical python way (i.e. "import modeller" from within python)? The > documentation indicates this is possible with modeller 9v1, if the > above paths are set appropriately, but it doesn't indicate what > "appropriately" means.
There are three components which must be located in order to successfully load the Modeller Python module:
1. The 'modeller' Python package itself, which is pure Python code. This is all of the .py files and directories which live in the 'modeller' directory under the 'modlib' directory, under whatever directory you installed Modeller in. 2. The '_modeller' Python module, which is a C extension module (and thus has the .so extension - or .pyd on Windows). This generally lives in an architecture-dependent directory under the 'lib' directory under whatever directory you installed Modeller in. 3. The Modeller dynamic library itself ('libmodeller.so' or similar), and any dependencies (e.g. HDF5). This is usually the same directory as (2).
The search path for (1) and (2) is set by PYTHONPATH, in standard Python fashion, and that for (3) is dependent on your operating system, which is why it cannot be exactly detailed in the manual (on Windows, it's set by the PATH environment variable, while on Mac DYLD_LIBRARY_PATH does it, while LIBPATH suffices on AIX, and LD_LIBRARY_PATH on most other Unix/Linux variants).
You can determine the Modeller architecture type by running the 'mod9v1' binary (in the 'bin' directory under the directory you installed Modeller in). For Linux this is usually i386-intel8 or x86_64-intel8. So assuming you installed Modeller in /opt/mod/ and you have i386-intel8 architecture you would set PYTHONPATH to /opt/mod/modlib:/opt/mod/lib/i386-intel8/ and LD_LIBRARY_PATH to /opt/mod/lib/i386-intel8/
Many people frown on setting LD_LIBRARY_PATH however, so you may want to use the rpath approach instead (relinking the SWIG Python bindings) as covered at http://salilab.org/archives/modeller_usage/2007/msg00126.html
It's unfortunate that dynamic libraries are tough to use - but that's just how dynamic libraries are. I recommend using the installer packages if you can (e.g. RPM for Linux) or asking your sysadmin to install the software if you really want to put it in a nonstandard location.
Ben Webb, Modeller Caretaker
participants (2)
-
David Mobley
-
Modeller Caretaker