So Paul very kindly got me going with SCORE + XAL + Eclipse!
 
In the interest of documenting the process, here's what we did:
 
1. cp -r /afs/slac.stanford.edu/package/eclipse/i386_linux24/3.3 to local workstation (I created a /scratch/eclipse directory on the local linux hard drive for this) (Note  NOT ~/scratch directory!)
 
2. Create a workspace directory (for me it's /scratch/eclipse_WS)
 
3. cd to the eclipse software directory and start the eclipse exe; specify your workspace directory.
 
4. Open up the CVS view and configure the CVS server as in Chris' document (definitely store the password though!); find and check out xal4lcls.
 
5. Build the external jar file:
   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.
 
6. Add 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
 
7. Once this is done, your project should begin to build automatically.
 
8. Once the build is done (it takes a few minutes) you can run score:
   navigate to gov/sns/apps/score
   right click Main.java
   select Run As
   select Java Application
 
voila!!
 
cheers,
Judy

  • No labels

3 Comments

  1. If you want to run SCORE to connect to production devices, ssh to lcls-prod02 as yourself, and start eclipse from afs:

    /afs/slac/package/eclipse/i386_linux24/3.3/eclipse

    and have your workspace be in afs space (I use ~drogind/WS_SCORE) 

    The following is from Judy.OK, here is how to set up for developing SCORE in eclipse:
    ----------------------------------------------------------

    I do this before running eclipse (I think it's from Tony the java man):

    setenv PATH /afs/slac/package/java/@sys/jdk1.5/bin/:$PATH

    Here are the jars to include in the build path (added except.jar):

    /afs/slac/g/cd/soft/ref/package/except/lib/except.jar

    /afs/slac/g/cd/soft/ref/package/err/lib/err.jar

    /afs/slac/g/cd/soft/ref/package/aida/lib/aida.jar

    /afs/slac/package/iona/orbacus/prod/JOB/lib/OB.jar

    /afs/slac/package/iona/orbacus/prod/JOB/lib/OBEvent.jar

    /afs/slac/package/iona/orbacus/prod/JOB/lib/OBUtil.jar

    xal4lcls/build/ext.jar

    To the VM arguments (Run Dialog) 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://www.slac.stanford.edu/grp/cd/soft/slaconly/aida/NameServerPROD.ior

    ~/.java/.userPrefs/gov/sns/jca/prefs.xml

    <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE map SYSTEM "http://java.sun.com/dtd/preferences.dtd">
    <map MAP_XML_VERSION="1.0">

    <entry key="Context" value="gov.aps.jca.jni.ThreadSafeContext"/></map>

    (can copy version from ~jrock)

    ~/.JCALibrary/JCALibrary.properties

    gov.aps.jca.jni.JNIContext.repeater_port = 5069

    gov.aps.jca.jni.JNIContext.server_port = 5070

    # to use PV Gateway:

    gov.aps.jca.jni.JNIContext.addr_list = lcls-prod01

    (can copy version from ~jrock)

  2. Addendum:

    1) Make sure you have db_score.properties in your home directory in order to connect to the RDB.

    You can copy from ~drogind or ~jrock.

    2) Make sure you

    source /afs/slac/g/lcls/epics/config/epicsSetup.csh                // for running lcls

    setenv PATH /afs/slac/package/java/@sys/jdk1.5/bin/:$PATH // for taylored linux boxes 

  3. Take 3?:

    Let's try these instructions next time:1) Create an eclipse workspace directory in your afs account dir (I use ~drogind/WS_SCORE). If you are low on your afs quota (fs listquota), you may have to ask for more afs space.

    2) From a linux workstation, ssh to lcls-prod02 as yourself (not laci) in order to connect to production signals from SCORE(to see some real values)

    3) Establish your linux shell environment. The following two lines can be placed in your .login file:

    setenv PATH /afs/slac/package/java/@sys/jdk1.5/bin/:$PATH

    source /afs/slac/g/lcls/epics/config/epicsSetup.csh

    4)(First time) Make sure you have db_score.properties in your home directory in order to connect to the score RDB. You can copy the file from ~drogind/db_score.properties or ~jrock/db_score.properties

    5)(First time) Edit your ~/.java/.userPrefs/gov/sns/jca/prefs.xml, or copy the file from ~drogind to have contents:

    <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE map SYSTEM "http://java.sun.com/dtd/preferences.dtd">
    <map MAP_XML_VERSION="1.0">

    <entry key="Context" value="gov.aps.jca.jni.ThreadSafeContext"/></map>

    6) In your ~/.JCALibrary/JCALibrary.properties file, make sure you have the following lines:

    gov.aps.jca.jni.JNIContext.repeater_port = 5069

    gov.aps.jca.jni.JNIContext.server_port = 5070

    # to use PV Gateway:

    gov.aps.jca.jni.JNIContext.addr_list = lcls-prod01

    (can copy the file from ~drogind/.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

    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: localhost

    Repository path: /afs/slac/g/lcls/cvs

    User: [your AFS user name]

    Password: [leave blank]

    Connection type: extssh // note this is different than what Chris recommends...

    Leave the "Use default port" option selected, and do not select "Save password".

    Note that using "localhost" for your the server assumes that your machine has AFS access. If not, use the name of any ssh-accessible server that does have AFS access.

    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:

    /afs/slac/g/cd/soft/ref/package/except/lib/except.jar

    /afs/slac/g/cd/soft/ref/package/err/lib/err.jar

    /afs/slac/g/cd/soft/ref/package/aida/lib/aida.jar

    /afs/slac/package/iona/orbacus/prod/JOB/lib/OB.jar

    /afs/slac/package/iona/orbacus/prod/JOB/lib/OBEvent.jar

    /afs/slac/package/iona/orbacus/prod/JOB/lib/OBUtil.jar

    12)To the VM arguments (Run Dialog) 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://www.slac.stanford.edu/grp/cd/soft/slaconly/aida/NameServerPROD.ior

    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)

    With any luck (hmm, there are 13 steps), you're done and running SCORE! We'll see how good these instructions really are...