UNIX: Objectivity/Python Configuration

Printer-friendly version

To configure Objectivity/Python:

Setting Your PYTHONPATH

Each application developer should set the PYTHONPATH environment variable as follows:

setenv PYTHONPATH installDir/lib

Also check your shared library search path.

Note: As a convenience, the installer creates a setup script ( installDir/setup.sh ) that contains commands for temporarily setting needed environment variables in a shell window.

Setting Up the Python Executable

The python executable does not natively interoperate with the hpuxia64, solaris86_64, and sparc64 architectures. To develop applications on these architectures with Objectivity/Python, you must customize your python executable:

Customizing Python on hpuxia64

The Objectivity/Python shared library (module) uses the shared pthread library and therefore contains Thread Local Storage (TLS); however, the hpuxia64 architecture does not natively interoperate with shared libraries that contain TLS. Consequently, for interoperation to occur, you must link the shared pthread library (and dependencies) into the python executable, so that the libraries are pre-loaded when the Objectivity/Python module is dynamically loaded.

The python executable must be built in 64-bit mode. Additional information on building hpuxia64 can be found in the Python README file which is included with your Python source distribution.

As part of customizing the python executable on  hpuxia64, the default thread stack size used by the python executable must be increased. The ideal value depends upon your application’s memory needs. An initial value of 0x50000 is recommended for most applications.

  1. Set environment variables as follows. Enter the following at a command prompt:
    setenv BASECFLAGS "+DD64 -DTHREAD_STACK_SIZE=0x50000"
    setenv LDFLAGS "-L/usr/lib/hpux64 -L."
    setenv CC cc
    setenv CXX aCC
    
  2. Run the configure script by entering the following at a command prompt:
    ./configure --without-gcc --enable-shared --with-libs="-lpthread -lCsup -lstd_v2 -lunwind"
    
  3. Unset environment variables as follows. Enter the following at a command prompt:
    unsetenv BASECFLAGS
    unsetenv LDFLAGS
    unsetenv CC 
    unsetenv CXX
    
  4. Edit the makefile as follows:
    • Remove -O from the OPT line
    • Remove -Ae from the CC line.
    • Remove -Olimit 1500 from the BASECFLAGS line.
  5. Enter the following at a command prompt:
    make
    make test
    make install
    

Customizing Python on solaris86_64 and sparc64

You must customize your solaris86_64 build and your sparc64 build of the python executable with the necessary options for use with Objectivity/Python on 64-bit architectures.

On solaris86_64

  1. Set environment variables as follows. At a command prompt, enter:
    setenv BASECFLAGS "-xarch=amd64"
    setenv LDFLAGS "-xarch=amd64"
    setenv CC "-xarch=amd64"
    
  2. Run the configure script by entering the following at a command prompt:
    ./configure --without-gcc --enable-shared     
    
  3. Enter the following at a command prompt:
    make
    make test
    make install
    

On sparc64

Note: An installation of the 64-bit version of the Tcl/Tk package is required for building the python executable on sparc64.

  1. Set environment variables as follows. At a command prompt, enter:
    setenv BASECFLAGS "-xarch=v9"
    setenv LDFLAGS "-xarch=v9"
    
    Note: Some versions of the compiler will accept the -m64 flag instead of the -xarch=v9 flag.
     
  2. Run the configure script by entering the following at a command prompt:
    ./configure
    
  3. Enter the following at a command prompt:
    make
    make test
    make install
    

Testing Objectivity/Python Setup


You can test whether Objectivity/Python is set up correctly by building and running the HelloWorld sample application provided with the installation. Refer to the readme file in:

installDir/samples/python/helloWorld
Date: 
Monday, August 20, 2012
Product: 
Objectivity/DB
Version: 
11.0