You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

This page contains information about using EPICS with MATLAB R2022b and Java in the LCLS Development and Production environments.


Attention:

All scripts in this page are assuming that your current shell is Bash.

  • If you are using some other shell such as tcsh, you can switch to bash in your current session by typing "bash" in your terminal.
  • If you wish to switch permanently to Bash as your default shell here are some instructions:

In order to change your default shell at login from tcsh (or any other shell) to Bash, please execute the following command on a Linux server on the AFS network, such as a rhel6-64* node. (You will be prompted for your password during this process):

ypchsh -s /bin/bash

After that, close the terminal and open a new one. You will be using Bash as the default shell. 

You can check if all went well with the following command in a new Terminal window:

echo $SHELL

MATLAB

Installation

For MATLAB admins (epicsmgr group members) only:

  • New versions (versions later than 2012a) of MATLAB should be installed in the 3rd-party software package area under the matlab folder:
    - Development: /afs/slac/g/lcls/package/matlab
    - Production: /usr/local/lcls/package/matlab
  • Inside the matlab directory, versions should be installed in folders that correspond to their MATLAB version, e.g. 2012a, 2019a, 2020a, 2022b, etc.

At the time of this writing, the latest version of MATLAB deployed for LCLS Development and Production is 2022b.

Individual AFS user accounts in the LCLS Development environment default to set up and use MATLAB 2012a unless overridden.

The default MATLAB versions for shared login accounts in Production are as follows:

AccountDefault MATLAB version
physics2012a
softegr2019a
laci2012a

2022b

This is 64-bit software.
The Java version used by this Matlab is Java 8.

  • Development
    /afs/slac/g/lcls/package/matlab/2022b
  • Production
    /usr/local/lcls/package/matlab/2022b

Running MATLAB

In order to set up your environment to use one of the supported versions of MATLAB, follow one of the appropriate procedures below.

2022b

  • Development

    Do not run MATLAB instances on mcclogin or lcls-prod02. MATLAB should be run on aird-b50-srv01 in DEV.

    $ source /afs/slac/g/lcls/epics/setup/epicsenv-7.0.3.1-1.0.bash
    $ source /afs/slac/g/lcls/tools/oracle/oracleSetup-R11.2.0.4.bash
    $ export MATLAB_VER=2022b
    $ export MLM_LICENSE_FILE="27010@license701,27010@license702,27010@license703"
    $ source /afs/slac/g/lcls/tools/matlab/setup/matlabSetup64.bash
    
    # Launch in desktop mode:
    $ LD_PRELOAD=${FACILITY_ROOT}/epics/base/R7.0.3.1-1.0/lib/rhel7-x86_64/libCom.so matlab &
    $ LD_PRELOAD=${FACILITY_ROOT}/epics/base/R7.0.3.1-1.0/lib/rhel7-x86_64/libCom.so /afs/slac/g/lcls/package/matlab/2022b/bin/matlab &		# If "matlab &" couldn't find the correct location, use the absolute path
    
    # Launch in terminal mode: 
    $ run_matlab.bash --matlab=2022b
  • Production (Run on softegr@lcls-srv04 in PROD)

    $ source /usr/local/lcls/epics/epicsenv-7.0.3.1-1.0.bash
    $ source /usr/local/lcls/tools/oracle/oracleSetup-R11.2.0.4.bash
    $ export MATLAB_VER=2022b 
    $ source /usr/local/lcls/tools/matlab/setup/matlabSetup64.bash
    
    # Launch in desktop mode: 
    $ LD_PRELOAD=${FACILITY_ROOT}/epics/base/R7.0.3.1-1.0/lib/rhel7-x86_64/libCom.so matlab &
    $ LD_PRELOAD=${FACILITY_ROOT}/epics/base/R7.0.3.1-1.0/lib/rhel7-x86_64/libCom.so /usr/local/lcls/package/matlab/2022b/bin/matlab &		# If "matlab &" couldn't find the correct location, use the absolute path
    
    # Launch in terminal mode: 
    $ run_matlab.bash --matlab=2022b

