SCORE Setup in Production with Eclipse
Instructions for setting up SCORE to run with eclipse on lcls-srv01 or lcls-builder, under the softegr shared account.
1) From a linux workstation, ssh to lcls-prod02 as yourself, then ssh -l softegr lcls-srv01.
2) Create an eclipse workspace directory in your shared softegr account dir (I use /home/softegr/drogind/ws_score). (You'll have to create a directory in your name under /home/softegr first to keep us all straight!)
3)(First time) Make sure you have db_score.properties in your home directory in order to connect to the score RDB.
> cd /home/softegr
?> scp drogind@lcls-prod02:~drogind/db_score.properties .
Make sure you have /home/?softegr/.java/.userPrefs/gov/sns/tools/database/prefs.xml  that points to the location of db_score.properties like this:
?[softegr@lcls-builder database]$ cat prefs.xml
<?xml version="1.0" encoding="UTF-8"?>
<map MAP_XML_VERSION="1.0"><entry key="url" value="file:/home/softegr/db_score.properties"/></map>
4)(First time) Edit your ~/.java/.userPrefs/gov/sns/jca/prefs.xml,  or copy the file from ~drogind
> cd /home/softegr
?> scp drogind@lcls-prod02:~drogind/.java/.userPrefs/gov/sns/jca/prefs.xml .
to have contents:
<?xml version="1.0" encoding="UTF-8"?>
<map MAP_XML_VERSION="1.0">
<entry key="Context" value="gov.aps.jca.jni.ThreadSafe
Context"/></map>


NOTE that next step has to be done for every user account, including the physics account for production, Control Room operation!

5) In your ~/.JCALibrary/JCALibrary.properties file, make sure you inspect the following lines and tailor for your network - you can execute a
> printenv | grep _CA to find out your repeater_port and server_port settings:
# for LCLSCA network:
gov.aps.jca.jni.JNIContext.repeater_port = 5069
gov.aps.jca.jni.JNIContext.server_port = 5068
# to use PV Gateway:
gov.aps.jca.jni.JNIContext.addr_list = lcls-prod01
# set the correct /usr/local (LCLSCA) or /nfs/local (DMZ) or /afs/slac/g/lcls (dev)
gov.aps.jca.jni.epics.linux-x86.library.path = /usr/local/lcls/epics/base/base-R3-14-8-2-lcls2/bin/linux-x86
gov.aps.jca.jni.epics.linux-x86.caRepeater.path = /usr/local/lcls/epics/base/base-R3-14-8-2-lcls2/lib/linux-x86
(can copy the file from ~softegr/.JCALibrary/JCALibrary.properties)
7) Start the eclipse IDE on afs:
 
 lcls-prod02> cd /afs/slac/package/eclipse/i386_linux24/3.3/eclipse
 lcls-prod02> eclipse
 specify the workspace dir created above
Set java compiler compliance level to 5 to avoid problem (?see Chris)
Window | Preferences|Java | Compiler | Compiler compliance level = 5
8) (From Chris's SEAL Development Guide(smile)
Once you've got your IDE running, you'll need to do a one-time setup of CVS. Open the "CVS Repository Exploring" perspective (select Window -> Open Perspective -> CVS Repository Exploring).
Right-click in the "CVS Repositories" view at the left, and select New -> Repository Location.
Supply the following values:
Host:            lcls-prod02
Repository path: /afs/slac/g/lcls/cvs
User:            [your AFS user name]
Password:        [leave blank]
Connection type: ext    // note this is different than what Chris recommends...
Leave the "Use default port" option selected, and do not select "Save password".
After clicking "Finish", you should see the newly added CVS location in the repository explorer.
9)(First time) Now find and check out xal4lcls. You can explore the repository by expanding HEAD -> physics -> xal4lcls 
Right click on xal4lcls and select "Check out".
10) (First time) Build the external jar file under xal4lcls:
   go to Navigator - Window | Show View | Navigator
   in the Navigator, right click build.xml; select Run As
   select "Ant build..." (the second ant in the list, which is xal-specific)
   in the Names list, unselect the build-xal [Default] checkbox
   select the jar-ext checkbox
   Apply and Run
   ext.jar will build.
11) (First time) Add XAL's ext.jar to the build path:
from the menu choose Project/Properties/Java build path
choose "Libraries" tab
"Add External" jars button ; jar selection dialog appears.
   In <your workspace dir>/build/jar directory,  find ext.jar and select it, press ok
Also add the following libraries for aida and error logging using jar selection dialog:
/usr/local/lcls/physics/package/except/lib/except.jar
/usr/local/lcls/physics/package/err/lib/err.jar
/usr/local/lcls/physics/package/aida/lib/aida.jar
/usr/local/lcls/package/iona/orbacus/prod/JOB/lib/OB.jar
/usr/local/lcls/package/iona/orbacus/prod/JOB/lib/OBEvent.jar
/usr/local/lcls/package/iona/orbacus/prod/JOB/lib/OBUtil.jar
Note that internal packages (such as aida, except, err) are under /usr/local/lcls/physics/package, while external packages (oracle, iona, java, ant) are in /usr/local/lcls/package.
12) Add VM arguments -
With xal4lcls highlighted in Navigator
Run | Open Run Dialog
Select Java Application, right click | New
Choose Arguments tab
In VM arguments, add:
-Xbootclasspath/p:/afs/slac.stanford.edu/package/iona/orbacus/JOB-4.2.2/lib/OB.jar -DAIDA_DATABASE_USERID=AIDAPROD -DAIDA_NAMESERVER_IOR_URL=http://mccas0.slac.stanford.edu/aida/NameServerPROD.ior -Xmx256M -XX:MaxPermSize=128M
To the Main class,

Add gov.sns.apps.score.Main
Apply, Close
13)Now you can run score:
   navigate to gov/sns/apps/score
   right click Main.java
   select Run As
   select Java Application
(the application will have to build, this may take awhile)
 

  • No labels