Chapter 2. Configuring the Environment

PyJuggler needs all the environment variables required for execution of normal C++ VR Juggler applications. Additionally, the PyJuggler lib directory must be included in the shared library (DLL) search path so that the library libpyjutil.so (or pyjutil.dll or libpyjutil.dylib) can be found at module load time. This is normally accomplished by modifying the environment variable LD_LIBRARY_PATH, PATH, or DYLD_LIBRARY_PATH, depending on the operating system. If PyJuggler is installed so that its lib directory is already in the shared library search path, then the library search path does not have to be changed.

With the addition of Python into the mix, it may be necessary to set the PYTHONPATH environment variable. This environment variable tells Python where to look for modules outside of its default path. In other words, it augments the Python module search path to use the directories listed therein.

The need for PYTHONPATH depends on where PyJuggler is installed. If PyJuggler is installed where Python modules are installed by default, then Python will not need any help to find the PyJuggler modules. However, a pre-compiled version of PyJuggler can be installed anywhere (which is good for people who do not have administrative rights on their local system and thus cannot perform system-wide installations). For example, on a UNIX-based system, PyJuggler could be unpacked into $HOME/pyjuggler. If PyJuggler was compiled against Python 2.2, PYTHONPATH would be set as follows (assuming the use of either csh or tcsh as the user's shell):

% setenv PYTHONPATH $HOME/pyjuggler/lib/python2.2/site-packages

For more information about Python, Python modules, and environment variables utilized by the Python interpreter, refer to the on-line Python documentation.

Tip

PyOpenGL and PyGMTL may have to be handled similarly to PyJuggler as far as PYTHONPATH is concerned. It may be convenient to install all three in the same place so that only one directory must be specified in PYTHONPATH. Of course, one or both of PyOpenGL or PyGMTL may be installed in the default Python module directory, so this may not be a concern at all.

On Mac OS X, problems have been encountered with the omniORB-based plug-ins that are loaded by the JCCL Config Manager and by the VR Juggler Performance Mediator. Loading of these plug-ins can be disabled by setting the environment variables NO_RTRC_PLUGIN and NO_PERF_PLUGIN respectively. They may be set to any value. Setting these environment variables will prevent a crash inside the omniORB libraries due to static initializatoin problems.

Note

According to users of omniORBpy, setting DYLD_BIND_AT_LAUNCH should be sufficient to fix the static initialization problems within the omniORB C++ libraries when they are loaded into the Python interpreter application space on Mac OS X. Thus far, this has not proven to fix the problem when running a PyJuggler Python application, but there may be something else going wrong. For now, setting the two environment variables described above gets around the omniORB problems within the scope of PyJuggler.