Configuring MATLAB

For the Development and Production environments, a set of working configuration files is already provided for users and invoked upon login. Users can override the usage of these files by having their own custom files in the folder where they launch MATLAB (see: Creating A Custom MATLAB Environment).

MATLAB is non-standard Unix software and does not adhere to values set by PATH, LD_LIBRARY_PATH, CLASSPATH, and other global environment variables that are used by most other Unix software. Instead, MATLAB uses the following configuration files to set its environment:

  • Parameters for the Java JVM that runs inside of MATLAB are configured via a java.opts file
  • The classpath is configured via a classpath.txt file
  • The library search path is configured via a librarypath.txt file

For questions on the installation and deployment of MATLAB in Development or Production, please contact:

java.opts

Description: This file is used to pass variables and configurations to the Java JVM used by MATLAB.
Location:
<matlabroot>/bin/<architecture>/java.opts
e.g., in Development environment: /afs/slac/g/lcls/package/matlab/2019a/bin/glnxa64/java.opts

Below are the working java.opts files for Development and Production.

2022b

Development
-Xbootclasspath/p:/afs/slac/g/lcls/package/iona/orbacus/prod/JOB/lib/OB.jar
-DAIDA_NAMESERVER_IOR_URL=http://mccas0.slac.stanford.edu/aida/NameServerPROD.ior
-DOOC_COSEVENTCONFIG_PATHNAME=/afs/slac/g/lcls/package/err/common/script/ooc_CosEvent_server.conf
-DAIDA_CLIENT_TIMEOUT=90
-Dgov.aps.jca.jni.JNIContext.jca.use_env=true
-Djca.use_env=true
-DEPICS_PVA_SERVER_PORT=5075
-DEPICS_PVA_BROADCAST_PORT=5076
-DEPICS_PVA_AUTO_ADDR_LIST=FALSE
-DEPICS_PVA_ADDR_LIST=134.79.219.255 lcls-dev1.slac.stanford.edu mcc-simul.slac.stanford.edu
Production
-Xbootclasspath/p:/usr/local/lcls/package/iona/orbacus/prod/JOB/lib/OB.jar
-DAIDA_NAMESERVER_IOR_URL=http://mccas0.slac.stanford.edu/aida/NameServerPROD.ior
-DOOC_COSEVENTCONFIG_PATHNAME=/u1/lcls/tools/orbacus/ooc_CosEvent_server.conf
-DAIDA_CLIENT_TIMEOUT=90
-Dgov.aps.jca.jni.JNIContext.jca.use_env=true
-Djca.use_env=true
-DEPICS_PVA_SERVER_PORT=5075
-DEPICS_PVA_BROADCAST_PORT=5076
-DEPICS_PVA_AUTO_ADDR_LIST=FALSE
-DEPICS_PVA_ADDR_LIST=172.27.3.255 172.27.131.255 172.27.43.255 172.21.40.63 mcc-dmz mccas0.slac.stanford.edu

classpath.txt

Description: This file is used to augment the Java classpath used by MATLAB.
Location:
<matlabroot>/toolbox/local/classpath.txt
e.g., in Development environment: /afs/slac/g/lcls/package/matlab/2019a/toolbox/local/classpath.txt

Below are the working changes to the default MATLAB classpath.txt files for Development and Production.

The lines listed for each file below must be APPENDED to the end of the existing default MATLAB classpath.txt file for the configuration to work. Do not remove the preceding lines in the default MATLAB classpath.txt file.

2022b

