You are here: Home V2 Software Software More ... Developer Notes Memops Code Generation Porting ObjectDomain

Porting ObjectDomain

How to transfer installed ObjectDomain executables

The description here follows the install procedure when porting an existing, working imoplementation to a new computer (32 bit to 64 bit).  Some aspects may be treated in more detail on https://www.bioxdm.org/twiki/bin/view/Dev/ObjectDomainSetup, that formed the basis for this account.

Setting up the code

- Either run the ObjectDomain installer script (name like odr3-b292-sun141.bin). This does not work on 64 bit computers.

- Or get hold of the manual-install jar file (somehow) and unpack it: in a suitable directory:

$JAVA_HOME/bin/jar -xvf /path/to/odr3b292.jar

- Or copy the installed directory tree from an existing location.

If you are not copying an installed directly, you must replace ODBASE/lib/domain.jar with the version where the shared packages bug is fixed (contact CCPN).


ObjectDomain is picky about the java version it uses. Build 192 (which I have) works with Java 1.4.1, but *not* with java 1.5. So install Java 1.4.1 in a suitable place if you do nt have it (try e.g. http://java.sun.com/products/archive/)

 

Make a shell script to run objectDomain (in whatever location). Make sure it points to the right Java. E.g.:
#!/bin/sh
JRE=/home/rhf22/ObjectDomain/java141_7/j2sdk1.4.1_07
ODBASE=/home/rhf22/ObjectDomain
exec $JRE/bin/java -cp $ODBASE/lib/domain.jar:$ODBASE/python/Lib/HTMLgen:$ODBASE/doc/domainHelp.jar:$ODBASE/python/jython.jar
-Xms50000000 -Xmx250000000 objectdomain.domain.Domain
"$@"
Running this shell will run ObjectDomain

If you installed Java as root, you should run the script for the first time as root, to let the machine cache teh compiled java files.

If you have the version arising form the autoinstaller, you can instead edit the topLevel/domain file (the startup script), and comment out the line "export LD_ASSUME_KERNEL" - the startup script will then also work.

Local setup 1


Unless you have a copy of an existing installation, add the following code to the bottom of ~/ObjectDomain/python/scripts/odUserSetup.py :

# function for local user setup
def doSetup(odUser, data):
""" do setup actions
"""

# set up guid generation
try:
odUser.operator = data['operator']
odUser.organisation = data['organisation']
except KeyError:
raise "localOdUserSetup.data must define 'operator' and 'organisation'"

import sys

# add extra paths
ll = data.get('addPaths', [])
for path in ll:
if not path in sys.path:
sys.path.append(path)

# remove undesired paths
ll = data.get('removePaths', [])
for path in ll:
while path in sys.path:
sys.path.remove(path)


# do local user setup
try:
from localOdUserSetup import data as localSetupData
doSetup(odUser, localSetupData)
except ImportError:
print 'No correct localOdUserSetup found'
pass

Licensing

Enter your name, company and license key under help->Enter Registration Key to register the product.

Multibranch setup

For working with multiple parallel branches of you model and code, you need a configurationDirectory for each. Running ObjectDomain -d configurationDirectory will set up ObjectDomain correctly for each branch.

- Make a suitable directory for the configuration of a given code branch - e.g. ~/ObjectDomain/localConf/branch4
- Run objectdomain -d ~/ObjectDomain/localConf/branch4 and exit. This will create Domain.cfg, pythonConsoleHistory.dat , and systemProperties.txt.
- Replace Domain.cfg with a pre-existing Domain.cfg, if you have one. If desired, edit the lines Domain.lastModel and Domain.mruFileList in Domain.cfg
- Copy odPathmap.properties from the main ObjectDomain directory and edit the contents to suit this branch.
- Add a file localOdUserSetup.py to branch4/python/scripts. Add the python/scripts directory first. Edit localOdUserSetup.py so that the operator and organisatoin match you, and the extra paths point to the appropriate point in your CCPN code tree, where your generation code lives.
If you only want one branch, add it to ~/ObjectDomain/python/scripts. The contents should be the following:
""" information for local (branch specific) ObjectDomain user setup
"""
data = {

# parameters for guid generation
# The operator attribute is the name of the person using the setup (String)
# The organisation attribute is the web site URL of the organisation
# the operator is working for (String)
# the combination of operator and organisatoni should be a unique person.
'operator':'Fogh',
'organisation':'www.ccpn.ac.uk',

# extra paths to add to sys.path
'addPaths':('/home/rhf22/CCPN/cvsroots/trunk/ccpn/python',  # cvs root
'/usr/lib/python2.4/site-packages',),          # for ElementTree

# paths to remove from sys.path
'removePaths':('.',),
}

Running ObjectDomain

Run the objectdomain shell script with -d configDirectory

In the example above, configDirectory is  ~/ObjectDomain/localConf/branch4

I would recommend setting up aliases for running with different config directories, cd'ing to the relevant directories, and changing the PYTHONPATH to fit the different directories.