Development
# Additions to classpath.txt
# ****************************************************************************************************************
# EPICS 7 Java Interface
# ****************************************************************************************************************
/afs/slac/g/lcls/epics/java/epicsCoreJava/R7.0.8-1.0.0/products/epics-pvaccess-5.1.7.jar
/afs/slac/g/lcls/epics/java/epicsCoreJava/R7.0.8-1.0.0/products/epics-pvdata-6.1.7.jar
/afs/slac/g/lcls/epics/java/epicsCoreJava/R7.0.8-1.0.0/products/epics-ntypes-0.3.7.jar
/afs/slac/g/lcls/epics/java/epicsCoreJava/R7.0.8-1.0.0/products/epics-util-1.0.5.jar
/afs/slac/g/lcls/epics/java/epicsCoreJava/R7.0.8-1.0.0/products/jca-2.4.2.jar
/afs/slac/g/lcls/epics/extensions/R1.3.0/javalib/jca.jar
/afs/slac/g/lcls/epics/java/pvaClientJava/R4.3.2-0.0.2/products/epics-pvaclient-4.3.2.jar
# ****************************************************************************************************************
# ****************************************************************************************************************
# Oracle Database connectivity
# ****************************************************************************************************************
/afs/slac/g/lcls/package/oracle/product/11.2.0.4/linux-x86_64/jdbc/lib/ojdbc5.jar
# ****************************************************************************************************************
# ****************************************************************************************************************
# IONA ORBacus ==> CORBA-based Client Server API
# ****************************************************************************************************************
/afs/slac/g/lcls/package/iona/orbacus/prod/JOB/lib/OB.jar
/afs/slac/g/lcls/package/iona/orbacus/prod/JOB/lib/OBEvent.jar
/afs/slac/g/lcls/package/iona/orbacus/prod/JOB/lib/OBUtil.jar
# ****************************************************************************************************************
# ****************************************************************************************************************
# AIDA Interface
# ****************************************************************************************************************
/afs/slac/g/lcls/physics/package/aida/lib/aida.jar
/afs/slac/g/lcls/physics/package/aida/lib/aidadp.jar
/afs/slac/g/lcls/physics/package/err/lib/err.jar
/afs/slac/g/lcls/package/except/lib/except.jar
# ****************************************************************************************************************
# ****************************************************************************************************************
# SLAC Java APIs
# ****************************************************************************************************************
/afs/slac/g/lcls/physics/release/hlaExtensions/hlaExtensions-R2-0-0/jar/hlaExtensions.jar
/afs/slac/g/lcls/physics/release/xal4lcls/xal4lcls-R1-0-0/build/jar/ext.jar
/afs/slac/g/lcls/physics/release/xal4lcls/xal4lcls-R1-0-0/build/jar/xal.jar
/afs/slac/g/lcls/physics/release/hlaCommon/hlaCommon-R2-0-0/jar/hlaCommon.jar
/afs/slac/g/lcls/epics/extensions/R1.3.0/lib/rhel7-x86_64
/afs/slac/g/lcls/physics/release/MessageLogAPI/MessageLogAPI-R1-0-0/jar/MessageLogAPI.jar
# ****************************************************************************************************************
Production
# Additions to classpath.txt
# ****************************************************************************************************************
# EPICS 7 Java Interface
# **************************************************************************************************************** 
/usr/local/lcls/epics/java/epicsCoreJava/R7.0.8-1.0.0/products/epics-pvaccess-5.1.7.jar
/usr/local/lcls/epics/java/epicsCoreJava/R7.0.8-1.0.0/products/epics-pvdata-6.1.7.jar
/usr/local/lcls/epics/java/epicsCoreJava/R7.0.8-1.0.0/products/epics-ntypes-0.3.7.jar
/usr/local/lcls/epics/java/epicsCoreJava/R7.0.8-1.0.0/products/eepics-util-1.0.5.jar
/usr/local/lcls/epics/java/epicsCoreJava/R7.0.8-1.0.0/products/jca-2.4.2.jar
/usr/local/lcls/epics/extensions/R1.3.0/javalib/jca.jar
/usr/local/lcls/epics/java/pvaClientJava/R4.3.2-0.0.1/products/epics-pvaclient-4.3.2.jar
# ****************************************************************************************************************
# ****************************************************************************************************************
# Oracle Database connectivity
# ****************************************************************************************************************
/usr/local/lcls/package/oracle/product/11.2.0.4/linux-x86_64/jdbc/lib/ojdbc5.jar
# ****************************************************************************************************************
# ****************************************************************************************************************
# IONA ORBacus ==> CORBA-based Client Server API
# ****************************************************************************************************************
/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
# ****************************************************************************************************************
# ****************************************************************************************************************
# AIDA Interface
# ****************************************************************************************************************
/usr/local/lcls/physics/package/aida/lib/aida.jar
/usr/local/lcls/physics/package/aida/lib/aidadp.jar
/usr/local/lcls/physics/package/err/lib/err.jar
/usr/local/lcls/package/except/lib/except.jar
# ****************************************************************************************************************
# ****************************************************************************************************************
# SLAC Java APIs
# ****************************************************************************************************************
/usr/local/lcls/physics/release/hlaExtensions/hlaExtensions-R2-0-0/jar/hlaExtensions.jar
/usr/local/lcls/physics/release/xal4lcls/xal4lcls-R1-0-0/build/jar/ext.jar
/usr/local/lcls/physics/release/xal4lcls/xal4lcls-R1-0-0/build/jar/xal.jar
/usr/local/lcls/physics/release/hlaCommon/hlaCommon-R2-0-0/jar/hlaCommon.jar
/usr/local/lcls/epics/extensions/R1.3.0/lib/rhel7-x86_64
/usr/local/facet/tools/matlab/sdds/java/SDDS.jar
/usr/local/lcls/physics/release/MessageLogAPI/MessageLogAPI-R1-0-0/jar/MessageLogAPI.jar
# ****************************************************************************************************************

librarypath.txt

Description: This file is used to augment the library search path used by MATLAB.

Location:
<matlabroot>/toolbox/local/librarypath.txt

e.g., in Development environment: /afs/slac/g/lcls/package/matlab/2019a/toolbox/local/librarypath.txt

Below are the working librarypath.txt files for Development and Production.

The lines listed for each file below must be APPENDED to the end of the existing default MATLAB librarypath.txt file for the configuration to work. Do not remove the preceding lines in the default MATLAB librarypath.txt file.

2022b

Development
/afs/slac/g/lcls/epics/extensions/R1.3.0/lib/rhel7-x86_64
/afs/slac/g/lcls/epics/base/R7.0.3.1-1.0/lib/rhel7-x86_64
/afs/slac/g/lcls/package/oracle/product/11.2.0.4/linux-x86_64/lib
Production
/usr/local/lcls/epics/extensions/R1.3.0/lib/rhel7-x86_64
/usr/local/lcls/epics/base/R7.0.3.1-1.0/lib/rhel7-x86_64
/usr/local/lcls/package/oracle/product/11.2.0.4/linux-x86_64/lib


Creating A Custom MATLAB Environment

If you need to use a MATLAB environment configuration that does not match the default environment provided in Development or Production, you will need to create your own java.opts, classpath.txt or librarypath.txt files in your working directory prior to launching MATLAB.

It is strongly recommended to only override the files needed in your local workspace, since MATLAB will inspect your current working directory before looking at the global configuration files.

If you need to connect to a different set of EPICS servers, copy the java.opts file from one of the locations above to your local working directory and modify it according to your needs.

If you need to test a new JAR file, copy the classpath.txt file from one of the locations above to your local working directory and modify it according to your needs.

If you need to test a new library to add to the library path, copy the librarypath.txt file from one of the locations above to your local working directory and modify it according to your needs.

Never try to modify the existing global configuration files. If you need changes made to the global configuration files, consult the MATLAB admins for LCLS Development and Production (TID-ACS and EED Systems Group). Any changes to the global MATLAB configuration must be approved and implemented by those groups.

  • No labels